目录一 简单架构图示参考二 部署glancestep 1:glance关于数据库的操作step 2:glance关于keystone的操作step 3:安装软件包step 4:配置/
yum install memcached python-memcached
systemctl enable memcached.service
systemctl start memcached.service
Mysql -u root -p #登入数据库
CREATE DATABASE glance; #新建库keystone
GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost' \
IDENTIFIED BY '123'; #新建本地访问glance库的账号
GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' \
IDENTIFIED BY '123'; #新建远程访问glance库的账号
soure admin-openrc #执行管理员脚本
#为glance的使用者创建用户
openstack user create --domain default --passWord-prompt glance
#对glance-service添加role角色,提示:用户glance只有在一个确定的项目service内才有角色的概念,单独的用户或者单独的项目都是无法绑定角色的。
openstack role add --project service --user glance admin
#创建glance服务的catalog:service+endpoint
openstack service create --name glance \
--description "OpenStack Image" image
openstack endpoint create --region RegionOne \
image public Http://192.168.31.57:9292
openstack endpoint create --region RegionOne \
image internal http://192.168.31.57:9292
openstack endpoint create --region RegionOne \
image admin http://192.168.31.57:9292
yum -y install openstack-glance
大前提:每一条配置都应该新增到文件中,一定不要打开注释在原有的基础上修改。
创建本地存储:
1.一定要在opesntack-glance-api.service服务启动之前部署好存储设备,因为该服务在启动时会加载存储驱动检索存储设备,如果事先不存在,就意味着该服务没有识别到任何可用的存储设备,即便是后来你又新增了存储,仍然是无效的,最终导致你上传镜像失败;
2.一定要赋予opesntack-glance-api.service服务对存储设备的可写权限。
mkdir -p /var/lib/glance/images
chown -R glance.glance /var/lib/glance/images
配置/etc/glance/glance-api.conf
[database]
connection = mysql+pymysql://glance:123@192.168.31.57/glance
[keystone_authtoken]
auth_uri = http://192.168.31.57:5000
auth_url = http://192.168.31.57:35357
memcached_servers = 192.168.31.57:11211
auth_type = password
project_domain_name = Default
user_domain_name = Default
project_name = service
username = glance
password = 123
[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:123@192.168.31.57/glance
[keystone_authtoken]
auth_uri = http://192.168.31.57:5000
auth_url = http://192.168.31.57:35357
memcached_servers = 192.168.31.57:11211
auth_type = password
project_domain_name = Default
user_domain_name = Default
project_name = service
username = glance
password = 123
[paste_deploy]
flavor = keystone
su -s /bin/sh -c "glance-manage db_sync" glance
'''
忽略以下打印,此乃正常性行为:
Option "verbose" from group "DEFAULT" is deprecated for removal. Its value may be silently ignored in the future.
/usr/lib/Python2.7/site-packages/oslo_db/sqlalchemy/enginefacade.py:1171:...... oslo_db.sqlalchemy.enginefacade
...... a future release.")
result = self._query(query)
'''
systemctl enable openstack-glance-api.service \
openstack-glance-registry.service
systemctl start openstack-glance-api.service \
openstack-glance-registry.service
source admin-openrc
#如果没有wget则必须yum -y install wget
wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img
openstack image create "cirros" \
--file cirros-0.3.4-x86_64-disk.img \
--disk-fORMat qcow2 --container-format bare \
--public
openstack image list
For information about the openstack image create parameters, see Create or update an image (glance) in the OpenStack User Guide.
For information about disk and container formats for images, see Disk and container formats for images in the OpenStack Virtual Machine Image Guide.
以上就是openstack云计算之glance部署及操作步骤的详细内容,更多关于openstack云计算glance部署操作的资料请关注编程网其它相关文章!
--结束END--
本文标题: openstack云计算组件glance部署及操作步骤
本文链接: https://lsjlt.com/news/146583.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0