openstack controller ha测试环境搭建记录(八)——配置nova(控制节点)
在任一节点创建nova用户:
mysql -u root -p
CREATE DATABASE nova;
GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' IDENTIFIED BY '123456';
GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' IDENTIFIED BY '123456';
exit
在任一节点创建nova用户、租户、endpoint等:
source admin-openrc.sh
keystone user-create --name=nova --pass=123456
keystone user-role-add --user=nova --tenant=service --role=admin
keystone service-create --name=nova --type=compute --description="OpenStack Compute"
keystone endpoint-create \
--service-id=$(keystone service-list | awk '/ compute / {print $2}') \
--publicurl=http://myvip:8774/v2/%\(tenant_id\)s \
--internalurl=http://myvip:8774/v2/%\(tenant_id\)s \
--adminurl=http://myvip:8774/v2/%\(tenant_id\)s
在所有控制节点上安装软件:
yum install -y openstack-nova-api openstack-nova-cert openstack-nova-conductor openstack-nova-console openstack-nova-novncproxy openstack-nova-scheduler python-novaclient
在所有控制节点上设置nova连接的数据库:
openstack-config --set /etc/nova/nova.conf database connection mysql://nova:123456@myvip/nova
在所有控制节点上设置nova的主机名:
openstack-config --set /etc/nova/nova.conf DEFAULT my_ip 10.0.0.10
openstack-config --set /etc/nova/nova.conf DEFAULT vncserver_listen 10.0.0.10
openstack-config --set /etc/nova/nova.conf DEFAULT vncserver_proxyclient_address 10.0.0.10
在所有控制节点上设置认证方法:
openstack-config --set /etc/nova/nova.conf DEFAULT auth_strategy keystone
openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_uri http://myvip:5000/v2.0
openstack-config --set /etc/nova/nova.conf keystone_authtoken identity_uri http://myvip:35357
openstack-config --set /etc/nova/nova.conf keystone_authtoken admin_user nova
openstack-config --set /etc/nova/nova.conf keystone_authtoken admin_tenant_name service
openstack-config --set /etc/nova/nova.conf keystone_authtoken admin_password 123456
在所有控制节点上设置消息队列:
openstack-config --set /etc/nova/nova.conf DEFAULT rpc_backend rabbit
openstack-config --set /etc/nova/nova.conf DEFAULT rabbit_password 123456
openstack-config --set /etc/nova/nova.conf DEFAULT rabbit_hosts controller1:5672,controller2:5672,controller3:5672
openstack-config --set /etc/nova/nova.conf DEFAULT rabbit_retry_interval 1
openstack-config --set /etc/nova/nova.conf DEFAULT rabbit_retry_backoff 2
openstack-config --set /etc/nova/nova.conf DEFAULT rabbit_max_retries 0
openstack-config --set /etc/nova/nova.conf DEFAULT rabbit_durable_queues true
openstack-config --set /etc/nova/nova.conf DEFAULT rabbit_ha_queues true
在所有控制节点上设置glance主机名:
openstack-config --set /etc/nova/nova.conf glance host myvip
在所有控制节点上开启调试日志:
openstack-config --set /etc/nova/nova.conf DEFAULT verbose True
在任一节点初始化nova数据库:
su -s /bin/sh -c "nova-manage db sync" nova
在拥有VIP资源的节点启动服务:
systemctl start openstack-nova-api openstack-nova-cert openstack-nova-consoleauth openstack-nova-scheduler openstack-nova-conductor openstack-nova-novncproxy