↓↓↓↓↓↓↓↓视频已上线B站↓↓↓↓↓↓↓↓
》》》》》》传送门
1.建立nova 和 nova_api数据库
2.得到 admin 凭证来获取只有管理员能执行的命令的访问权限
3.建立服务证书,用户和角色
4.建立 Compute 服务 API 端点
5.Controller节点安装软件包,并配置文件
6.同步数据库
7.启动Nova服务并设置开机启动
8.Compute节点安装计算服务并配置
9.查看计算节点是否支持虚拟硬件加速
10.计算节点启动nova服务并设置开机启动
11.验证操做(controller节点执行)
<h2 id="1">1.建立nova 和 nova_api数据库</h2>html
#mysql -uroot -p000000 >create database nova; >create database nova _api; >grant all privileges on nova.* to 'nova'@'localhost' identified by '000000'; >grant all privileges on nova.* to 'nova'@'%' identified by '000000'; >grant all privileges on nova_api.* to 'nova'@'localhost' identified by '000000'; >grant all privileges on nova_api.* to 'nova'@'%' identified by '000000'; >
<h2 id="2">2.得到 admin 凭证来获取只有管理员能执行的命令的访问权限</h2>mysql
#. /root/admin-openrc
<h2 id="3">3.建立服务证书,用户和角色</h2>sql
#openstack user create --domain default --password 000000 nova #openstack role add --project service --user nova admin 建立 nova 服务实体: #openstack service create --name nova --description "OpenStack Compute" compute
<h2 id="4">4.建立 Compute 服务 API 端点 </h2>数据库
#openstack endpoint create --region RegionOne compute public http://controller:8774/v2.1/%\(tenant_id\)s #openstack endpoint create --region RegionOne compute internal http://controller:8774/v2.1/%\(tenant_id\)s #openstack endpoint create --region RegionOne compute admin http://controller:8774/v2.1/%\(tenant_id\)s
<h2 id="5">5.Controller节点安装软件包,并配置文件</h2>api
#yum -y install openstack-nova-api openstack-nova-conductor openstack-nova-console openstack-nova-novncproxy openstack-nova-scheduler
编辑/etc/nova/nova.conf
文件
#vi /etc/nova/nova.conf 在[DEFAULT]下添加 enabled_apis = osapi_compute,metadata rpc_backend = rabbit auth_strategy = keystone my_ip = 192.168.100.10 use_neutron = True firewall_driver = nova.virt.firewall.NoopFirewallDriver 在[api_database]下添加 connection = mysql+pymysql://nova:000000@controller/nova_api 在[database]下添加 connection = mysql+pymysql://nova:000000@controller/nova 在[oslo_messaging_rabbit]下添加,配置 “RabbitMQ” 消息队列访问 rabbit_host = controller rabbit_userid = openstack rabbit_password = 000000 在[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 = 000000 在[vnc]部分,配置VNC代理使用控制节点的管理接口IP地址 vncserver_listen = 192.168.100.10 vncserver_proxyclient_address = 192.168.100.10 在 [glance] 区域,配置镜像服务 API 的位置 api_servers = http://controller:9292 在 [oslo_concurrency] 部分,配置锁路径: lock_path = /var/lib/nova/tmp
<h2 id="6">6.同步数据库</h2>bash
# su -s /bin/sh -c "nova-manage api_db sync" nova # su -s /bin/sh -c "nova-manage db sync" nova
<h2 id="7">7.启动Nova服务并设置开机启动</h2>dom
#systemctl start openstack-nova-api.service openstack-nova-consoleauth.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service #systemctl enable openstack-nova-api.service openstack-nova-consoleauth.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service
<h2 id="8">8.Compute节点安装计算服务并配置</h2>ide
1.安装nova-compute软件包
[root@compute ~]# yum -y install openstack-nova-compute
2.编辑 /etc/nova/nova.conf 配置文件
#vi /etc/nova/nova.conf 在 [DEFAULT] 下添加 rpc_backend = rabbit auth_strategy = keystone my_ip = 192.168.100.20 use_neutron = True firewall_driver = nova.virt.firewall.NoopFirewallDriver 在[oslo_messaging_rabbit]下添加 rabbit_host = controller rabbit_userid = openstack rabbit_password = 000000 在[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 = 000000 在``[vnc]``部分,启用并配置远程控制台访问 enabled = True vncserver_listen = 0.0.0.0 vncserver_proxyclient_address = 192.168.100.20 novncproxy_base_url = http://192.168.100.10:6080/vnc_auto.html 在 [glance] 区域,配置镜像服务 API 的位置: api_servers = http://controller:9292 在 [oslo_concurrency] 部分,配置锁路径: lock_path = /var/lib/nova/tmp
<h2 id="9">9.查看计算节点是否支持虚拟硬件加速</h2>memcached
#egrep -c '(vmx|svm)' /proc/cpuinfo #由于一开始建立的时候在CPU选项部分勾选了虚拟化服务,因此是这样
①若是这个命令返回了 1或者大于1 的值,那么你的计算节点支持硬件加速且不须要额外的配置。 ②若是这个命令返回了 0 值,那么你的计算节点不支持硬件加速。你必须配置 libvirt 来使用 QEMU 去代替 KVM 编辑/etc/nova/nova.conf 文件的 [libvirt] #vi /etc/nova/nova.conf 在[libvirtd]下添加 virt_type = qemu
<h2 id="10">10.计算节点启动nova服务并设置开机启动</h2>oop
[root@compute ~]# systemctl start libvirtd.service openstack-nova-compute.service [root@compute ~]# systemctl enable libvirtd.service openstack-nova-compute.service
<h2 id="11">11.验证操做(controller节点执行)</h2>
[root@controller ~]# . /root/admin-openrc 列出服务组件,查看是否成功注册并启动服务进程 [root@controller ~]# openstack compute service list