配置安装nova compute服务
安装controller节点
一、创建nova数据库
[root@controller ~]# mysql -u root -p >>CREATE DATABASE nova_api; >>CREATE DATABASE nova; >>GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'localhost' IDENTIFIED BY 'NOVA_DBPASS'; >>GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'%' IDENTIFIED BY 'NOVA_DBPASS'; >>GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' IDENTIFIED BY 'NOVA_DBPASS'; >>GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' IDENTIFIED BY 'NOVA_DBPASS';
NOVA_DBPASS改为自己要设置的密码
二、创建服务实体和api接口
[root@controller ~]#source /root/admin-openrc.sh [root@controller ~]# openstack user create --domain default --password-prompt nova [root@controller ~]# openstack role add --project service --user nova admin [root@controller ~]# openstack service create --name nova --description "OpenStack Compute" compute [root@controller ~]# openstack endpoint create --region RegionOne compute public http://controller:8774/v2.1/%\(tenant_id\)s [root@controller ~]# openstack endpoint create --region RegionOne compute internal http://controller:8774/v2.1/%\(tenant_id\)s [root@controller ~]# openstack endpoint create --region RegionOne compute admin http://controller:8774/v2.1/%\(tenant_id\)s
三、安装nova服务
[root@controller ~]# yum install openstack-nova-api openstack-nova-conductor openstack-nova-console openstack-nova-novncproxy openstack-nova-scheduler
编辑nova服务配置文件
[root@controller ~]# mv /etc/nova/nova.conf /etc/nova/nova.conf_bak [DEFAULT] enabled_apis = osapi_compute,metadata rpc_backend = rabbit auth_strategy = keystone my_ip = 10.0.0.11 use_neutron = True firewall_driver = nova.virt.firewall.NoopFirewallDriver [api_database] connection = mysql+pymysql://nova:NOVA_DBPASS@controller/nova_api #改为自己数据库的密码 [database] connection = mysql+pymysql://nova:NOVA_DBPASS@controller/nova #改为自己数据库的密码 [oslo_messaging_rabbit] rabbit_host = controller rabbit_userid = openstack rabbit_password = RABBIT_PASS #改为自己rabbitmq的密码 [keystone_authtoken] auth_uri = http://controller:5000 auth_url = http://controller:35357 memcached_servers = controller:11211 auth_type = password project_domain_name = default user_domain_name = default project_name = service username = nova password = NOVA_PASS #改为自己nova服务的密码 [vnc] vncserver_listen = $my_ip vncserver_proxyclient_address = $my_ip [glance] api_servers = http://controller:9292 [oslo_concurrency] lock_path = /var/lib/nova/tmp
同步数据库
[root@controller ~]# su -s /bin/sh -c "nova-manage api_db sync" nova [root@controller ~]# su -s /bin/sh -c "nova-manage db sync" nova
启动服务,并添加到开机启动
[root@controller ~]# systemctl enable openstack-nova-api.service openstack-nova-consoleauth.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service [root@controller ~]# systemctl start openstack-nova-api.service openstack-nova-consoleauth.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service
安装compute节点
一、安装nova服务
[root@compute1 ~]# yum install openstack-nova-compute
编辑配置文件
[root@compute1 ~]#mv /etc/nova/nova.conf /etc/nova/nova.conf_bak [root@compute1 ~]#vim /etc/nova/nova.conf [DEFAULT] rpc_backend = rabbit auth_strategy = keystone my_ip = MANAGEMENT_INTERFACE_IP_ADDRESS #填写本机的管理ip,就是10.0.0段的 use_neutron = True firewall_driver = nova.virt.firewall.NoopFirewallDriver [oslo_messaging_rabbit] rabbit_host = controller rabbit_userid = openstack rabbit_password = RABBIT_PASS #填写你rabbit的密码 [keystone_authtoken] auth_uri = http://controller:5000 auth_url = http://controller:35357 memcached_servers = controller:11211 auth_type = password project_domain_name = default user_domain_name = default project_name = service username = nova password = NOVA_PASS #填写你nova服务的密码 [vnc] enabled = True vncserver_listen = 0.0.0.0 vncserver_proxyclient_address = $my_ip novncproxy_base_url = [glance] api_servers = http://controller:9292 [oslo_concurrency] lock_path = /var/lib/nova/tmp [libvirt] virt_type = qemu #在命令行执行egrep -c '(vmx|svm)' /proc/cpuinfo 如果返回0,就是qemu 如果是1,就 是kvm
启动nova相关服务,并加入开机启动。
[root@compute1 ~]# systemctl enable libvirtd.service openstack-nova-compute.service [root@compute1 ~]# systemctl start libvirtd.service openstack-nova-compute.service
二、验证
在controller节点执行
[root@controller ~]# source /root/admin-openrc.sh [root@controller ~]# openstack compute service list +----+------------------+------------+----------+---------+-------+----------------------------+ | Id | Binary | Host | Zone | Status | State | Updated At | +----+------------------+------------+----------+---------+-------+----------------------------+ | 1 | nova-consoleauth | controller | internal | enabled | up | 2016-06-16T11:55:21.000000 | | 2 | nova-conductor | controller | internal | enabled | up | 2016-06-16T11:55:18.000000 | | 3 | nova-scheduler | controller | internal | enabled | up | 2016-06-16T11:55:25.000000 | | 6 | nova-compute | compute1 | nova | enabled | up | 2016-06-16T11:55:22.000000 | | 7 | nova-compute | compute2 | nova | enabled | down | 2016-06-16T08:41:19.000000 | +----+------------------+------------+----------+---------+-------+----------------------------+ 我的compute2暂时没启动所以是down状态。
出现上面信息表示成功。
network服务安装请参考:
转载于:https://blog.51cto.com/venuxs/1795985