openstack学习-nove计算节点部署(五)

nova-compute一般运行在计算节点上,通过message Queue接收管理VM的生命周期

nova-compute通过Libvirt管理KVM,通过XenAPI管理Xen等

一、安装OpenStack仓库

yum install -y centos-release-openstack-queens

 

二、安装openstack-nova-compute

[root@linux-node2 ~]# yum install -y openstack-nova-compute sysfsutils

 

三、拷贝控制节点配置文件

[root@linux-node1 ~]# scp /etc/nova/nova.conf 192.168.56.12:/etc/nova/nova.conf
[root@linux-node2 ~]# chown root:nova /etc/nova/nova.conf

 

四、删除多余的数据配置

connection= mysql+pymysql://nova:nova@192.168.56.11/nova
connection= mysql+pymysql://nova:nova@192.168.56.11/nova_api

 

五、修改vnc配置

[vnc]
enabled=true
server_listen = 0.0.0.0
server_proxyclient_address = 192.168.56.12
novncproxy_base_url = http://192.168.56.11:6080/vnc_auto.html

 

六、虚拟化适配

[root@linux-node2 ~]# egrep -c '(vmx|svm)' /proc/cpuinfo
2

 [root@linux-node2 ~]# vim /etc/nova/nova.conf

[libvirt]
virt_type=qemu
如果返回的是非0的值,那么表示计算节点服务器支持硬件虚拟化,需要在nova.conf里面设置
[libvirt]
virt_type=kvm
生产环境一点要设置virt_type=kvm

 

七、启动nova-compute

[root@linux-node2 ~]# systemctl enable libvirtd.service openstack-nova-compute.service
Created symlink from /etc/systemd/system/multi-user.target.wants/openstack-nova-compute.service to /usr/lib/systemd/system/openstack-nova-compute.service.
[root@linux-node2 ~]# systemctl start libvirtd.service openstack-nova-compute.service

 

八、设置控制节点和计算节点的时间一致

[root@linux-node1 ~]# yum  install  ntpdate -y
[root@linux-node1 ~]# ntpdate time1.aliyun.com
19 Sep 16:42:23 ntpdate[9176]: adjust time server 203.107.6.88 offset 0.018686 sec
[root@linux-node2 ~]# yum  install  ntpdate -y
[root@linux-node2 ~]# ntpdate time1.aliyun.com
19 Sep 16:42:23 ntpdate[9176]: adjust time server 203.107.6.88 offset 0.018686 sec

 

九、验证

控制节点执行
[root@linux-node1 ~]# source  admin-openstack.sh

[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 |
| linux-node2.example.com | compute | nova |
+-------------------------+-------------+----------+
[root@linux-node1 ~]#
[root@linux-node1 ~]# openstack compute service list
+----+------------------+-------------------------+----------+---------+-------+----------------------------+
| ID | Binary | Host | Zone | Status | State | Updated At |
+----+------------------+-------------------------+----------+---------+-------+----------------------------+
| 1 | nova-conductor | linux-node1.example.com | internal | enabled | up | 2018-09-19T08:59:22.000000 |
| 2 | nova-consoleauth | linux-node1.example.com | internal | enabled | up | 2018-09-19T08:59:22.000000 |
| 3 | nova-scheduler | linux-node1.example.com | internal | enabled | up | 2018-09-19T08:59:22.000000 |
| 6 | nova-compute | linux-node2.example.com | nova | enabled | up | 2018-09-19T08:59:13.000000 |
+----+------------------+-------------------------+----------+---------+-------+----------------------------+
[root@linux-node1 ~]#
[root@linux-node1 ~]# openstack catalog list
+-----------+-----------+--------------------------------------------+
| Name | Type | Endpoints |
+-----------+-----------+--------------------------------------------+
| keystone | identity | RegionOne |
| | | admin: http://192.168.56.11:35357/v3/ |
| | | RegionOne |
| | | public: http://192.168.56.11:5000/v3/ |
| | | RegionOne |
| | | internal: http://192.168.56.11:35357/v3/ |
| | | |
| placement | placement | RegionOne |
| | | public: http://192.168.56.11:8778 |
| | | RegionOne |
| | | admin: http://192.168.56.11:8778 |
| | | RegionOne |
| | | internal: http://192.168.56.11:8778 |
| | | |
| nova | compute | RegionOne |
| | | internal: http://192.168.56.11:8774/v2.1 |
| | | RegionOne |
| | | public: http://192.168.56.11:8774/v2.1 |
| | | RegionOne |
| | | admin: http://192.168.56.11:8774/v2.1 |
| | | |
| glance | image | RegionOne |
| | | public: http://192.168.56.11:9292 |
| | | RegionOne |
| | | admin: http://192.168.56.11:9292 |
| | | RegionOne |
| | | internal: http://192.168.56.11:9292 |
| | | |
+-----------+-----------+--------------------------------------------+
[root@linux-node1 ~]#

 

 十、计算节点加入控制节点

[root@linux-node1 ~]# su -s /bin/sh -c "nova-manage cell_v2 discover_hosts --verbose" nova
/usr/lib/python2.7/site-packages/oslo_db/sqlalchemy/enginefacade.py:332: NotSupportedWarning: Configuration option(s) ['use_tpool'] not supported
  exception.NotSupportedWarning
Found 2 cell mappings.
Skipping cell0 since it does not contain hosts.
Getting computes from cell 'cell1': 6cc05670-542c-4aca-a9c4-dc4219a19cf2
Checking host mapping for compute host 'linux-node2.example.com': 7a3cec97-0ddf-49eb-b96c-e8b280c73095
Creating host mapping for compute host 'linux-node2.example.com': 7a3cec97-0ddf-49eb-b96c-e8b280c73095
Found 1 unmapped computes in cell: 6cc05670-542c-4aca-a9c4-dc4219a19cf2

 

如果不想手动加的话,可以修改vim /etc/nova/nova.conf  并重启

discover_hosts_in_cells_interval=300 ##表示每5分钟检查一次

 

 

到此计算节点安装完成!!!!!

 

posted @ 2018-09-20 16:15  凉生墨客  阅读(183)  评论(0编辑  收藏