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

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

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

在控制节点上操作

查看计算节点

[[email protected] 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     |
+-----------------------+-------------+----------+

[[email protected] 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可用。
现在需要使它为不可用。

[[email protected] src]# nova service-disable linux-node2.openstack nova-compute
+-----------------------+--------------+----------+
| Host                  | Binary       | Status   |
+-----------------------+--------------+----------+
| linux-node2.openstack | nova-compute | disabled |
+-----------------------+--------------+----------+
[[email protected] 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库)

[[email protected] ~]# 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

[[email protected] 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     |
+-----------------------+-------------+----------+
[[email protected] 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 | -               |
+----+------------------+-----------------------+----------+---------+-------+----------------------------+-----------------+

  

 

时间: 2024-08-03 02:51:39

openstack中彻底删除计算节点的操作记录的相关文章

OpenStack IceHouse 部署 - 4 - 计算节点部署

Nova计算服务(计算节点) 参考 本页内容依照官方安装文档进行,具体参见Configure a compute node(nova service) 前置工作 数据库 由于我们在Nova(计算管理)部署配置中使用了mysql数据库,所以移除本地sqlite数据库 sudo rm /var/lib/nova/nova.sqlite 修改vmlinuz权限 For security reasons, the Linux kernel is not readable by normal users

openstack Juno系列之计算节点搭建

openstack Juno系列之计算节点搭建 nova-compute安装配置 -------------------- apt-get install nova-compute sysfsutils 编辑配置文件 vi /etc/nova/nova.conf [DEFAULT] verbose = True rpc_backend = rabbit rabbit_host = controller rabbit_password = RABBIT_PASS auth_strategy = k

CDH5.12.0 中扩容增加计算节点

CDH5.12.0 中扩容增加计算节点 标签(空格分隔): 大数据平台构建 一: 环境准备 二: 增加节点环境系统初始化 三: 增加节点关于CDH5.12.0环境配置 四: 在CM 上面节点增加 一:环境的概述与准备 概述: 很多时候,企业的大数据环境(CDH5.12.0),根据使用的时间越来越长,空间会有不足的情况,集群的计算 能力也因此下降, 此时需要对将大数据的 集群环境进行扩容 增加计算节点. 1.1 系统逻辑部署图 1.2 安装文件详细信息列表: CM: cloudera-manage

Openstack 网络服务 Neutron计算节点部署(十)

Neutron计算节点部署 安装组件,安装的服务器是192.168.137.12 1.安装软件包 yum install -y openstack-neutron-linuxbridge ebtables ipset 2.配置文件neutron.conf 因为neutron控制节点跟计算节点配置几乎一样,直接复制控制节点的文件到计算节点,将不同的部分进行修改. scp /etc/neutron/neutron.conf [email protected]:/etc/neutron 在neutro

redis cluster中添加删除重分配节点例子

redis cluster配置好,并运行一段时间后,我们想添加节点,或者删除节点,该怎么办呢. 一,redis cluster命令行     //集群(cluster)  CLUSTER INFO 打印集群的信息  CLUSTER NODES 列出集群当前已知的所有节点(node),以及这些节点的相关信息.     //节点(node)  CLUSTER MEET <ip> <port> 将 ip 和 port 所指定的节点添加到集群当中,让它成为集群的一份子.  CLUSTER

html5中JavaScript删除全部节点

如果div里有这么些内容: <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=GBK"> <title>iScroll demo: simple</title> <script type="text/javascript"> functi

openstack 部署笔记--neutron计算节点

控制节点 # vim /etc/neutron/neutron.conf [DEFAULT] # ... transport_url = rabbit://openstack:[email protected] auth_strategy = keystone [keystone_authtoken] # ... auth_uri = http://keystone.downtown8.cn:5000 auth_url = http://keystone.downtown8.cn:35357 m

有没有办法删除部分history的记录,例如删除几天的操作记录,或删除最后的几个操作记录?

history记录存放在: ~/.bash_history 在任何路径位置,直接输入命令:"vim ~/.bash_history",就可以像编辑普通文本文件一样删除不想保存的历史记录命令. 不过,在这个文件里,可能看不到当前输入的命令.需要执行"exit"命令退出当前用户,再重新登录该用户,才能在"~/.bash_history"文件里看到最新输入的历史记录. 同样的原理,删除后的命令,在当前用户状态下,执行"history"

Pytorch 多GPU训练-多计算节点并行-All you need

概述 本篇介绍多计算节点上的pytorch分布式训练.从环境配置到运行demo的所有步骤,step by step.没有理论原理,理论原理可以参考这里. 基础环境 多台linux计算节点,通过网络连接,不同主机之间可以相互ping通.网速越快越好,如果通信速度比较慢,就不用怎么考虑分布式训练. 所有linux计算节点都包含若干GPU,GPU数量可以不一致,但是所有GPU计算速度尽量一致,否则模型的同步时会等待大量时间(短板效应). 所有计算节点都拥有Pytorch运行环境,即都可以单独的运行训练