前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >openstack中彻底删除计算节点的操作记录

openstack中彻底删除计算节点的操作记录

作者头像
洗尽了浮华
发布2018-01-23 10:23:43
1.9K0
发布2018-01-23 10:23:43
举报
文章被收录于专栏:散尽浮华

在使用openstack的过程中,我们经常会添加好几台计算节点来部署虚拟机,在后续使用中由于某些原因,一些计算节点出现了问题,需要将这些出了问题的计算节点从openstack的控制节点中踢出去!但是很多时候,在删除计算节点的时候由于删除不彻底而导致了后面使用openstack出现了诸多问题。

下面记录了在openstack中彻底删除计算节点linux-node2.openstack的操作:

在控制节点上操作

查看计算节点

代码语言:javascript
复制
[root@linux-node1 src]# openstack host list
+-----------------------+-------------+----------+
| Host Name             | Service     | Zone     |
+-----------------------+-------------+----------+
| linux-node1.openstack | conductor   | internal |
| linux-node1.openstack | cert        | internal |
| linux-node1.openstack | consoleauth | internal |
| linux-node1.openstack | scheduler   | internal |
| linux-node1.openstack | compute     | nova     |
| linux-node2.openstack | compute     | nova     |
+-----------------------+-------------+----------+

[root@linux-node1 src]# nova service-list  
+----+------------------+-----------------------+----------+---------+-------+----------------------------+-----------------+
| Id | Binary           | Host                  | Zone     | Status  | State | Updated_at                 | Disabled Reason |
+----+------------------+-----------------------+----------+---------+-------+----------------------------+-----------------+
| 1  | nova-conductor   | linux-node1.openstack | internal | enabled | up    | 2016-11-02T11:25:08.000000 | -               |
| 4  | nova-cert        | linux-node1.openstack | internal | enabled | up    | 2016-11-02T11:25:07.000000 | -               |
| 5  | nova-consoleauth | linux-node1.openstack | internal | enabled | up    | 2016-11-02T11:25:07.000000 | -               |
| 6  | nova-scheduler   | linux-node1.openstack | internal | enabled | up    | 2016-11-02T11:25:07.000000 | -               |
| 7  | nova-compute     | linux-node1.openstack | nova     | enabled | up    | 2016-11-02T11:24:59.000000 | -               |
| 8  | nova-compute     | linux-node2.openstack | nova     | enabled | down  | 2016-10-31T05:55:24.000000 | -               |
+----+------------------+-----------------------+----------+---------+-------+----------------------------+-----------------+

虽然上面显示的一个计算节点linux-node2.openstack 的State状态是down,但是Status状态还是enabled可用。 现在需要使它为不可用。

代码语言:javascript
复制
[root@linux-node1 src]# nova service-disable linux-node2.openstack nova-compute  
+-----------------------+--------------+----------+
| Host                  | Binary       | Status   |
+-----------------------+--------------+----------+
| linux-node2.openstack | nova-compute | disabled |
+-----------------------+--------------+----------+
[root@linux-node1 src]# nova service-list  
+----+------------------+-----------------------+----------+----------+-------+----------------------------+-----------------+
| Id | Binary           | Host                  | Zone     | Status   | State | Updated_at                 | Disabled Reason |
+----+------------------+-----------------------+----------+----------+-------+----------------------------+-----------------+
| 1  | nova-conductor   | linux-node1.openstack | internal | enabled  | up    | 2016-11-02T11:25:48.000000 | -               |
| 4  | nova-cert        | linux-node1.openstack | internal | enabled  | up    | 2016-11-02T11:25:47.000000 | -               |
| 5  | nova-consoleauth | linux-node1.openstack | internal | enabled  | up    | 2016-11-02T11:25:47.000000 | -               |
| 6  | nova-scheduler   | linux-node1.openstack | internal | enabled  | up    | 2016-11-02T11:25:47.000000 | -               |
| 7  | nova-compute     | linux-node1.openstack | nova     | enabled  | up    | 2016-11-02T11:25:49.000000 | -               |
| 8  | nova-compute     | linux-node2.openstack | nova     | disabled | down  | 2016-11-02T11:25:48.000000 | -               |
+----+------------------+-----------------------+----------+----------+-------+----------------------------+-----------------+

在数据库里清理(nova库)

代码语言:javascript
复制
[root@linux-node1 ~]# mysql -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 230863
Server version: 5.5.50-MariaDB MariaDB Server

Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> use nova;
Database changed
MariaDB [nova]> delete from nova.services where host="linux-node2.openstack"; 
Query OK, 1 row affected (0.00 sec)
MariaDB [nova]> delete from compute_nodes where hypervisor_hostname="linux-node2.openstack";
Query OK, 1 row affected (0.00 sec)
MariaDB [nova]> select host from nova.services;
+-----------------------+
| host                  |
+-----------------------+
| linux-node1.openstack |
| linux-node1.openstack |
| linux-node1.openstack |
| linux-node1.openstack |
| linux-node1.openstack |
+-----------------------+
5 rows in set (0.00 sec)

MariaDB [nova]> select hypervisor_hostname from compute_nodes;
+-----------------------+
| hypervisor_hostname   |
+-----------------------+
| linux-node1.openstack |
+-----------------------+
1 row in set (0.00 sec)

再次查看计算节点,就发现已经删除了linux-node2.openstack

代码语言:javascript
复制
[root@linux-node1 src]# openstack host list
+-----------------------+-------------+----------+
| Host Name             | Service     | Zone     |
+-----------------------+-------------+----------+
| linux-node1.openstack | conductor   | internal |
| linux-node1.openstack | cert        | internal |
| linux-node1.openstack | consoleauth | internal |
| linux-node1.openstack | scheduler   | internal |
| linux-node1.openstack | compute     | nova     |
+-----------------------+-------------+----------+
[root@linux-node1 src]# nova service-list
+----+------------------+-----------------------+----------+---------+-------+----------------------------+-----------------+
| Id | Binary           | Host                  | Zone     | Status  | State | Updated_at                 | Disabled Reason |
+----+------------------+-----------------------+----------+---------+-------+----------------------------+-----------------+
| 1  | nova-conductor   | linux-node1.openstack | internal | enabled | up    | 2016-11-02T11:44:08.000000 | -               |
| 4  | nova-cert        | linux-node1.openstack | internal | enabled | up    | 2016-11-02T11:44:08.000000 | -               |
| 5  | nova-consoleauth | linux-node1.openstack | internal | enabled | up    | 2016-11-02T11:44:07.000000 | -               |
| 6  | nova-scheduler   | linux-node1.openstack | internal | enabled | up    | 2016-11-02T11:44:07.000000 | -               |
| 7  | nova-compute     | linux-node1.openstack | nova     | enabled | up    | 2016-11-02T11:44:09.000000 | -               |
+----+------------------+-----------------------+----------+---------+-------+----------------------------+-----------------+
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2016-11-02 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
相关产品与服务
云数据库 MariaDB
腾讯云数据库 MariaDB(TencentDB for MariaDB) 让您轻松在云端部署、使用 MariaDB 数据库。MariaDB 是在 MySQL 版权被 Oracle 收购后,由 MySQL 创始人 Monty 创立,其版权授予了“MariaDB基金会(非营利性组织)”以保证 MariaDB 永远开源,良好的开源策略,是企业级应用的最优选择,主流开源社区系统/软件的数据库系统,均已默认配置 MariaDB。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档