next up previous contents
Next: 驗證 Up: Glance Previous: 安裝前環境準備   Contents

安裝與設定

  1. 安裝 openstack-glance。
    [root@ip112 ~]# yum install openstack-glance
    
  2. 編輯 /etc/glance/glance-api.conf,設定如下章節:
    [root@ip112 ~]# vim /etc/glance/glance-api.conf 
    [root@ip112 ~]# egrep '^(\[database|\[keystone_auth|\[paste_deploy|\
    \[glance_store|[a-z])' /etc/glance/glance-api.conf
    [database]
    connection = mysql+pymysql://glance:123qwe@controller/glance
    [glance_store]
    stores = file,http
    default_store = file
    filesystem_store_datadir = /var/lib/glance/images/
    [keystone_authtoken]
    auth_uri = http://controller:5000
    auth_url = http://controller:5000
    memcached_servers = controller:11211
    auth_type = password
    project_domain_name = Default
    user_domain_name = Default
    project_name = service
    username = glance
    password = 123qwe
    [paste_deploy]
    flavor = keystone
    
  3. 編輯 /etc/glance/glance-registry.conf,設定如下章節:
    [root@ip112 ~]# vim /etc/glance/glance-registry.conf 
    [root@ip112 ~]# egrep '^(\[database|\[keystone_auth|\[paste_deploy|\
    \[glance_store|[a-z])' /etc/glance/glance-registry.conf 
    [database]
    connection = mysql+pymysql://glance:123qwe@controller/glance
    [keystone_authtoken]
    auth_uri = http://controller:5000
    auth_url = http://controller:5000
    memcached_servers = controller:11211
    auth_type = password
    project_domain_name = Default
    user_domain_name = Default
    project_name = service
    username = glance
    password = 123qwe
    [paste_deploy]
    flavor = keystone
    
  4. 以用戶 glance 執行 glance-manage 進行 glance 資料庫同步。
    [root@ip112 ~]# su -s /bin/sh -c "glance-manage db_sync" glance
    
  5. 啟動 openstack-glance-api openstack-glance-registry 服務,並設定開機啟動。
    [root@ip112 ~]# systemctl enable openstack-glance-api.service \
    openstack-glance-registry.service
    [root@ip112 ~]# systemctl start openstack-glance-api.service \
    openstack-glance-registry.service
    



2018-09-19