openstack M版安装 compute(nova)服务篇
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了openstack M版安装 compute(nova)服务篇相关的知识,希望对你有一定的参考价值。
配置安装nova compute服务
安装controller节点
一、创建nova数据库
[[email protected] ~]# 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接口
[[email protected] ~]#source /root/admin-openrc.sh [[email protected] ~]# openstack user create --domain default --password-prompt nova [[email protected] ~]# openstack role add --project service --user nova admin [[email protected] ~]# openstack service create --name nova --description "OpenStack Compute" compute [[email protected] ~]# openstack endpoint create --region RegionOne compute public [[email protected] ~]# openstack endpoint create --region RegionOne compute internal http://controller:8774/v2.1/%\(tenant_id\)s [[email protected] ~]# openstack endpoint create --region RegionOne compute admin http://controller:8774/v2.1/%\(tenant_id\)s
三、安装nova服务
[[email protected] ~]# yum install openstack-nova-api openstack-nova-conductor openstack-nova-console openstack-nova-novncproxy openstack-nova-scheduler
编辑nova服务配置文件
[[email protected] ~]# 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:[email protected]/nova_api #改为自己数据库的密码 [database] connection = mysql+pymysql://nova:[email protected]/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
同步数据库
[[email protected] ~]# su -s /bin/sh -c "nova-manage api_db sync" nova [[email protected] ~]# su -s /bin/sh -c "nova-manage db sync" nova
启动服务,并添加到开机启动
[[email protected] ~]# systemctl enable openstack-nova-api.service openstack-nova-consoleauth.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service [[email protected] ~]# systemctl start openstack-nova-api.service openstack-nova-consoleauth.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service
安装compute节点
一、安装nova服务
[[email protected] ~]# yum install openstack-nova-compute
编辑配置文件
[[email protected] ~]#mv /etc/nova/nova.conf /etc/nova/nova.conf_bak [[email protected] ~]#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相关服务,并加入开机启动。
[[email protected] ~]# systemctl enable libvirtd.service openstack-nova-compute.service [[email protected] ~]# systemctl start libvirtd.service openstack-nova-compute.service
二、验证
在controller节点执行
[[email protected] ~]# source /root/admin-openrc.sh [[email protected] ~]# 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服务安装请参考:
本文出自 “venuxs” 博客,请务必保留此出处http://venuxs.blog.51cto.com/11763538/1795985
以上是关于openstack M版安装 compute(nova)服务篇的主要内容,如果未能解决你的问题,请参考以下文章
OpenStack---M版---双节点搭建---Nova安装和配置
OpenStack---M版---双节点搭建---Cinder安装和配置
OpenStack---M版---双节点搭建---Neutron安装和配置
B10-openstack高可用(t版)-nova计算节点节点集群部署