openstack学习-nove控制节点部署(四)

nove在openstack非常重要,主要负责创建虚拟机

nova计算服务

API :负责接收和响应外部请求。支持openstack API,EC2 API

Cert:负责身份认证EC 2

Scheduler:用于云主机调度,负责虚拟机创建在那个计算的节点上

Conductor:数据节点访问数据的中间件

Consoleauth:用于控制台的授权验证

Novncproxy:VNC代理

 一、控制节点安装

[root@linux-node1 ~]# yum install -y openstack-nova-api openstack-nova-placement-api 
  openstack-nova-conductor openstack-nova-console 
  openstack-nova-novncproxy openstack-nova-scheduler

 安装之后配置文件在/etc/nova下

日志文件在/var/log/nova下

二、数据库配置

[root@linux-node1 ~]# vim /etc/nova/nova.conf
[api_database]
connection= mysql+pymysql://nova:nova@192.168.56.11/nova_api
[database]
connection= mysql+pymysql://nova:nova@192.168.56.11/nova

三、RabbitMQ配置

这一项很容易配置出错,有几个transport_url不要配置错误

[root@linux-node1 ~]# vim /etc/nova/nova.conf
[DEFAULT]
transport_url = rabbit://openstack:openstack@192.168.56.11

四、Keystone相关配置

[root@linux-node1 ~]# vim /etc/nova/nova.conf
[api]
auth_strategy=keystone
[keystone_authtoken]
auth_uri = http://192.168.56.11:5000
auth_url = http://192.168.56.11:35357
memcached_servers = 192.168.56.11:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = nova
password = nova

五、关闭Nova的防火墙功能

[DEFAULT]
use_neutron=true
firewall_driver = nova.virt.firewall.NoopFirewallDriver

六、VNC配置

[root@linux-node1 ~]# vim /etc/nova/nova.conf
[vnc]
enabled=true
server_listen = 0.0.0.0
server_proxyclient_address = 192.168.56.11

七、设置glance

[glance]
api_servers = http://192.168.56.11:9292

八、配置锁路径

[oslo_concurrency]
lock_path=/var/lib/nova/tmp

九、设置启用的api

[DEFAULT]
enabled_apis=osapi_compute,metadata

十、设置placement

[placement]
os_region_name = RegionOne
project_domain_name = Default
project_name = service
auth_type = password
user_domain_name = Default
auth_url = http://192.168.56.11:35357/v3
username = placement
password = placement

十一、修改nova-placement-api.conf

在<VirtualHost></VirtualHost>之间添加如下代码

[root@linux-node1 ~]# vim /etc/httpd/conf.d/00-nova-placement-api.conf
<Directory /usr/bin>
   <IfVersion >= 2.4>
      Require all granted
   </IfVersion>
   <IfVersion < 2.4>
      Order allow,deny
      Allow from all
   </IfVersion>
</Directory>

十二、数据库操作

1、同步nova-api数据库

[root@linux-node1 ~]# su -s /bin/sh -c "nova-manage api_db sync" nova

2、注册cell0数据库

[root@linux-node1 ~]# su -s /bin/sh -c "nova-manage cell_v2 map_cell0" nova

3、创建cell1的cell

[root@linux-node1 ~]# su -s /bin/sh -c "nova-manage cell_v2 create_cell --name=cell1 --verbose" nova

4、同步nova数据库

[root@linux-node1 ~]# su -s /bin/sh -c "nova-manage db sync" nova

5、验证cell0和cell1的注册是否正确

[root@linux-node1 ~]# nova-manage cell_v2 list_cells

6、测试数据库同步情况

[root@linux-node1 ~]#mysql -h 192.168.56.11 -unova -pnova -e " use nova;show tables;"
[root@linux-node1 ~]#mysql -h 192.168.56.11 -unova -pnova -e " use nova_api;show tables;"

十三、启动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

十四、Nova服务注册

# source admin-openstack.sh
# openstack service create --name nova --description "OpenStack Compute" compute
# openstack endpoint create --region RegionOne compute public http://192.168.56.11:8774/v2.1
# openstack endpoint create --region RegionOne compute internal http://192.168.56.11:8774/v2.1
# openstack endpoint create --region RegionOne compute admin http://192.168.56.11:8774/v2.1

# openstack service create --name placement --description "Placement API" placement
# openstack endpoint create --region RegionOne placement public http://192.168.56.11:8778
# openstack endpoint create --region RegionOne placement internal http://192.168.56.11:8778
# openstack endpoint create --region RegionOne placement admin http://192.168.56.11:8778

十五、验证控制节点服务

[root@linux-node1 ~]# openstack host list
+-------------------------+-------------+----------+
| Host Name               | Service     | Zone     |
+-------------------------+-------------+----------+
| linux-node1.example.com | conductor   | internal |
| linux-node1.example.com | consoleauth | internal |
| linux-node1.example.com | scheduler   | internal |
+-------------------------+-------------+----------+
[root@linux-node1 ~]# 
[root@linux-node1 ~]# 
[root@linux-node1 ~]# openstack  service  list
+----------------------------------+-----------+-----------+
| ID                               | Name      | Type      |
+----------------------------------+-----------+-----------+
| 7a75ea530f2d4af59e3ab423bd47a11b | keystone  | identity  |
| 9259c8ff22ff421ca504e73e50690394 | placement | placement |
| a6e0622122a54636bf3e7839a8aa005d | nova      | compute   |
| c111910dcb8d40adb911c24e5495ec90 | glance    | image     |
+----------------------------------+-----------+-----------+

控制节点安装完成!!!!!!