Centos Cluster Yapımı, Arsadan Anahtar Teslim!

Haziran 26th, 2013 § Yorum yok

Yeni bir Centos kurduk
ETH0 açılışta ayağa kalksın

vi /etc/sysconfig/network-scripts/ifcfg-eth0
ONBOOT=yes

eth0’ın routing ayarlarını yapalım

vi /etc/sysconfig/network-scripts/route-eth0
GATEWAY0=10.1.21.1
NETMASK0=255.255.255.0

Diğer network ayarları

vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=deneme4
GATEWAY=10.1.21.1

NetworkManager müdehalesini önleyelim

chkconfig NetworkManager off | service NetworkManager stop

iptables’ı kapatalım. Daha sonra açıp ayarlanabilir.

chkconfig iptables off
service iptables stop

ntp servisi çalışsın ki sunucular saati bilsin

chkconfig ntpd on
service ntpd start

selinux’ü iptal edelim

vi /etc/selinux/config
SELINUX=disabled

ayrıca konsoldan
setenforce 0

epel paketi ile depo ekleyelim. High Availability paketlerini kuralım

rpm -Uvh /root/epel-release-6-8.noarch.rpm
yum groupinstall "High Availability" -y

ricci şifresini verelim

passwd ricci

Cluster servisleri başlangıçta çalışsın

chkconfig cman on
chkconfig rgmanager on
chkconfig modclusterd on
chkconfig ricci on

Şimdi paket kurmakla işimiz bitti.
hosts dosyasına cluster üyelerini ve cluster ip’lerini ekleyelim

vi /etc/hosts 
10.1.21.101 node1
10.1.21.102 node2
10.1.21.103 node3
10.1.21.99 cluster1
10.1.21.98 cluster2

statik ip verelim

vi /etc/sysconfig/network-scripts/ifcfg-eth0 
BOOTPROTO=static
IPADDR=10.1.21.101
NETMASK=255.255.255.0
GATEWAY=10.1.21.254

Bütün nodlarda aynı cluster.conf olmalı. cluster.conf her değiştirildiğinde config_version=”n” arttırılmalıdır.

vi /etc/cluster/cluster.conf

<?xml version="1.0"?>
<cluster config_version="16" name="hacluster">
	<clusternodes>
		<clusternode name="deneme1" nodeid="1" votes="1">
			<fence>
				<method name="single"/>
			</fence>
		</clusternode>
		<clusternode name="deneme2" nodeid="2" votes="1">
			<fence>
				<method name="single"/>
			</fence>
		</clusternode>
		<clusternode name="deneme3" nodeid="3" votes="1">
			<fence>
				<method name="single"/>
			</fence>
		</clusternode>
		<clusternode name="deneme4" nodeid="4" votes="1">
			<fence>
				<method name="single"/>
			</fence>
		</clusternode>
	</clusternodes>
	<fencedevices/>
	<rm>
		<failoverdomains>
			<failoverdomain name="first" ordered="1" restricted="0">
				<failoverdomainnode name="deneme1" priority="4"/>
				<failoverdomainnode name="deneme2" priority="3"/>
				<failoverdomainnode name="deneme3" priority="2"/>
				<failoverdomainnode name="deneme4" priority="1"/>
			</failoverdomain>
		</failoverdomains>
		<resources>
			<ip address="10.1.21.200" monitor_link="1"/>
			<ip address="10.1.21.201" monitor_link="1"/>
			<ip address="10.1.21.202" monitor_link="1"/>
		</resources>
		<service autostart="1" exclusive="1" name="IP" recovery="relocate">
			<ip ref="10.1.21.200"/>
		</service>
		<service autostart="1" exclusive="1" name="IP2" recovery="relocate">
			<ip ref="10.1.21.201"/>
		</service>
		<service autostart="1" exclusive="1" name="IP3" recovery="relocate">
			<ip ref="10.1.21.202"/>
		</service>
	</rm>
</cluster>

Bütün nodlarda konfigürasyon validasyonu için

ccs_config_validate

Tebrikler. Clusterımız hazır ve nazır…
Hadi biraz eğlenelim

Cluster üyelerini görmek için

cman_tool nodes
Node  Sts   Inc   Joined               Name
   1   M    632   2011-09-16 06:26:53  hn1.redhat.com
   2   M    636   2011-09-16 06:26:53  hn2.redhat.com

Sanal ipleri görmek için

#ip addr list -- Get the virtual Ip Address
------------------------------------------------------
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 08:00:27:06:76:c7 brd ff:ff:ff:ff:ff:ff
    inet 151.8.18.53/16 brd 151.8.255.255 scope global eth0
    inet 151.8.18.55/16 scope global secondary eth0
    inet6 fe80::a00:27ff:fe06:76c7/64 scope link 

veya

ip addr list| grep "global second"| cut -d" " -f6| cut -d/ -f1

Cluster durumunu görmek için

# clustat -l
Cluster Status for Test_cluster @ Fri Sep 16 06:44:36 2011
Member Status: Quorate
 Member Name                             ID   Status
 ------ ----                             ---- ------
 hn1.redhat.com                                 1 Online, Local, rgmanager
 hn2.redhat.com                                 2 Online, rgmanager
Service Information
------- -----------
Service Name      : service:File system Mounting
  Current State   : started (112)
  Flags           : none (0)
  Owner           : hn2.redhat.com
  Last Owner      : hn1.redhat.com
  Last Transition : Fri Sep 16 06:19:27 2011

Service Name      : service:IP Address
  Current State   : started (112)
  Flags           : none (0)
  Owner           : hn1.redhat.com
  Last Owner      : hn2.redhat.com
  Last Transition : Fri Sep 16 06:27:18 2011

Servisi bir üyeden diğerine taşımak için

#clusvcadm -r service-name -m host-name
clusvcadm -r "IP" -m deneme1

HA Troubleshooting

At least that’s the theory. You may experience some issues, and when you do, you’ll find that troubleshooting HA clusters is a complex task because of the way they work – various daemons and kernel modules are responsible for different HA tasks, and each of these essential parts of the cluster can cause problems.

Checking logs can provide some clues when things go wrong. By default, all cluster-related messages go to /var/log/messages. These simple messages give basic information about major changes in the cluster, such as starting, stopping, or moving a service. This log also collects errors about problems with cluster communication.

You can find additional logs in the directory /var/log/cluster/. Each of the cluster’s components has a log file; the most important ones are:

corosync.log, which provides information about intercluster communication and synchronization. You can also use the command corosync-objctl without any arguments to show the cluster’s configuration in full detail.

rgmanager.log, which lists information related to the cluster’s services.

fenced.log, which provides information about fencing nodes. This log is not very detailed by default. It’s better to use the command fence_tool dump when debugging fenced daemon problems.

Bir cevap yazın

E-posta hesabınız yayımlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir

Ne yapıyorum ben!?

Centos Cluster Yapımı, Arsadan Anahtar Teslim! başlıklı yazıyı okuyorsun.

Üst Veri