控制节点安装
1.控制节点安装
[root@linux-node1 ~]# yum install -y openstack-nova-api \
openstack-nova-conductor openstack-nova-console \
openstack-nova-novncproxy openstack-nova-scheduler
2.设置启用的api
[DEFAULT]
enabled_apis=osapi_compute,metadata
3.数据库配置
[root@linux-node1 ~]# vim /etc/nova/nova.conf
[api_database]
connection= mysql+pymysql://nova:nova@192.168.8.11/nova_api
[database]
connection= mysql+pymysql://nova:nova@192.168.8.11/nova
4.RabbitMQ配置
[root@linux-node1 ~]# vim /etc/nova/nova.conf
[DEFAULT]
transport_url = rabbit://openstack:openstack@192.168.8.11
5.Keystone相关配置
[root@linux-node1 ~]# vim /etc/nova/nova.conf
[DEFAULT]
auth_strategy=keystone
[keystone_authtoken]
auth_uri = http://192.168.8.11:5000
auth_url = http://192.168.8.11:35357
memcached_servers = 192.168.8.11:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = nova
password = nova
6.关闭Nova的防火墙功能
[DEFAULT]
use_neutron=true
firewall_driver = nova.virt.firewall.NoopFirewallDriver
在nova这个包里面有个virt目录,这个目录下有个firewall文件,这个文件里面有个NoopFirewallDriver的class类
# find / -name nova
/usr/lib/python2.7/site-packages/nova
# less /usr/lib/python2.7/site-packages/nova/virt/firewall.py
7.VNC配置
[root@linux-node1 ~]# vim /etc/nova/nova.conf
[vnc]
vncserver_listen=0.0.0.0
vncserver_proxyclient_address=192.168.8.11
8.设置glance
[glance]
api_servers=http://192.168.8.11:9292
9.在 [oslo_concurrency] 部分,配置锁路径:
[oslo_concurrency]
lock_path=/var/lib/nova/tmp
10.同步数据库
[root@linux-node1 ~]# su -s /bin/sh -c "nova-manage api_db sync" nova
11.同步nova数据库
[root@linux-node1 ~]# su -s /bin/sh -c "nova-manage db sync" nova
12.测试数据库同步情况
[root@linux-node1 ~]#mysql -h 192.168.8.11 -unova -pnova -e " use nova;show tables;"
[root@linux-node1 ~]#mysql -h 192.168.8.11 -unova -pnova -e " use nova_api;show tables;"
13.启动Nova Service
# systemctl enable openstack-nova-api.service \
openstack-nova-consoleauth.service openstack-nova-scheduler.service \
openstack-nova-conductor.service openstack-nova-novncproxy.service
# systemctl start openstack-nova-api.service \
openstack-nova-consoleauth.service openstack-nova-scheduler.service \
openstack-nova-conductor.service openstack-nova-novncproxy.service
11.Nova服务注册
# source admin-openstack.sh
# openstack service create --name nova --description "OpenStack Compute" compute
openstack endpoint create --region RegionOne \
compute public http://192.168.8.11:8774/v2.1/%\(tenant_id\)s
openstack endpoint create --region RegionOne \
compute internal http://192.168.8.11:8774/v2.1/%\(tenant_id\)s
openstack endpoint create --region RegionOne \
compute admin http://192.168.8.11:8774/v2.1/%\(tenant_id\)s
验证控制节点服务
# openstack service list
# openstack endpoint list
# openstack host list
# nova service-list
计算节点安装
[root@linux-node2 ~]# yum install -y openstack-nova-compute
[root@linux-node1 ~]# scp /etc/nova/nova.conf 192.168.8.12:/etc/nova/
[root@linux-node2 ~]# chown root:nova /etc/nova/nova.conf
1.删除多余的数据配置
[api_database]
connection=mysql+pymysql://nova:nova@192.168.8.11/nova_api
[database]
connection=mysql+pymysql://nova:nova@192.168.8.11/nova
2.修改VNC配置
计算节点需要监听所有IP,同时设置novncproxy的访问地址
[vnc]
enabled=true
vncserver_listen=0.0.0.0
vncserver_proxyclient_address=192.168.8.12
novncproxy_base_url = http://192.168.8.11:6080/vnc_auto.html
3.虚拟化适配
[root@linux-node2 ~]# egrep -c '(vmx|svm)' /proc/cpuinfo
[root@linux-node2 ~]# egrep \ '(vmx|svm)' /proc/cpuinfo
[libvirt]
virt_type=qemu
如果返回的是非0的值,那么表示计算节点服务器支持硬件虚拟化,需要在nova.conf里面设置
[libvirt]
virt_type=kvm
diff比较一下
# scp /etc/nova/nova.conf 192.168.8.12:/opt/
# diff /etc/nova/nova.conf /opt/nova.conf
查看log
# tail -f /var/log/messages
# tail -f /var/log/nova/nova-compute.log
启动nova-compute
# systemctl enable libvirtd.service openstack-nova-compute.service
# systemctl start libvirtd.service openstack-nova-compute.service
验证计算节点
[root@linux-node1 ~]# openstack host list
[root@linux-node1 ~]# openstack compute service list
[root@linux-node1 ~]# nova service-list
未经允许不得转载:Linux备忘录 » (4)Nova