首页 > 代码库 > 使用命令cinder-manage service remove删除不用的cinder service服务

使用命令cinder-manage service remove删除不用的cinder service服务

使用cinder service-list可以查到cinder的服务状态和信息,有时会有一些不用的状态是down,以前是通过修改数据库删除这些down掉的服务。

社区中增加了命令:cinder-manage service remove <binary> <host>可以删除那些down掉的服务。

示例:

 

# cinder service-list
+------------------+-------------------+------+---------+-------+----------------------------+-----------------+
|      Binary      |        Host       | Zone |  Status | State |         Updated_at         | Disabled Reason |
+------------------+-------------------+------+---------+-------+----------------------------+-----------------+
| cinder-scheduler |      2c510cg      | nova | enabled |  down | 2017-05-18T05:48:49.000000 |        -        |
| cinder-scheduler |       cinder      | nova | enabled |   up  | 2017-05-18T08:20:13.000000 |        -        |
|  cinder-volume   | 2c510cg@ZTE_FCSAN | nova | enabled |  down | 2017-05-12T07:39:40.000000 |        -        |
|  cinder-volume   |    2c510cg@lvm    | nova | enabled |  down | 2017-05-08T00:57:57.000000 |        -        |

|  cinder-volume   |  cinder@ZTE_FCSAN | nova | enabled |  down | 2017-05-18T05:48:42.000000 |        -        |
|  cinder-volume   |     cinder@lvm    | nova | enabled |   up  | 2017-05-18T08:20:06.000000 |        -        |
+------------------+-------------------+------+---------+-------+----------------------------+-----------------+

# cinder-manage service remove cinder-volume 2c510cg@ZTE_FCSAN
# cinder-manage service remove cinder-volume  2c510cg@lvm


# cinder service-list
+------------------+------------------+------+---------+-------+----------------------------+-----------------+
|      Binary      |       Host       | Zone |  Status | State |         Updated_at         | Disabled Reason |
+------------------+------------------+------+---------+-------+----------------------------+-----------------+
| cinder-scheduler |     2c510cg      | nova | enabled |  down | 2017-05-18T05:48:49.000000 |        -        |
| cinder-scheduler |      cinder      | nova | enabled |   up  | 2017-05-18T08:20:53.000000 |        -        |
|  cinder-volume   | cinder@ZTE_FCSAN | nova | enabled |  down | 2017-05-18T05:48:42.000000 |        -        |
|  cinder-volume   |    cinder@lvm    | nova | enabled |   up  | 2017-05-18T08:20:56.000000 |        -        |
+------------------+------------------+------+---------+-------+----------------------------+-----------------+

使用命令cinder-manage service remove删除不用的cinder service服务