Show Table of Contents
A.2. 在 Red Hat Enterprise Linux Release 6.5 和 Red Hat Enterprise Linux Release 7 中使用 Pacemaker 创建集群
Red Hat Enterprise Linux 6.5 发行本支持使用
pcs 配置工具,通过 Pacemaker 进行集群配置。但在 Red Hat Enterprise Linux 6.5 和 Red Hat Enterprise Linux 7 中使用 Pacemaker 进行集群安装和创建时会稍有不同。本小节提供这两个发行本中命令的区别概述。有关在 Red Hat Enterprise Linux 7 中安装和创建集群的详情,请查看 第 1 章 Red Hat High Availability Add-On 配置及管理参考概述 和 第 3 章 集群创建及管理。
A.2.1. 在 Red Hat Enterprise Linux 6.5 和 Red Hat Enterprise Linux 7 中的 Pacemaker 安装
以下命令可安装 Pacemaker 要求在 Red Hat Enterprise Linux 6.5 中安装的 Red Hat High Availability Add-On 软件包,并防止
corosync 在没有安装 cman 的情况下启动。必须在集群的每个节点中运行这些命令。
[root@rhel6]#yum install pacemaker cman[root@rhel6]#yum install pcs[root@rhel6]#chkconfig corosync off
在 Red Hat Enterprise Linux 7 中,除安装 Pacemaker 需要的 Red Hat High Availability Add-On 软件包外,还要为名为
hacluster 的 pcs 管理帐户设定密码,同时要启动并启用 pcsd 服务。还需要为集群的这些节点认证该管理帐户。
在 Red Hat Enterprise Linux 7 中,请在集群的每个节点中运行以下命令。
[root@rhel7]#yum install pcs fence-agents-all[root@rhel7]#passwd hacluster[root@rhel7]#systemctl start pcsd.service[root@rhel7]#systemctl enable pcsd.service
在 Red Hat Enterprise Linux 7 中,在集群的一个节点中运行以下命令。
[root@rhel7]# pcs cluster auth [node] [...] [-u username] [-p password]A.2.2. 在 Red Hat Enterprise Linux Release 6.5 和 Red Hat Enterprise Linux Release 7 中使用 Pacemaker 创建集群
要在 Red Hat Enterprise Linux Release 6.5 中创建 Pacemaker 集群,则必须首先创建该集群,并在集群的每个节点中启动集群服务。例如:在
z1.example.com 和 z2.example.com 中运行以下命令,创建名为 my_cluster,由节点 z1.example.com 和 z2.example.com 组成的集群,并运行以下命令在那些节点中启动集群服务。
[root@rhel6]#pcs cluster setup --name my_cluster z1.example.com z2.example.com[root@rhel6]#pcs cluster start
在 Red Hat Enterprise Linux Release 7 中,需在集群的一个节点中运行创建集群命令。只在一个节点中运行以下命令,创建名为
my_cluster,由节点 z1.example.com 和 z2.example.com 组成的集群,并在那些节点中启动集群服务。
[root@rhel7]# pcs cluster setup --start --name my_cluster z1.example.com z2.example.com
Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.