OpenStack部署过程当中,误操作添加了localhost.localdomain节点,进入数据库删除节点信息
[root@ct ~]# openstack compute service list --service nova-compute
+----+--------------+-----------------------+------+----------+-------+----------------------------+
| ID | Binary | Host | Zone | Status | State | Updated At |
+----+--------------+-----------------------+------+----------+-------+----------------------------+
| 6 | nova-compute | localhost.localdomain | nova | disabled | down | 2020-12-21T07:55:56.000000 |
| 7 | nova-compute | c1 | nova | enabled | up | 2020-12-21T08:03:47.000000 |
| 8 | nova-compute | c2 | nova | enabled | up | 2020-12-21T08:03:45.000000 |
+----+--------------+-----------------------+------+----------+-------+----------------------------+
由于对工作有些洁癖,看不惯那些多余没用的东西,最后修改数据库将其删除,参考命令如下:
mysql -uroot -ppasswdmysql> use nova ;mysql> show tables;MariaDB [nova]> select hypervisor_hostname from compute_nodes;
+-----------------------+
| hypervisor_hostname |
+-----------------------+
| c1 |
| c2 |
| localhost.localdomain |
+-----------------------+
3 rows in set (0.000 sec)MariaDB [nova]> delete from compute_nodes where hypervisor_hostname='localhost.localdomain';
Query OK, 1 row affected (0.003 sec)//上面命令删除了compute_nodes表中关于localhost.localdomain的信息,在dashboard的“虚拟机管理器”已经看不到node65的信息了,但是系统中nova service-list还是能看到。mysql>delete from services where host='localhost.localdomain';//删除services表中关于node65的信息,这样nova service-list就看不到localhost.localdomain的信息了。mysql>flush privileges;mysql>quit;[root@ct nova]# openstack compute service list --service nova-compute
+----+--------------+------+------+---------+-------+----------------------------+
| ID | Binary | Host | Zone | Status | State | Updated At |
+----+--------------+------+------+---------+-------+----------------------------+
| 7 | nova-compute | c1 | nova | enabled | up | 2020-12-21T08:25:38.000000 |
| 8 | nova-compute | c2 | nova | enabled | up | 2020-12-21T08:25:36.000000 |
+----+--------------+------+------+---------+-------+----------------------------+