二、控制节点
1. 安装NTP,用于同步时间
# apt-get install ntp
2. 安装mysql
apt-get install mysql-server python-mysqldb
允许所有ip地址的连接
# sed -i 's/127.0.0.1/0.0.0.0/g' /etc/mysql/my.cnf
# service mysql restart
3. 安装消息队列
# apt-get install -y rabbitmq-server
4. 创建数据库(-u表示用户,-p表示密码)
mysql -uroot -phuawei<
5. 安装keystone
# apt-get install keystone
编辑 /etc/keystone/keystone.conf
connection = mysql://keystone:tsj@128.6.3.33/keystone
重启keystone(让它去连数据库)
# service keystone restart
同步(填充数据库表)
# keystone-manage db_sync
然后创建认证用的tenant,user,service,endpoint等等
这里直接使用两个脚本(从我blog下载,出处是陈沙克的G版本安装指导,然后我针对H版本改吧改吧,上传到单板执行)
#bash ./keystone.sh
#bash ./endpoint.sh
6. 安装Glance
# apt-get install glance
编辑 /etc/glance/glance-api-paste.ini
[filter:authtoken]
paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory
delay_auth_decision = true
auth_host = 128.6.3.33
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = glance
admin_password = tsj
编辑 /etc/glance/glance-registry-paste.ini
[filter:authtoken]
paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory
auth_host = 128.6.3.33
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = glance
admin_password = tsj
编辑 /etc/glance/glance-api.conf
sql_connection = mysql://glance:tsj@128.6.3.33/glance
[paste_deploy]
flavor = keystone
编辑 /etc/glance/glance-registry.conf
sql_connection = mysql://glance:tsj@128.6.3.33/glance
[paste_deploy]
flavor = keystone
重启服务
# service glance-api restart; service glance-registry restart
同步
# glance-manage db_sync
创建image (自己下载cirros镜像到单板,这放在 /opt/img 路径下)
# glance image-create --name cirros --is-public true --container-format bare --disk-format qcow2 < /opt/img/cirros-0.3.0-x86_64-disk.img
# glance image-create --name="Ubuntu 12.04" --public --container-format=ovf --disk-format=qcow2 < /opt/img/precise-server-cloudimg-amd64-disk1.img
验证
#glance image-list