openstack部署-glance服务安装

版权声明:转发请带出处 联系qq:1113997619 邮箱:[email protected] https://blog.csdn.net/hutiewei2008/article/details/88845421
  • 安装之前准备

数据库:

mysql -u root -p

CREATE DATABASE glance;

GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost' \

  IDENTIFIED BY '123456';

GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' \

  IDENTIFIED BY '123456';

 

. admin-openrc admin模式

openstack user create --domain default --password-prompt glance 创建glance

用户

openstack role add --project service --user glance admin 给glance添加角色

openstack service create --name glance \

  --description "OpenStack Image" image创建glance服务实体:

openstack endpoint create --region RegionOne \

  image public http://controller:9292 创建图像服务API端点

openstack endpoint create --region RegionOne \

  image internal http://controller:9292

openstack endpoint create --region RegionOne \

  image admin http://controller:9292

  • 安装和配置

yum install openstack-glance 安装包

/etc/glance/glance-api.conf 编辑文件

[database]

connection  =  mysql+pymysql://glance:123456@controller/glance

[keystone_authtoken]和[paste_deploy]部分中

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 =123456

[paste_deploy]

# ...

flavor = keystone

 

[glance_store]

#...

stores = file,http

default_store = file

filesystem_store_datadir = /var/lib/glance/images/

 

/etc/glance/glance-registry.conf

[database]

connection  =  mysql+pymysql://glance:123456@controller/glance

 

[keystone_authtoken]和[paste_deploy]部分中

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 =123456

[paste_deploy]

# ...

flavor = keystone

openstack user list 查看glance服务

填充图像服务数据库

su -s /bin/sh -c "glance-manage db_sync" glance

glance-manage db_sync数据库填充

 

# systemctl enable openstack-glance-api.service \

  openstack-glance-registry.service

# systemctl start openstack-glance-api.service \

  openstack-glance-registry.service

  • 验证安装

. admin-openrc

wget http://download.cirros-cloud.net/0.3.5/cirros-0.3.5-x86_64-disk.img下载

openstack image create "cirros" \

  --file cirros-0.3.5-x86_64-disk.img \

  --disk-format qcow2 --container-format bare \

  --public安装

日志位置 /var/log/glance

猜你喜欢

转载自blog.csdn.net/hutiewei2008/article/details/88845421