CentOS 6 Cluster 設定

2013-07-04 11:29

 

1. Install the needed packages

 

% yum groupinstall "High Availability" "Resilient Storage"

% yum groupinstall "High Availability Management" (head node only)

% yum install iscsi-initiator-utils

 


2. Add the following ports to /etc/sysconfig/iptables

 

5404, 5405 UDP corosync/cman (Cluster Manager)

11111 TCP ricci (propagates updated cluster information)

21064 TCP dlm (Distributed Lock Manager)

16851 TCP modclusterd

8084 TCP luci (head node for conga access)

 

% service iptables restart

 


3. Edit /etc/selinux/config to disable selinux SELINUX=disabled

 

% setenforce 0

 


4. Set the password for ricci / configure the appropriate services for startup

% passwd ricci Changing password for user ricci. New password:

% chkconfig ricci on | service ricci start

% chkconfig luci on | service luci start (head node only)

% chkconfig cman on | chkconfig clvmd on | chkconfig rgmanager on

% chkconfig modclusterd on

% chkconfig NetworkManager off | service NetworkManager stop


 

5. Set your IP static if it's not already

 

% system-config-network


 

6. Edit /etc/hosts on all nodes to be the same, example:

 

127.0.0.1 localhost.localdomain localhost

192.168.1.30 node1.localdomain.com node1

192.168.1.31 node2.localdomain.com node2

192.168.1.32 iscsi.localdomain.com iscsi 

Make sure 127.0.0.1 does not point to the hostname (both ipv4 and ipv6)


 

7. Point your browser to the conga interface to create the cluster

 

https://node1.localdomain.com:8084

Enter the root username and password

 


8. Create the GFS shared filesystem from any of the nodes

 

% iscsiadm -m discovery -t sendtargets -p iscsi.localdomain.com (both nodes)

% service iscsi restart (both nodes)

% fdisk /dev/sdb (create a lvm partition)

% vgcreate stor_vg /dev/sdb1

% lvcreate -L +4.95G -n stor_lv stor_vg

% mkfs.gfs2 -p lock_dlm -t Hydra:storage -j 4 /dev/mapper/stor_vg-stor_lv (substitute Hydra with the name of your cluster)

 


9. Update /etc/fstab to mount the filesystem to /storage at startup

 

/dev/mapper/stor-vg/stor-lv /storage gfs2 defaults 0 0

 


10. Example FTP service configuration using conga

 

% yum install vsftpd (on all cluster nodes)

 

Name: srv_ftp

Recovery Policy: Relocate

Resource: IP Address: 192.168.175.200

Script Resource: /etc/init.d/vsftpd

 

Make sure all configuration files on all nodes are identical for each service

 

I advise restarting the cluster after adding the service