nova-compute通常運行在計算節點上,經過message Queue接收管理VM的生命週期html
nova-compute經過Libvirt管理KVM,經過XenAPI管理Xen等node
yum install -y centos-release-openstack-queens
[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] 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.confpython
[libvirt] virt_type=qemu 若是返回的是非0的值,那麼表示計算節點服務器支持硬件虛擬化,須要在nova.conf裏面設置 [libvirt] virt_type=kvm
生產環境一點要設置virt_type=kvm
[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.servicemysql
[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 ~]# linux
[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 並重啓sql
discover_hosts_in_cells_interval=300 ##表示每5分鐘檢查一次
到此計算節點安裝完成!!!!!vim