搭建云平台 glance 安装及纠错(超详细)
glance 安装
再次重启虚拟机后再次用Xshell连接查看用户列表发现报错了:
openstack user list
目测是环境变量没保存,开机要重新配置,为了防止每次开机都要重新配置。。。。。。来解决问题:
将环境配置到 /etc/profile 中
vim /etc/profile
还是失败!!!
奥,没有刷新 、、、、、、、、、、、,刷新一下
下面来安装glance
#进入mysql命令交互行建库
mysql -u root -p
create database glance;
#授权后推出命令式交互行
grant all privileges on glance.* to ‘glance’@‘localhost’ identified by ‘glance’;
grant all privileges on glance.* to ‘glance’@’%’ identified by ‘glance’;
grant all privileges on glance.* to ‘glance’@‘tsw02’ identified by ‘glance’;
quit
openstack user create --domain Default --password-prompt glance;
给glance admin(超级管理员)权限
openstack role add --project admin --user glance admin
openstack service create --name glance --description “Openstack Image” image
openstack endpoint create --region RegionOne image public http://192.168.253.132:9292
openstack endpoint create --region RegionOne image internal http://192.168.253.132:9292
openstack endpoint create --region RegionOne image admin http://192.168.253.132:9292
安装glance
yum install -y openstack-glance
#配置
vim /etc/glance/glance-api.conf
[database]
…
connection =mysql+pymysql://glance:glance@192.168.253.132/glance
[keystone_authtoken]
…
auth_uri =http://192.168.253.132:5000
auth_url =http://192.168.253.132:5000
memcached_servers =192.168.253.132:11211
auth_type =password
project_domain_name =Default
user_domain_name =Default
project_name =service
username =glance
password =glance
[paste_deploy]
…
flavor = keystone
[glance_store]
…
stores = file,http
default_store = file
filesystem_store_datadir = /var/lib/glance/images/
配置
vim /etc/glance/glance-registry.conf
[database]
…
connection = mysql+pymysql://glance:glance@192.168.253.132/glance
[keystone_authtoken]
…
auth_uri =http://192.168.253.132:5000
auth_url =http://192.168.253.132:5000
memcached_servers =192.168.253.132:11211
auth_type =password
project_domain_name =Default
user_domain_name =Default
project_name =service
username =glance
password =glance
[paste_deploy]
…
flavor = keystone
glance-manage db_sync
systemctl start openstack-glance-api
systemctl start openstack-glance-registry
查看状态,第一个启动失败,第二个启动成功
解决问题:
查看日志发现api.log权限问题:
修改一下权限:
chown -R glance:glance /var/log/glance/api.log
systemctl start openstack-glance-api
systemctl status openstack-glance-api
mysql -u root -p;
use glance;
show tables;
如上图所示成功了。
- 点赞
- 收藏
- 关注作者
评论(0)