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

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

在控制节点上操作

查看计算节点

  1. [root@linux-node1 src]# openstack host list
  2. +-----------------------+-------------+----------+
  3. | Host Name | Service | Zone |
  4. +-----------------------+-------------+----------+
  5. | linux-node1.openstack | conductor | internal |
  6. | linux-node1.openstack | cert | internal |
  7. | linux-node1.openstack | consoleauth | internal |
  8. | linux-node1.openstack | scheduler | internal |
  9. | linux-node1.openstack | compute | nova |
  10. | linux-node2.openstack | compute | nova |
  11. +-----------------------+-------------+----------+
  12.  
  13. [root@linux-node1 src]# nova service-list
  14. +----+------------------+-----------------------+----------+---------+-------+----------------------------+-----------------+
  15. | Id | Binary | Host | Zone | Status | State | Updated_at | Disabled Reason |
  16. +----+------------------+-----------------------+----------+---------+-------+----------------------------+-----------------+
  17. | 1 | nova-conductor | linux-node1.openstack | internal | enabled | up | 2016-11-02T11:25:08.000000 | - |
  18. | 4 | nova-cert | linux-node1.openstack | internal | enabled | up | 2016-11-02T11:25:07.000000 | - |
  19. | 5 | nova-consoleauth | linux-node1.openstack | internal | enabled | up | 2016-11-02T11:25:07.000000 | - |
  20. | 6 | nova-scheduler | linux-node1.openstack | internal | enabled | up | 2016-11-02T11:25:07.000000 | - |
  21. | 7 | nova-compute | linux-node1.openstack | nova | enabled | up | 2016-11-02T11:24:59.000000 | - |
  22. | 8 | nova-compute | linux-node2.openstack | nova | enabled | down | 2016-10-31T05:55:24.000000 | - |
  23. +----+------------------+-----------------------+----------+---------+-------+----------------------------+-----------------+

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

  1. [root@linux-node1 src]# nova service-disable linux-node2.openstack nova-compute
  2. +-----------------------+--------------+----------+
  3. | Host | Binary | Status |
  4. +-----------------------+--------------+----------+
  5. | linux-node2.openstack | nova-compute | disabled |
  6. +-----------------------+--------------+----------+
  7. [root@linux-node1 src]# nova service-list
  8. +----+------------------+-----------------------+----------+----------+-------+----------------------------+-----------------+
  9. | Id | Binary | Host | Zone | Status | State | Updated_at | Disabled Reason |
  10. +----+------------------+-----------------------+----------+----------+-------+----------------------------+-----------------+
  11. | 1 | nova-conductor | linux-node1.openstack | internal | enabled | up | 2016-11-02T11:25:48.000000 | - |
  12. | 4 | nova-cert | linux-node1.openstack | internal | enabled | up | 2016-11-02T11:25:47.000000 | - |
  13. | 5 | nova-consoleauth | linux-node1.openstack | internal | enabled | up | 2016-11-02T11:25:47.000000 | - |
  14. | 6 | nova-scheduler | linux-node1.openstack | internal | enabled | up | 2016-11-02T11:25:47.000000 | - |
  15. | 7 | nova-compute | linux-node1.openstack | nova | enabled | up | 2016-11-02T11:25:49.000000 | - |
  16. | 8 | nova-compute | linux-node2.openstack | nova | disabled | down | 2016-11-02T11:25:48.000000 | - |
  17. +----+------------------+-----------------------+----------+----------+-------+----------------------------+-----------------+

在数据库里清理(nova库)

  1. [root@linux-node1 ~]# mysql -p
  2. Enter password:
  3. Welcome to the MariaDB monitor. Commands end with ; or \g.
  4. Your MariaDB connection id is 230863
  5. Server version: 5.5.50-MariaDB MariaDB Server
  6.  
  7. Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.
  8.  
  9. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
  10.  
  11. MariaDB [(none)]> use nova;
  12. Database changed
  13. MariaDB [nova]> delete from nova.services where host="linux-node2.openstack";
  14. Query OK, 1 row affected (0.00 sec)
  15. MariaDB [nova]> delete from compute_nodes where hypervisor_hostname="linux-node2.openstack";
  16. Query OK, 1 row affected (0.00 sec)
  17. MariaDB [nova]> select host from nova.services;
  18. +-----------------------+
  19. | host |
  20. +-----------------------+
  21. | linux-node1.openstack |
  22. | linux-node1.openstack |
  23. | linux-node1.openstack |
  24. | linux-node1.openstack |
  25. | linux-node1.openstack |
  26. +-----------------------+
  27. 5 rows in set (0.00 sec)
  28.  
  29. MariaDB [nova]> select hypervisor_hostname from compute_nodes;
  30. +-----------------------+
  31. | hypervisor_hostname |
  32. +-----------------------+
  33. | linux-node1.openstack |
  34. +-----------------------+
  35. 1 row in set (0.00 sec)

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

  1. [root@linux-node1 src]# openstack host list
  2. +-----------------------+-------------+----------+
  3. | Host Name | Service | Zone |
  4. +-----------------------+-------------+----------+
  5. | linux-node1.openstack | conductor | internal |
  6. | linux-node1.openstack | cert | internal |
  7. | linux-node1.openstack | consoleauth | internal |
  8. | linux-node1.openstack | scheduler | internal |
  9. | linux-node1.openstack | compute | nova |
  10. +-----------------------+-------------+----------+
  11. [root@linux-node1 src]# nova service-list
  12. +----+------------------+-----------------------+----------+---------+-------+----------------------------+-----------------+
  13. | Id | Binary | Host | Zone | Status | State | Updated_at | Disabled Reason |
  14. +----+------------------+-----------------------+----------+---------+-------+----------------------------+-----------------+
  15. | 1 | nova-conductor | linux-node1.openstack | internal | enabled | up | 2016-11-02T11:44:08.000000 | - |
  16. | 4 | nova-cert | linux-node1.openstack | internal | enabled | up | 2016-11-02T11:44:08.000000 | - |
  17. | 5 | nova-consoleauth | linux-node1.openstack | internal | enabled | up | 2016-11-02T11:44:07.000000 | - |
  18. | 6 | nova-scheduler | linux-node1.openstack | internal | enabled | up | 2016-11-02T11:44:07.000000 | - |
  19. | 7 | nova-compute | linux-node1.openstack | nova | enabled | up | 2016-11-02T11:44:09.000000 | - |
  20. +----+------------------+-----------------------+----------+---------+-------+----------------------------+-----------------+

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

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

    Nova计算服务(计算节点)  参考 本页内容依照官方安装文档进行,具体参见Configure a compute node(nova service) 前置工作 数据库 由于我们在Nova(计算管理 ...

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

    redis cluster配置好,并运行一段时间后,我们想添加节点,或者删除节点,该怎么办呢. 一,redis cluster命令行     //集群(cluster)  CLUSTER INFO 打 ...

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

    Neutron计算节点部署 安装组件,安装的服务器是192.168.137.12 1.安装软件包 yum install -y openstack-neutron-linuxbridge ebtabl ...

  4. 5.openstack之mitaka搭建计算节点

    部署计算节点(compute服务) 一:控制节点配置 1.建库建用户 CREATE DATABASE nova_api; CREATE DATABASE nova; GRANT ALL PRIVILE ...

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

    一) Neutron计算节点部署 1.安装软件包 # yum install -y openstack-neutron-linuxbridge ebtables ipset 2.配置文件neutron ...

  6. html5中JavaScript删除全部节点

    如果div里有这么些内容: <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type ...

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

    控制节点 # vim /etc/neutron/neutron.conf [DEFAULT] # ... transport_url = rabbit://openstack:root@control ...

  8. 【openstack N版】——计算服务nova

    一.openstack计算服务nova 1.1nova介绍 Nova是openstack最早的两块模块之一,另一个是对象存储swift.在openstack体系中一个叫做计算节点,一个叫做控制节点.这 ...

  9. Openstack的计算节点的nova-network异常中止及实例无法删除排错过程

    在预生产环境(172.17.46.2)发现无法删除实例,可以对实例做暂停,恢复操作. 查询原因发现计算节点的nova-network异常 [root@node-12 ~]# /etc/init.d/o ...

随机推荐

  1. JS之跨域

    今天学了跨域,迫不及待想跟大家分享!不妥之处希望大家指正. 首先来明确一下"跨域"这个概念. 跨域指的是,到外域去取数据.那什么是"外域"呢?我们先来了解同域. ...

  2. Android 5中不同效果的Toast

    一.运行的结果 二.主要的代码 package com.otn.android.toast; import java.util.Timer; import java.util.TimerTask; i ...

  3. <极客学院>视频教程学习笔记-iOS中CALayer的使用

    <1>CALayer简介 1.CALayer一般作为UIView的容器而使用. 2.CALayer是一个管理者图片载体(image-based content)的层结构 3.直接修改单独创 ...

  4. iOS证书失效

    iOS证书突然失效 今早上班打包直接报错,错误如图 根据错误信息到“钥匙串”里面看了一下证书,证书都莫名其妙的失效了,昨天还是好好的. 重新去钥匙串从证颁发中心获取证书,然后登陆开发者账号重新申请证书 ...

  5. 故障时自动重启Apache

    最近不知道为什么博客总是莫名其妙地挂掉, 重启Apache就好了,我也懒得去研究到底是哪里出了问题. 只是每次都需要手工SSH上去重启Apache,有点麻烦. 而且有时候在夜里挂掉,一晚上博客就都不能 ...

  6. 开源项目go2o - golang版的o2o项目

    发一个github上唯一用golang实现的o2o项目 What's Go2o Golang combine simple o2o DDD domain-driven design realizati ...

  7. Effective Java 51 Beware the performance of string concatenation

    Using the string concatenation operator repeatedly to concatenate n strings requires time quadratic ...

  8. JavaScript日期组件的实现

    旅游频道的开发中需要定义各种日期组件,有的是基本的日期选择, 这个基本日期只包含如下功能 左右翻(月) 点击天回填到输入域 点击“今天”,回填今天的日期到输入域 点击“关闭”,日期控件关闭 有的同时显 ...

  9. C语言关键字详解

    相对于其他语言来说,C语言的关键字算是少的了.在C98中关键子总共只有32个,我们来分析一下每个关键字在C语言中它独特的作用. 1.关于数据类型的关键字 (1) char :声明字符型变量或函数  ( ...

  10. Windows系统镜像自动添加驱动程序

    2016年到了一家公司做网管,经常会为了装系统而烦恼,后来学习了WDS自动部署,但是在学习过程中发现启动镜像boot.wim中没有网卡驱动 导致wds报错,后来经过网上查找相关资料学会了如何向系统里添 ...