设为首页 收藏本站
查看: 985|回复: 0

[经验分享] openstack 删除compuet node

[复制链接]

尚未签到

发表于 2018-6-2 09:01:44 | 显示全部楼层 |阅读模式
  查看openstack集群的服务列表
  [root@os-node1 ~]# nova service-list
  +------------------+----------+----------+---------+-------+----------------------------+-----------------+
  | Binary           | Host     | Zone     | Status  | State | Updated_at                 | Disabled Reason |
  +------------------+----------+----------+---------+-------+----------------------------+-----------------+
  | nova-cert        | os-node1 | internal | enabled | up    | 2014-08-03T15:35:02.000000 | -               |
  | nova-consoleauth | os-node1 | internal | enabled | up    | 2014-08-03T15:35:05.000000 | -               |
  | nova-conductor   | os-node1 | internal | enabled | up    | 2014-08-03T15:35:02.000000 | -               |
  | nova-scheduler   | os-node1 | internal | enabled | up    | 2014-08-03T15:35:07.000000 | -               |
  | nova-compute     | os-node3 | nova     | enabled | down  | 2014-08-02T17:18:04.000000 | -               |
  | nova-compute     | os-node4 | nova     | enabled | down  | 2014-08-02T17:18:16.000000 | -               |
  | nova-cells       | os-node1 | internal | enabled | up    | 2014-08-03T15:35:00.000000 | -               |
  | nova-console     | os-node1 | internal | enabled | up    | 2014-08-03T15:35:02.000000 | -               |
  | nova-compute     | os-node5 | nova     | enabled | up    | 2014-08-03T15:35:09.000000 | -               |
  | nova-compute     | os-node6 | nova     | enabled | up    | 2014-08-03T15:35:00.000000 | -               |
  +------------------+----------+----------+---------+-------+----------------------------+-----------------+
  查看发现os-node3 down了 如果确认此计算节点可以删除需要在控制器的数据库中进行下面操作
  

  查看compute_nodes数据库表发现os-node3的id为1,service_id为5.
  mysql> select * from compute_nodes;
  +---------------------+---------------------+------------+----+------------+-------+-----------+----------+------------+----------------+---------------+-----------------+--------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------+-------------+--------------+------------------+-------------+---------------------+---------+-------------+--------------------------------------------------------------------------------------------------------+-----------+
  | created_at          | updated_at          | deleted_at | id | service_id | vcpus | memory_mb | local_gb | vcpus_used | memory_mb_used | local_gb_used | hypervisor_type | hypervisor_version | cpu_info                                                                                                                                                                                                                                                                                        | disk_available_least | free_ram_mb | free_disk_gb | current_workload | running_vms | hypervisor_hostname | deleted | host_ip     | supported_instances                                                                                    | pci_stats |
  +---------------------+---------------------+------------+----+------------+-------+-----------+----------+------------+----------------+---------------+-----------------+--------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------+-------------+--------------+------------------+-------------+---------------------+---------+-------------+--------------------------------------------------------------------------------------------------------+-----------+
  | 2014-07-29 19:34:06 | 2014-08-02 17:18:06 | NULL       |  1 |          5 |    24 |    129217 |       95 |          0 |            512 |             0 | QEMU            |              12001 | {"vendor": "Intel", "model": "SandyBridge", "arch": "x86_64", "features": ["pdpe1gb", "osxsave", "dca", "pcid", "pdcm", "xtpr", "tm2", "est", "smx", "vmx", "ds_cpl", "monitor", "dtes64", "pbe", "tm", "ht", "ss", "acpi", "ds", "vme"], "topology": {"cores": 6, "threads": 2, "sockets": 1}} |                   23 |      128705 |           95 |                0 |           0 | os-node3            |       0 | 10.40.10.66 | [["i686", "qemu", "hvm"], ["i686", "kvm", "hvm"], ["x86_64", "qemu", "hvm"], ["x86_64", "kvm", "hvm"]] | []        |
  | 2014-07-29 19:34:37 | 2014-08-02 17:17:38 | NULL       |  2 |          6 |    24 |    129015 |      672 |         56 |          80512 |          1700 | QEMU            |              12001 | {"vendor": "Intel", "model": "SandyBridge", "arch": "x86_64", "features": ["pdpe1gb", "osxsave", "dca", "pcid", "pdcm", "xtpr", "tm2", "est", "smx", "vmx", "ds_cpl", "monitor", "dtes64", "pbe", "tm", "ht", "ss", "acpi", "ds", "vme"], "topology": {"cores": 6, "threads": 2, "sockets": 1}} |                 -527 |       48503 |        -1028 |                0 |           9 | os-node4            |       0 | 10.40.10.67 | [["i686", "qemu", "hvm"], ["i686", "kvm", "hvm"], ["x86_64", "qemu", "hvm"], ["x86_64", "kvm", "hvm"]] | []        |
  | 2014-08-01 06:22:07 | 2014-08-03 15:23:53 | NULL       |  3 |          9 |    24 |     64575 |      487 |         20 |          32512 |           600 | QEMU            |              12001 | {"vendor": "Intel", "model": "SandyBridge", "arch": "x86_64", "features": ["pdpe1gb", "osxsave", "dca", "pcid", "pdcm", "xtpr", "tm2", "est", "smx", "vmx", "ds_cpl", "monitor", "dtes64", "pbe", "tm", "ht", "ss", "acpi", "ds", "vme"], "topology": {"cores": 6, "threads": 2, "sockets": 1}} |                  460 |       32063 |         -113 |                0 |           4 | os-node5            |       0 | 10.40.10.68 | [["i686", "qemu", "hvm"], ["i686", "kvm", "hvm"], ["x86_64", "qemu", "hvm"], ["x86_64", "kvm", "hvm"]] | []        |
  | 2014-08-01 06:22:12 | 2014-08-03 15:24:39 | NULL       |  4 |         10 |    24 |     64573 |      487 |         20 |          32512 |           600 | QEMU            |              12001 | {"vendor": "Intel", "model": "SandyBridge", "arch": "x86_64", "features": ["pdpe1gb", "osxsave", "dca", "pcid", "pdcm", "xtpr", "tm2", "est", "smx", "vmx", "ds_cpl", "monitor", "dtes64", "pbe", "tm", "ht", "ss", "acpi", "ds", "vme"], "topology": {"cores": 6, "threads": 2, "sockets": 1}} |                  458 |       32061 |         -113 |                0 |           4 | os-node6            |       0 | 10.40.10.69 | [["i686", "qemu", "hvm"], ["i686", "kvm", "hvm"], ["x86_64", "qemu", "hvm"], ["x86_64", "kvm", "hvm"]] | []        |
  +---------------------+---------------------+------------+----+------------+-------+-----------+----------+------------+----------------+---------------+-----------------+--------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------+-------------+--------------+------------------+-------------+---------------------+---------+-------------+--------------------------------------------------------------------------------------------------------+-----------+
  4 rows in set (0.00 sec)
  

  查看services数据库表发现os-node3的service_id为5
  mysql> select * from services;
  +---------------------+---------------------+------------+----+----------+------------------+-------------+--------------+----------+---------+-----------------+
  | created_at          | updated_at          | deleted_at | id | host     | binary           | topic       | report_count | disabled | deleted | disabled_reason |
  +---------------------+---------------------+------------+----+----------+------------------+-------------+--------------+----------+---------+-----------------+
  | 2014-07-29 18:33:46 | 2014-08-03 15:27:31 | NULL       |  1 | os-node1 | nova-cert        | cert        |        42058 |        0 |       0 | NULL            |
  | 2014-07-29 18:33:46 | 2014-08-03 15:27:35 | NULL       |  2 | os-node1 | nova-consoleauth | consoleauth |        42062 |        0 |       0 | NULL            |
  | 2014-07-29 18:33:46 | 2014-08-03 15:27:32 | NULL       |  3 | os-node1 | nova-conductor   | conductor   |        42059 |        0 |       0 | NULL            |
  | 2014-07-29 18:33:46 | 2014-08-03 15:27:27 | NULL       |  4 | os-node1 | nova-scheduler   | scheduler   |        42058 |        0 |       0 | NULL            |
  | 2014-07-29 19:34:05 | 2014-08-02 17:18:04 | NULL       |  5 | os-node3 | nova-compute     | compute     |        30542 |        0 |       0 | NULL            |
  | 2014-07-29 19:34:35 | 2014-08-02 17:18:16 | NULL       |  6 | os-node4 | nova-compute     | compute     |        32622 |        0 |       0 | NULL            |
  | 2014-07-29 22:33:10 | 2014-08-03 15:27:30 | NULL       |  7 | os-node1 | nova-cells       | cells       |        40640 |        0 |       0 | NULL            |
  | 2014-07-29 22:33:13 | 2014-08-03 15:27:32 | NULL       |  8 | os-node1 | nova-console     | console     |        40640 |        0 |       0 | NULL            |
  | 2014-08-01 06:22:06 | 2014-08-03 15:27:29 | NULL       |  9 | os-node5 | nova-compute     | compute     |        20510 |        0 |       0 | NULL            |
  | 2014-08-01 06:22:11 | 2014-08-03 15:27:30 | NULL       | 10 | os-node6 | nova-compute     | compute     |        20511 |        0 |       0 | NULL            |
  +---------------------+---------------------+------------+----+----------+------------------+-------------+--------------+----------+---------+-----------------+
  10 rows in set (0.00 sec)
  

  如果确定删除,根据上面的查看信息进行下面的3步操作
  

  mysql> delete from compute_node_stats where compute_node_id=1;
  Query OK, 336 rows affected (0.04 sec)
  

  mysql> delete from compute_nodes where service_id=5;
  Query OK, 1 row affected (0.02 sec)
  

  mysql> delete from services where id=5;
  Query OK, 1 row affected (0.02 sec)
  

  退出数据库后再次查看nova 的service-list,发现os-node3已被删除。
  [root@os-node1 ~]# nova service-list
  +------------------+----------+----------+---------+-------+----------------------------+-----------------+
  | Binary           | Host     | Zone     | Status  | State | Updated_at                 | Disabled Reason |
  +------------------+----------+----------+---------+-------+----------------------------+-----------------+
  | nova-cert        | os-node1 | internal | enabled | up    | 2014-08-03T15:37:02.000000 | -               |
  | nova-consoleauth | os-node1 | internal | enabled | up    | 2014-08-03T15:37:05.000000 | -               |
  | nova-conductor   | os-node1 | internal | enabled | up    | 2014-08-03T15:37:02.000000 | -               |
  | nova-scheduler   | os-node1 | internal | enabled | up    | 2014-08-03T15:36:57.000000 | -               |
  | nova-compute     | os-node4 | nova     | enabled | down  | 2014-08-02T17:18:16.000000 | -               |
  | nova-cells       | os-node1 | internal | enabled | up    | 2014-08-03T15:37:00.000000 | -               |
  | nova-console     | os-node1 | internal | enabled | up    | 2014-08-03T15:37:02.000000 | -               |
  | nova-compute     | os-node5 | nova     | enabled | up    | 2014-08-03T15:36:59.000000 | -               |
  | nova-compute     | os-node6 | nova     | enabled | up    | 2014-08-03T15:37:00.000000 | -               |
  +------------------+----------+----------+---------+-------+----------------------------+-----------------+
  

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-506004-1-1.html 上篇帖子: OPENSTACK ICEHOUSE 迁移虚拟机 下篇帖子: openstack僵尸虚拟机处理办法
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表