o2cb服务说明
O2CB是OCFS2集群运行所需的一组集群服务。
OCFS2 与其自己的集群堆栈 O2CB 捆绑在一起。
该堆栈包括:
组件 | 描述 |
---|---|
NM | 跟踪 /etc/ocfs2/cluster.conf 中所有节点的节点管理器 |
HB | 当节点加入或者离开集群时发出向上/向下通知的心跳服务 |
TCP | 处理节点之间的通信 |
DLM | 分布式锁管理器,可跟踪所有锁、其所有者和状态 |
CONFIGFS | 用户空间驱动的配置文件系统挂载在 /config |
DLMFS | 内核空间DLM的用户空间接口 |
所有的集群服务都已经打包在 o2cb 系统服务中。
OCFS2 操作,如格式化、挂载等,要求 O2CB 集群服务至少在将要执行操作的节点上启动。
ocfs2-tools RPM 包提供了 o2cb 配置文件。
配置o2cb
要在启动时启动 o2cb 服务,请运行“/etc/init.d/o2cb configure”命令:
# /etc/init.d/o2cb configure Configuring the O2CB driver. This will configure the on-boot properties of the O2CB driver. The following questions will determine whether the driver is loaded on boot. The current values will be shown in brackets ('[]'). Hitting <ENTER> without typing an answer will keep that current value. Ctrl-C will abort. Load O2CB driver on boot (y/n) [n]:
“o2cb configure”会将更改保存到文件 /etc/sysconfig/o2cb 中。
此类文件的示例:
# cat /etc/sysconfig/o2cb # This is a configuration file for automatic startup of the O2CB # driver. It is generated by running /etc/init.d/o2cb configure. # Please use that method to modify this file # # O2CB_ENABELED: 'true' means to load the driver on boot. O2CB_ENABLED=true # O2CB_BOOTCLUSTER: If not empty, the name of a cluster to start. O2CB_BOOTCLUSTER=ocfs2 # O2CB_HEARTBEAT_THRESHOLD: Iterations before a node is considered dead. O2CB_HEARTBEAT_THRESHOLD= # O2CB_IDLE_TIMEOUT_MS: Time in ms before a network connection is considered dead. O2CB_IDLE_TIMEOUT_MS= # O2CB_KEEPALIVE_DELAY_MS: Max time in ms before a keepalive packet is sent O2CB_KEEPALIVE_DELAY_MS= # O2CB_RECONNECT_DELAY_MS: Min time in ms between connection attempts O2CB_RECONNECT_DELAY_MS=
on it road.com
服务控制
按需管理o2cb服务,使用服务工具或者直接运行/etc/init.d/o2cb脚本:
# /sbin/service o2cb help Usage: /etc/init.d/o2cb {start|stop|restart|force-reload|enable|disable|configure|load|unload|online|offline|force-offline|status} # /etc/init.d/o2cb help Usage: /etc/init.d/o2cb {start|stop|restart|force-reload|enable|disable|configure|load|unload|online|offline|force-offline|status}
可用的命令有:
命令 | 描述 |
---|---|
start | 如果您已将集群配置为在启动时加载,则相当于加载然后是在线命令序列。 |
stop | 如果您已将集群配置为在启动时加载,则相当于离线然后卸载命令序列。 |
restart | 相当于先停止然后再启动命令序列。 |
force-reload | 这与重启命令相同。 |
enable | 启用集群以在启动时加载,然后运行启动命令。 |
disable | 禁止集群在启动时加载,然后运行停止命令。 |
configure | 将 o2cb 配置为在启动时加载,如果您已将集群配置为在启动时加载,则运行 start 命令,否则运行 stop 命令。 |
load | 加载 o2cb 使用的模块。 |
unload | 卸载 o2cb 使用的模块。 |
online | 使 o2cb 集群联机。 |
offline | 使 o2cb 集群脱机。 |
force-offline | 强制脱机 o2cb 集群。 |
status | 检查 o2cb 集群的状态。 |
日期:2020-09-17 00:14:37 来源:oir作者:oir