红帽集群套件RHCS iSCSI GFS实现iSCSI集群(2)

三、【管理界面配置】
登录网址:https://desktop22.example.com:8084 name:root password:kevin
1、添加集群:
Manager Clusters -> Create {集群名字节点的密码是否一样,输入主机名密码端口不用改。这里选择在线下载所需的软件包,允许加入节点前重启持共享存储。} ->Create Cluster

2、配置集群:(点击创建的集群进去)
**创建节点:
创建完集群之后:会将添加的节点加进去,但都是显示红色,是因为相互通信的cman服务没有开启,手动开启cman服务:
[root@desktop54 node1]# service cman start    (节点1)
Starting cluster:
   Checking Network Manager...                             [  OK  ]
   Global setup...                                         [  OK  ]
   Loading kernel modules...                               [  OK  ]
   Mounting configfs...                                    [  OK  ]
   Starting cman...                                        [  OK  ]
   Waiting for quorum...                                   [  OK  ]
   Starting fenced...                                      [  OK  ]
   Starting dlm_controld...                                [  OK  ]
   Starting gfs_controld...                                [  OK  ]
   Unfencing self...                                       [  OK  ]
   Joining fence domain...                                 [  OK  ]

[root@desktop86 node2]# service cman start    (节点2)
Starting cluster:
   Checking Network Manager...                             [  OK  ]
   Global setup...                                         [  OK  ]
   Loading kernel modules...                               [  OK  ]
   Mounting configfs...                                    [  OK  ]
   Starting cman...                                        [  OK  ]
   Waiting for quorum...                                   [  OK  ]
   Starting fenced...                                      [  OK  ]
   Starting dlm_controld...                                [  OK  ]
   Starting gfs_controld...                                [  OK  ]
   Unfencing self...                                       [  OK  ]
   Joining fence domain...                                 [  OK  ]
此时再刷新管理页面,节点都显示正常了。

**添加fence设备:
Fence Devices -> Add{Fence virt(Multicast Mode) (然后fence type 会变为fence xvm ) ; 名字:kevin_virt_fence} -> Submit 确定

**添加Failover Domains 故障转移域:
Prioritized:优先级,故障转移时选择优先级高的。
Restricted:服务只运行在指定的节点上。
No Failback:当故障节点又正常的时候,不必把服务切换回去。
Failover Domains -> Add {名字:kevin_failover ;勾选Prioritized,No Failback具体情况自己设定;将实验的两台节点勾选,设定其优先级。}

-> Create

**添加资源:(具体的自己添加,实验以apache服务)
Resources -> Add -> 选择IP Address
{IP address:192.168.0.234『虚拟ip地址,用于访问的,确保没被使用』;
Netmask bits (optional):24『掩码位数』;
Monitor link:勾选上;
Number of seconds to sleep after removing an IP address:默认 }
->Submit

Resources -> Add -> 选择Script
{Name:httpd;
Full path to script file:/etc/init.d/httpd }
->Submit

**添加服务:(具体的自己添加)
Services -> Add
{Service name:apache ;
Automatically start this service:勾上『自动启动服务』;
Run exclusive:
Failover domain:选择刚刚加入的故障转移域kevin_failover;
Recovery policy:轮循方式}
-> Add a resource 选择刚刚添加的虚拟ip -> Add a resource 选择刚刚添加的脚本httpd ->Submit

四、测试
节点均装上httpd服务并开启服务:
[root@desktop54 node1]# yum install httpd -y     (节点1)
[root@desktop54 node1]# service httpd start
[root@desktop54 node1]# echo `hostname` > /var/www/html/index.html

[root@desktop86 node2]# yum install httpd -y     (节点2)
[root@desktop86 node2]# service httpd start
[root@desktop86 node2]# echo `hostname` > /var/www/html/index.html

没有截图,用文本方式访问:
[root@desktop22 server]# elinks -dump 192.168.0.54    (管理)
   desktop54.example.com
[root@desktop22 server]# elinks -dump 192.168.0.86
   desktop86.example.com
OK! 都正常
[root@desktop22 server]# elinks -dump 192.168.0.234    (虚拟ip)
   desktop54.example.com    (54优先级高)

在node1上模拟故障,看服务还能继续吗?用web方式刷新更直观
[root@desktop54 node1]# echo b > /proc/sysrq-trigger

[root@desktop22 server]# elinks -dump 192.168.0.234    (虚拟ip)
   desktop86.example.com
再等node1开接启动服务后:
[root@desktop22 server]# elinks -dump 192.168.0.234    (虚拟ip)
   desktop86.example.com
服务节点切回去了,这是因为刚刚勾���No Failback了。即使服务节点正常了不会再切回去。

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/9f251e322d13c1a19c5bf2a85033875b.html