注意

本文档适用于 Ceph 开发版本。

操作集群

使用 systemd 运行 Ceph

在所有支持 systemd 的发行版(CentOS 7、Fedora、Debian Jessie 8 及更高版本和 SUSE)中,使用 systemd 文件(而不是遗留的 SysVinit 脚本)来管理 Ceph 守护进程。因此,Ceph 守护进程表现得就像任何其他可以通过 `systemctl` 命令控制的守护进程一样,如下面的示例所示:systemctl command, as in the following examples:

sudo systemctl start ceph.target       # start all daemons
sudo systemctl status ceph-osd@12      # check status of osd.12

要列出节点上的所有 Ceph systemd 单元,运行以下命令:

sudo systemctl status ceph\*.service ceph\*.target

启动所有守护进程

要启动 Ceph 节点上的所有守护进程(无论其类型如何),运行以下命令:

sudo systemctl start ceph.target

停止所有守护进程

要停止 Ceph 节点上的所有守护进程(无论其类型如何),运行以下命令:

sudo systemctl stop ceph\*.service ceph\*.target

按类型启动所有守护进程

要启动 Ceph 节点上的特定类型的所有守护进程,运行以下命令之一:

sudo systemctl start ceph-osd.target
sudo systemctl start ceph-mon.target
sudo systemctl start ceph-mds.target

按类型停止所有守护进程

要停止 Ceph 节点上的特定类型的所有守护进程,运行以下命令之一:

sudo systemctl stop ceph-osd\*.service ceph-osd.target
sudo systemctl stop ceph-mon\*.service ceph-mon.target
sudo systemctl stop ceph-mds\*.service ceph-mds.target

启动守护进程

要启动 Ceph 节点上的特定守护进程实例,运行以下命令之一:

sudo systemctl start ceph-osd@{id}
sudo systemctl start ceph-mon@{hostname}
sudo systemctl start ceph-mds@{hostname}

例如:

sudo systemctl start ceph-osd@1
sudo systemctl start ceph-mon@ceph-server
sudo systemctl start ceph-mds@ceph-server

停止守护进程

要停止 Ceph 节点上的特定守护进程实例,运行以下命令之一:

sudo systemctl stop ceph-osd@{id}
sudo systemctl stop ceph-mon@{hostname}
sudo systemctl stop ceph-mds@{hostname}

例如:

sudo systemctl stop ceph-osd@1
sudo systemctl stop ceph-mon@ceph-server
sudo systemctl stop ceph-mds@ceph-server

使用 SysVinit 运行 Ceph

每次启动、重启或停止 Ceph 守护进程时,你必须指定至少一个选项和一个命令。同样,每次启动、重启或停止整个集群时,你必须指定至少一个选项和一个命令。在这两种情况下,你也可以指定守护进程类型或守护进程实例。

{commandline} [options] [commands] [daemons]

The ceph选项包括:

Option

简短形式

描述

--verbose

-v

使用详细日志记录。

--valgrind

N/A

(仅限开发和测试人员)使用调试。Valgrind调试。

--allhosts

-a

在列出的所有节点上执行ceph.conflocalhost.

--restart

N/A

如果守护进程崩溃,自动重启守护进程。

--norestart

N/A

如果守护进程崩溃,不重启守护进程。

--conf

-c

使用备用配置文件。

The ceph命令包括:

命令

描述

start

启动守护进程。

stop

停止守护进程。

forcestop

强制停止守护进程。与kill -9.

killall

杀死特定类型的所有守护进程。

cleanlogs

清理日志目录。

cleanalllogs

清理目录中的所有内容。清理日志目录中的所有内容。

The [daemons]选项允许ceph服务针对特定守护进程类型执行子系统操作。守护进程类型包括:

  • mon

  • osd

  • mds

由 Ceph 基金会带给您

Ceph 文档是一个社区资源,由非盈利的 Ceph 基金会资助和托管Ceph Foundation. 如果您想支持这一点和我们的其他工作,请考虑加入现在加入.