技术流ken

运维拯救世界

openstack集群移除计算节点操作–技术流ken

删除计算节点

下面我们来演示如何删除openstack集群中的ken3这个计算节点

第一步:查看当前有哪些节点

[root@controller ~]# openstack hypervisor list
+----+---------------------+-----------------+---------------+-------+
| ID | Hypervisor Hostname | Hypervisor Type | Host IP       | State |
+----+---------------------+-----------------+---------------+-------+
|  1 | ken2                | QEMU            | 192.168.64.9  | up    |
|  2 | ken3                | QEMU            | 192.168.64.21 | up    |
+----+---------------------+-----------------+---------------+-------+

 

第二步:查看计算服务

[root@controller ~]# nova service-list
+----+------------------+------------+----------+---------+-------+----------------------------+-----------------+
| Id | Binary           | Host       | Zone     | Status  | State | Updated_at                 | Disabled Reason |
+----+------------------+------------+----------+---------+-------+----------------------------+-----------------+
| 1  | nova-conductor   | controller | internal | enabled | up    | 2019-08-29T06:40:02.000000 | -               |
| 2  | nova-consoleauth | controller | internal | enabled | up    | 2019-08-29T06:40:03.000000 | -               |
| 3  | nova-scheduler   | controller | internal | enabled | up    | 2019-08-29T06:40:03.000000 | -               |
| 10 | nova-compute     | ken2       | nova     | enabled | up    | 2019-08-29T06:40:06.000000 | -               |
| 11 | nova-compute     | ken3       | nova     | enabled | up    | 2019-08-29T06:40:02.000000 | -               |
+----+------------------+------------+----------+---------+-------+----------------------------+-----------------+

 

第三步:上一步显示ken3节点依然处于可用并且运行的状态,设置为不启动

[root@controller ~]# nova service-disable ken3 nova-compute 
+------+--------------+----------+
| Host | Binary       | Status   |
+------+--------------+----------+
| ken3 | nova-compute | disabled |
+------+--------------+----------+

 

第四步:删除数据库相关内容

MariaDB [nova]> delete from nova.services where host="ken3";
Query OK, 1 row affected (0.00 sec)

MariaDB [nova]>  delete from compute_nodes where hypervisor_hostname="ken3";
Query OK, 1 row affected (0.00 sec)

MariaDB [nova]>  select host from nova.services;
+------------+
| host       |
+------------+
| 0.0.0.0    |
| 0.0.0.0    |
| controller |
| controller |
| controller |
| ken2       |
+------------+

 

第五步:再次查看节点

[root@controller ~]# openstack hypervisor list
+----+---------------------+-----------------+--------------+-------+
| ID | Hypervisor Hostname | Hypervisor Type | Host IP      | State |
+----+---------------------+-----------------+--------------+-------+
|  1 | ken2                | QEMU            | 192.168.64.9 | up    |
+----+---------------------+-----------------+--------------+-------+

第六步:再次查看nova服务

[root@controller ~]# nova service-list
+----+------------------+------------+----------+---------+-------+----------------------------+-----------------+
| Id | Binary           | Host       | Zone     | Status  | State | Updated_at                 | Disabled Reason |
+----+------------------+------------+----------+---------+-------+----------------------------+-----------------+
| 1  | nova-conductor   | controller | internal | enabled | up    | 2019-08-29T06:45:02.000000 | -               |
| 2  | nova-consoleauth | controller | internal | enabled | up    | 2019-08-29T06:45:04.000000 | -               |
| 3  | nova-scheduler   | controller | internal | enabled | up    | 2019-08-29T06:45:03.000000 | -               |
| 10 | nova-compute     | ken2       | nova     | enabled | up    | 2019-08-29T06:44:56.000000 | -               |
+----+------------------+------------+----------+---------+-------+----------------------------+-----------------+

 

发现ken3这个计算节点已经被删除了。

 

 

 

发表评论

邮箱地址不会被公开。