博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
openstack中彻底删除计算节点的操作记录
阅读量:7117 次
发布时间:2019-06-28

本文共 6609 字,大约阅读时间需要 22 分钟。

 

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

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

在控制节点上操作

查看计算节点

[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可用。

现在需要使它为不可用。

[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库)

[root@linux-node1 ~]# mysql -pEnter password: Welcome to the MariaDB monitor.  Commands end with ; or \g.Your MariaDB connection id is 230863Server version: 5.5.50-MariaDB MariaDB ServerCopyright (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 changedMariaDB [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

[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 | -               |+----+------------------+-----------------------+----------+---------+-------+----------------------------+-----------------+

转载地址:http://kbfel.baihongyu.com/

你可能感兴趣的文章
js显示强制类型转换
查看>>
java加解密实例
查看>>
我是如何利用 workflow + 印象笔记搜集文章素材的
查看>>
JS之理解原型和原型链
查看>>
微信小程序封装request方法
查看>>
前端文章- 收藏集 - 掘金
查看>>
Jenkins+github 前端自动化部署
查看>>
快速掌握git基本使用
查看>>
Node.js 学习之路
查看>>
angular 基于ng-messages的验证
查看>>
三、取get
查看>>
利用PHP实现常用的数据结构之写在前面(小白系列文章一)
查看>>
Zttp - 一个基于 Guzzle Http 的更好用的 PHP HTTP Package
查看>>
使用asprise进行图片验证码识别
查看>>
HTML基本语法和语义
查看>>
解析nodeJS模块源码 亲手打造基于ES6的观察者系统
查看>>
77% 的网站使用了至少有 1 个漏洞的 JavaScript 库
查看>>
ES5新增 数组操作forEach()、map()、filter()、some()、every()
查看>>
一个可以提高开发效率的Git命令-- Cherry-Pick
查看>>
IBM发表论文:可能已找到处理量子计算退相干的方法
查看>>