搜索

2.3. 启动、停止和重启所有 Ceph 服务

download PDF

Ceph 服务是具有相同类型的 Ceph 守护进程的逻辑组,它们配置为在同一 Red Hat Ceph Storage 集群中运行。Ceph 中的编配层允许用户以集中的方式管理这些服务,从而可以轻松地执行影响到同一逻辑服务的所有 Ceph 守护进程的操作。每个主机中运行的 Ceph 守护进程通过 Systemd 服务进行管理。您可以从要管理 Ceph 服务的主机启动、停止和重新启动所有 Ceph 服务。

重要

如果要在特定主机中启动、停止或重启特定的 Ceph 守护进程,您需要使用 SystemD 服务。要获取在特定主机中运行的 SystemD 服务列表,连接到主机,并运行以下命令:

示例

[root@host01 ~]# systemctl list-units “ceph*”

输出将为您提供可用于管理每个 Ceph 守护进程的服务名称的列表。

先决条件

  • 一个正在运行的 Red Hat Ceph Storage 集群。
  • 具有对节点的 root 访问权限。

流程

  1. 登录到 Cephadm shell:

    示例

    [root@host01 ~]# cephadm shell

  2. 运行 ceph orch ls 命令,以获取 Red Hat Ceph Storage 集群中配置的 Ceph 服务列表,并获取特定的服务 ID。

    示例

    [ceph: root@host01 /]# ceph orch ls
    NAME                       RUNNING  REFRESHED  AGE  PLACEMENT  IMAGE NAME                                                       IMAGE ID
    alertmanager                   1/1  4m ago     4M   count:1    registry.redhat.io/openshift4/ose-prometheus-alertmanager:v4.5   b7bae610cd46
    crash                          3/3  4m ago     4M   *          registry.redhat.io/rhceph-alpha/rhceph-6-rhel9:latest            c88a5d60f510
    grafana                        1/1  4m ago     4M   count:1    registry.redhat.io/rhceph-alpha/rhceph-6-dashboard-rhel9:latest  bd3d7748747b
    mgr                            2/2  4m ago     4M   count:2    registry.redhat.io/rhceph-alpha/rhceph-6-rhel9:latest            c88a5d60f510
    mon                            2/2  4m ago     10w  count:2    registry.redhat.io/rhceph-alpha/rhceph-6-rhel9:latest            c88a5d60f510
    nfs.foo                        0/1  -          -    count:1    <unknown>                                                        <unknown>
    node-exporter                  1/3  4m ago     4M   *          registry.redhat.io/openshift4/ose-prometheus-node-exporter:v4.5  mix
    osd.all-available-devices      5/5  4m ago     3M   *          registry.redhat.io/rhceph-alpha/rhceph-6-rhel9:latest            c88a5d60f510
    prometheus                     1/1  4m ago     4M   count:1    registry.redhat.io/openshift4/ose-prometheus:v4.6                bebb0ddef7f0
    rgw.test_realm.test_zone       2/2  4m ago     3M   count:2    registry.redhat.io/rhceph-alpha/rhceph-6-rhel9:latest            c88a5d60f510

  3. 要启动特定的服务,请运行以下命令:

    语法

    ceph orch start SERVICE_ID

    示例

    [ceph: root@host01 /]# ceph orch start node-exporter

  4. 要停止特定的服务,请运行以下命令:

    重要

    ceph orch stop SERVICE_ID 命令会导致 Red Hat Ceph Storage 集群无法访问,仅适用于 MON 和 MGR 服务。建议您使用 systemctl stop SERVICE_ID 命令来停止主机上的特定守护进程。

    语法

    ceph orch stop SERVICE_ID

    示例

    [ceph: root@host01 /]# ceph orch stop node-exporter

    ceph 或ch stop node-exporter 命令中,删除 node exporter 服务的所有守护进程。

  5. 要重启特定的服务,请运行以下命令:

    语法

    ceph orch restart SERVICE_ID

    示例

    [ceph: root@host01 /]# ceph orch restart node-exporter

Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.