openstack controller ha测试环境搭建记录(九)——配置nova(计算节点)
编辑所有节点的/etc/hosts:
10.0.0.14 controller1
10.0.0.12 controller2
10.0.0.13 controller3
10.0.0.10 myvip
10.0.0.21 network
10.0.0.31 compute1
10.0.0.41 block1
10.0.0.51 object1
10.0.0.52 object2
在计算节点上安装软件:
yum install -y openstack-nova-compute sysfsutils
修改/etc/nova/nova.conf:
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
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 my_ip 10.0.0.31
openstack-config --set /etc/nova/nova.conf DEFAULT vnc_enabled True
openstack-config --set /etc/nova/nova.conf DEFAULT vncserver_listen 0.0.0.0
openstack-config --set /etc/nova/nova.conf DEFAULT vncserver_proxyclient_address 10.0.0.31
openstack-config --set /etc/nova/nova.conf DEFAULT novncproxy_base_url http://myvip:6080/vnc_auto.html
openstack-config --set /etc/nova/nova.conf glance host myvip
openstack-config --set /etc/nova/nova.conf DEFAULT verbose True
查看cpu是否支持硬件虚拟化:
egrep -c '{vmx|svm}' /proc/cpuinfo
由于我的屏幕输出是0,故再添加配置:
openstack-config --set /etc/nova/nova.conf libvirt virt_type qemu
启动服务并设置为开机自动启动:
systemctl enable libvirtd.service openstack-nova-compute.service
systemctl start libvirtd.service openstack-nova-compute.service