CentOS 6. RHCS Cluster 配置

RHCS: Red Hat Cluster Suite

前提准备:

时间同步, hosts解析, ssh互信
此集群建议使用3个以上节点, 2节点集群需要配置仲裁磁盘

环境说明:

node1(管理节点): 10.11.8.187
node2: 10.11.8.186
node3: 10.11.8.200

安装:

yum install luci rgmanager

PS: 只安装rgmanager就可以牵动安装HA集群软件包, 也可暂不安装, 使用luci批量安装

luci配置:

1.编辑 node1 上 /etc/sysconfig/luci 文件, 将服务端口改为1024的某个端口

[root@node1 ~]# vim /etc/sysconfig/luciport = 8084

2.为所有节点的 ricci 用户设置密码

[root@node1 ~]# passwd ricciChanging password for user ricci.New password: BAD PASSWORD: it is too shortBAD PASSWORD: is too simpleRetype new password: passwd: all authentication tokens updated successfully.

3.启动所用节点上的 ricci 服务

service ricci start

4.启动 node1 上的 luci 服务:

[root@node1 ~]# service luci startStart luci...                                              [  OK  ]Point your web browser to https://node1:8084 (or equivalent) to access luci

集群配置:

浏览器访问 https://node1:8084 使用运行 luci 节点的 root 用户和密码登录:
登录后界面如图:

在 Manage Cluster 中选在 create 创建一个新集群:

PS: 此处密码即为 ricci 用密码, tcp:11111 为 ricci 服务所监听的端口

资源服务配置:

此处以 web service 为例, httpd安装过程不再演示, 分别为3个节点提供一个不同的页面用以测试

1.创建资源

PS: RHCS与corosync不同, 资源必须添加到服务后才能启动

2.创建服务

ERROR

在命令行启动一次之后恢复正常, 原因不明, 排错失败, 这次是我输了

结果服务还是起来了

clusvcadm 命令行管理工具:

clusvcadm: invalid option -- '-'
usage: clusvcadm [command]

Resource Group Control Commands:
-v Display version and exit
-d Disable . This stops a group until an administrator enables it again, the cluster loses and regains quorum, or an
administrator-defined event script explicitly enables it again.
-e Enable
-e -F Enable according to failover domain rules (deprecated; always the case when using central processing)
-e -m Enable on
-r -m Relocate [to ] Stops a group and starts it on another cluster member.
-M -m Migrate to (e.g. for live migration of VMs)
-q Quiet operation
-R Restart a group in place.
-s Stop . This temporarily stops a group. After the next group or or cluster member transition, the group will be
restarted (if possible).
-Z Freeze resource group. This prevents transitions and status checks, and is useful if an administrator needs to administer part of
a service without stopping the whole service.
-U Unfreeze (thaw) resource group. Restores a group to normal operation.
-c Convalesce (repair, fix) resource group. Attempts to start failed, non-critical resources within a resource group. Resource Group
Locking (for cluster Shutdown / Debugging):
-l Lock local resource group managers. This prevents resource groups from starting.
-S Show lock state
-u Unlock resource group managers. This allows resource groups to start.

服务迁移测试:

[root@node1 ~]# clustat Cluster Status for web_cluster @ Wed May 25 22:10:04 2016Member Status: Quorate Member Name                                      ID   Status ------ ----                                      ---- ------ node1                                                1 Online, Local, rgmanager node2                                                2 Online, rgmanager node3                                                3 Online, rgmanager Service Name                            Owner (Last)                            State          ------- ----                            ----- ------                            -----          service:web_service                     node3                                   started       [root@node1 ~]# clusvcadm -r web_service -m node2Trying to relocate service:web_service to node2...Successservice:web_service is now running on node2[root@node1 ~]# clustat Cluster Status for web_cluster @ Wed May 25 22:11:00 2016Member Status: Quorate Member Name                                      ID   Status ------ ----                                      ---- ------ node1                                                1 Online, Local, rgmanager node2                                                2 Online, rgmanager node3                                                3 Online, rgmanager Service Name                            Owner (Last)                            State          ------- ----                            ----- ------                            -----          service:web_service                     node2                                   started       

结果而言服务正常, 报错问题找到原因后再补充吧

关键字:cluster, ha, group, luci

版权声明

本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处。如若内容有涉嫌抄袭侵权/违法违规/事实不符,请点击 举报 进行投诉反馈!

立即
投稿

微信公众账号

微信扫一扫加关注

返回
顶部