zoukankan      html  css  js  c++  java
  • openstack stein部署手册 4. glance

    # 建立数据库用户及权限
    create database glance;
    grant all privileges on glance.* to glance@'localhost' identified by 'Abc@123';
    grant all privileges on glance.* to glance@'%' identified by 'Abc@123';
    flush privileges;
    

    # 建立用户、角色、服务、项目、域、端点
    source ~/.openstack_admin
    openstack user create --domain default --project service --password Abc@123 glance
    openstack role add --project service --user glance admin
    openstack service create --name glance --description "OpenStack Image service" image
    
    openstack endpoint create --region RegionOne image public http://controller:9292
    openstack endpoint create --region RegionOne image internal http://controller:9292
    openstack endpoint create --region RegionOne image admin http://controller:9292
    

    # 安装程序包
    yum install -y openstack-glance
    

    # 变更配置文件
    cd /etc/glance/ 
    mv glance-api.conf glance-api.conf.org
    
    cat > /etc/glance/glance-api.conf << EOF
    [DEFAULT]
    bind_host = 0.0.0.0
    
    [database]
    connection = mysql+pymysql://glance:Abc@123@controller/glance
    
    [keystone_authtoken]
    www_authenticate_uri = http://controller:5000
    auth_url = http://controller:5000/v3
    memcached_servers = controller:11211
    auth_type = password
    project_domain_name = default
    user_domain_name = default
    project _name = service
    username = glance
    password = Abc@123
    
    [paste_deploy]
    flavor = keystone
    
    [glance_store]
    stores = file,http
    default_store = file
    filesystem_store_datadir = /var/lib/glance/images/
    EOF
    
    chmod 640 /etc/glance/glance-api.conf
    chown root:glance /etc/glance/glance-api.conf
    

    # 同步数据库
    su -s /bin/bash -c "glance-manage db_sync" glance
    

    # 开启服务
    systemctl restart openstack-glance-api && systemctl enable openstack-glance-api
    

    # 验证
    互联网下载cp cirros-0.4.0-x86_64-disk.img, CentOS-7-x86_64-GenericCloud.qcow2文件
    
    openstack image create "cirros" --file /tmp/cirros-0.4.0-x86_64-disk.img --disk-format qcow2 --container-format bare --public
    openstack image create "centos-7-x86" --file /tmp/CentOS-7-x86_64-GenericCloud.qcow2 --disk-format qcow2 --container-format bare --public
    
    openstack image list
    

  • 相关阅读:
    MySQL锁机制和主从复制
    MySQL索引优化
    MySQL的Explain
    事务并发问题和隔离级别
    解决angular单页面页面底部跳转到新页面滚动条不在顶部的问题
    关于字符串在ie浏览器拼接问题
    angular 新建命令
    angular 多路由模块新建组件的方法
    Angular 4.x NgClass ngStyle 指令用法
    slideDown()、slideUp()反复执行的问题
  • 原文地址:https://www.cnblogs.com/liujitao79/p/11870763.html
Copyright © 2011-2022 走看看