Friday 21 August 2015

RHEL cluster 3.X installation & configuration.

SERVERS:10.25.12.20/10.25.12.25
RHEL  6: Configuring a cman-based cluster to use a specific network interface
1)Define all nodes in /etc/hosts.
If these nodes do not have any pre-existing hostname on that network, then names can be assigned to them in this file,
 as long as those names don't conflict with others hosts on the network.
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.143.61 node1.google.com node1
192.168.143.62 node2.google.com node2
Note: configure above ip's manullay on both nodes for private communication.
2)RPM need to install on both nodes.
Note: - Configure YUM on web
#mkdir -p /var/www/html/RHEL6/u5/Server/x86_64/
#cp -R /cdrom/* /var/www/html/RHEL6/u5/Server/x86_64/
#chmod a+rx -R /var/www/html/RHEL6/u5/Server/x86_64/
#service httpd start
#chcon -R -t httpd_sys_content_t /var/www/html/RHEL6/u5/Server/x86_64/
make entries in repo configuration file.
[or]
local repository cofiguration.
copy dvd into required location(/var/ftp/pub/RHEL6).
#vi  /etc/yum.repos.d/rhel-source.repo
[rhel-source]
name=Server
baseurl=file:///var/ftp/pub/RHEL6/Server
enabled=1
gpgcheck=0
[HighAvailability]
name=HighAvailability
baseurl=file:///var/ftp/pub/RHEL6/HighAvailability
enabled=1
gpgcheck=0
[LoadBalancer]
name=LoadBalancer
baseurl=file:///var/ftp/pub/RHEL6/LoadBalancer
enabled=1
gpgcheck=0
[ScalableFileSystem]
name=ScalableFileSystem
baseurl=file:///var/ftp/pub/RHEL6/ScalableFileSystem
enabled=1
gpgcheck=0
[ResilientStorage]
name=ResilientStorage
baseurl=file:///var/ftp/pub/RHEL6/ResilientStorage
enabled=1
gpgcheck=0
# yum repolist
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
HighAvailability                                                                                                                                 | 3.9 kB     00:00 ...
LoadBalancer                                                                                                                                     | 3.9 kB     00:00 ...
ResilientStorage                                                                                                                                 | 3.9 kB     00:00 ...
ScalableFileSystem                                                                                                                               | 3.9 kB     00:00 ...
rhel-source                                                                                                                                      | 3.9 kB     00:00 ...
repo id                                                                          repo name                                                                        status
HighAvailability                                                                 HighAvailability                                                                    56
LoadBalancer                                                                     LoadBalancer                                                                         4
ResilientStorage                                                                 ResilientStorage                                                                    62
ScalableFileSystem                                                               ScalableFileSystem                                                                   7
rhel-source                                                                      Server                                                                           3,690
repolist: 3,819
yum install gfs2-utils
yum install rgmanager
yum groupinstall "highavailabulity"
rpm -qa | egrep -i "ricci|luci|cluster|ccs|cman|gfs2"
yum groupinstall  Resilient*
yum install -y pacemaker
LUCI user & Ricci user is created while installing cluster
ricci:x:140:140:ricci daemon user:/var/lib/ricci:/sbin/nologin
luci:x:141:141:luci high availability management application:/var/lib/luci:/sbin/nologin
hacluster:x:494:489:heartbeat user:/var/lib/heartbeat/cores/hacluster:/sbin/nologin
please reset passd for above users.
#passwd ricci
#passwd luci
#passwd hacluser



3)Starting Cluster Software
type the following commands in this order:
1)service cman start
2)service clvmd start -----> if CLVM has been used to create clustered volumes
3)service gfs2 start---------> if you are using Red Hat GFS2
4)service rgmanager start--------> if you using high-availability (HA) services (rgmanager).
--------
To stop the cluster software on a node,
type the following commands in this order:
1)service rgmanager stop
2)service gfs2 stop
3)umount -at gfs2
4)service clvmd stop
5)service cman stop
4) Staring Cluster GUI .
# yum install luci
# service luci start
Starting luci: generating https SSL certificates...  done
                                                           [  OK  ]
/etc/sysconfig/luci is configuration file.
https://10.25.12.20:8084/

By using gui we need to configure
1) Clster name
2) cluster members
3) fencing
4) quorum devices
5)resources,& service groups.

5) then it generates cluster.conf file
6. After completing configuration of the rest of the necessary components and starting the cman service, check cman_tool status to see what addresses the nodes are communicating over:
Raw
[root@node1 ~]# cman_tool status | grep "Node addresses"
Node addresses: 192.168.143.61
Raw
[root@node2 ~]# cman_tool status | grep "Node addresses"
Node addresses: 192.168.143.62
Product(s) Red Hat Enterprise Linux Component cluster
Category Learn



7) Creating GFS file system is mandatiory.
after install cluster tools then only configure pvs,vgs,lvs other wise it does not recognize.
crateating volume:-
before creating volume with out cluster install ??
# service clvmd status
clvmd (pid  2121) is running...
Clustered Volume Groups: (none)
Active clustered Logical Volumes: (none)
# lvremove posdb1datavol  posdb1datavg
  Volume group "posdb1datavol" not found
  Skipping volume group posdb1datavol
Do you really want to remove active logical volume posdb1datavol? [y/n]: y
  Logical volume "posdb1datavol" successfully removed

# pvs
  PV         VG           Fmt  Attr PSize   PFree
  /dev/sdb   posdb1datavg lvm2 a--  200.00g 200.00g
[root@hydposdb1 ~]# vgs
  VG           #PV #LV #SN Attr   VSize   VFree
  posdb1datavg   1   0   0 wz--n- 200.00g 200.00g

# pvcreate /dev/sdb
  clvmd not running on node posdb_node1.google.co.in
  Can't get lock for orphan PVs

# service clvmd stop
Signaling clvmd to exit                                    [  OK  ]
clvmd terminated                                           [  OK  ]
# pvcreate /dev/sdb
  connect() failed on local socket: No such file or directory
  Internal cluster locking initialisation failed.
  WARNING: Falling back to local file-based locking.
  Volume Groups with the clustered attribute will be inaccessible.
  Physical volume "/dev/sdb" successfully created
# pvs
  connect() failed on local socket: No such file or directory
  Internal cluster locking initialisation failed.
  WARNING: Falling back to local file-based locking.
  Volume Groups with the clustered attribute will be inaccessible.
  PV         VG   Fmt  Attr PSize   PFree
  /dev/sdb        lvm2 a--  200.00g 200.00g
# service clvmd start
Starting clvmd:
Activating VG(s):   No volume groups found
                                                           [  OK  ]
# pvs
  PV         VG   Fmt  Attr PSize   PFree
  /dev/sdb        lvm2 a--  200.00g 200.00g

# vgcreate posdbdatavg /dev/sdb
  Clustered volume group "posdbdatavg" successfully created
[root@hydposdb1 ~]# service clvmd status
clvmd (pid  17090) is running...
Clustered Volume Groups: posdbdatavg
Active clustered Logical Volumes: (none)
# lvcreate -L 199G -n posdbdatavol posdbdatavg
  Logical volume "posdbdatavol" created
# lvs
  LV           VG          Attr       LSize   Pool Origin Data%  Move Log Cpy%Sync Convert
  posdbdatavol posdbdatavg -wi-a----- 199.00g
# service clvmd status
clvmd (pid  17090) is running...
Clustered Volume Groups: posdbdatavg
Active clustered Logical Volumes: posdbdatavol
To create GFS file system.
#  mkfs.gfs2 -t pos_cluster:posvol_gfs -p lock_dlm -j 3 /dev/posdbdatavg/posdbdatavol
This will destroy any data on /dev/posdbdatavg/posdbdatavol.
It appears to contain: symbolic link to `../dm-0'
Are you sure you want to proceed? [y/n] y
Device:                    /dev/posdbdatavg/posdbdatavol
Blocksize:                 4096
Device Size                199.00 GB (52166656 blocks)
Filesystem Size:           199.00 GB (52166654 blocks)
Journals:                  3
Resource Groups:           796
Locking Protocol:          "lock_dlm"
Lock Table:                "pos_cluster:posvol_gfs"
UUID:                      79bd19f4-478a-65b1-b563-b537cfa15f46

mkfs -t gfs2 -p lock_dlm -j 2 -t <cluster>:<name>  /volumefullpath

8)Testing command line:-
# clustat
Cluster Status for poc_cluster @ Sat May 16 12:34:46 2015
Member Status: Quorate
 Member Name                                                     ID   Status
 ------ ----                                                     ---- ------
 node1.google.co.in                                                   1 Online, rgmanager
 node2.google.co.in                                                   2 Online, Local, rgmanager
 Service Name                                                     Owner (Last)                                                     State
 ------- ----                                                     ----- ------                                                     -----
 service:pos                                                      (node1.google.co.in)                                              disabled
2)To enable service
#clusvcadm -e pos   -m hostnme
3)To restart service on running node.
#clusvcadm -R service_name
3)To stop service on running node.
#clusvcadm -s service_name
4)To freeze service on running node.
#clusvcadm -Z service_name
5)To unfreeze service on running node.
#clusvcadm -U service_name
6)To move service to another node.
#clusvcadm -r service_name


===================
RHEL 7: Configuring a corosync-based cluster to use a specific network interface.
1. Define all nodes in /etc/hosts.
 If these nodes do not have any pre-existing hostname on that network, then names can be assigned to them in this file,
 as long as those names don't conflict with others hosts on the network.

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.143.61 node1.example.com node1
192.168.143.62 node2.example.com node2
2. Set up the cluster with pcs,
the pcsd web interface, or directly in /etc/corosync/corosync.conf, specifying names matching those that were added in /etc/hosts. For example:

# pcs cluster setup --name myCluster node1.example.com node2.example.com
Which would produce a nodelist definition in /etc/corosync/corosync.conf with those names as the "ring0_addr" for each node:
Raw
nodelist {
  node {
        ring0_addr: node1.example.com
        nodeid: 1
       }
  node {
        ring0_addr: node2.example.com
        nodeid: 2
       }
}














NOTE: RHEL 7 corosync supports the usage of Redundant Ring Protocol in which multiple redundant interfaces can be used to communicate in the cluster.
In such configurations, the "ring1_addr" should be defined in /etc/hosts the same way the primary name was.
3. Upon starting the cluster with pcs cluster start [--all], check the output of corosync-cfgtool on each node to see what addresses are being used for node communication:
[root@node1 ~]# corosync-cfgtool -s
Printing ring status.
Local node ID 1
RING ID 0
    id  = 192.168.143.61
    status  = ring 0 active with no faults
[root@node1 ~]# corosync-cfgtool -s
Printing ring status.
Local node ID 1
RING ID 0
    id  = 192.168.143.62
    status  = ring 0 active with no faults

No comments:

Post a Comment