Category Archives: HA

Infrastuctur New Design (DRBD + Heartbeat + Pacemaker + Corosyn )


Infrastuctur New Designrequirement_infrastuktur

  1. Teknologi yang digunakan Heartbeat & DRBD or Pacemaker, Corosyn dan DRBD
    1. Heartbeat : Mengecek mati hidupnya suatu service
    2. DRBD         : Mirroring data level network
  2. Requirement
    1. Server menggunakan hardisk SAS dan minimal size 250GB (RAID) karena akan dibagi 2 VM, jika size hardisk 146 GB maka bisa di set jenis raidnya size lebih besar.
    2. Direkomentasikan jumlah NIC sebanyak 4 (standard server)

i.     1 interface untuk sinkronisasi data

ii.     1 interface untuk ke switch + host

  1. Minimal core jika di buat 2 VM adalah 8 Core

i.     2 Core untuk Host

ii.     3 Core untuk VM1

iii.     3 Core untuk VM2

  1. Minimal memory 8 GB

i.     2 GB untuk Host

ii.     3 GB untuk VM1

iii.     3 GB untuk VM2

  1. Sistem Operasi untuk  VMware di install di SSD dengan pentimbangan size hardisk lebih leluasa digunakan dan kerusakan / corrupt OS EXSI tidak mengganggu VM
  2. Storage External

i.     Digunakan untuk backup database,recording,aplikasi dll (recommended >=1TB SATA)

  1. Dengan requirement diatas diperkirakan sudah bisa menghandle <=75 AgentJ
  2. Service yang di failover
    1. Mysql
    2. Httpd
    3. Ecentrix
    4. Asterisk
  3. Data yang di mirror
    1. /var/www/html
    2. /var/lib/mysql
    3. /home (include all config)
    4. /etc/asterisk
    5. /var/lib/asterisk/sounds
  4. Jika salah satu server down/crash/rusak maka backup akan mengambil alih secara otomatis, waktunya yang diperlukan kurang lebih 1 menit.
  5. Keuntungan:
    1. Data terjamin aman,downtime kecil
    2. Kerusakan server tidak perlu mengganti IP server atau IP di agent / user (VIP)
    3. Mediagateway register ke virtual IP

PROXMOX , ACCESS VM FROM IP PUBLIC USING IPTABLE (NAT)


BEFORE

root@proxmox1:/etc/network# cat interfaces

# network interface settings
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address  192.168.137.104
netmask  255.255.255.0

iface eth1 inet manual

auto eth2
iface eth2 inet static
address  192.168.0.251
netmask  255.255.255.0

auto vmbr0
iface vmbr0 inet static
address  192.168.0.250
netmask  255.255.255.0
gateway  192.168.0.254
bridge_ports eth1
bridge_stp off

        bridge_fd 0
AFTER
root@proxmox1:/etc/network# cat interfaces

# network interface settings
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.137.104
netmask 255.255.255.0

iface eth1 inet manual

auto eth2
iface eth2 inet static
address 192.168.0.251
netmask 255.255.255.0

auto vmbr0
iface vmbr0 inet static
address 192.168.0.250
netmask 255.255.255.0
gateway 192.168.0.254
bridge_ports eth1
bridge_stp off
bridge_fd 0
post-up echo 1 > /proc/sys/net/ipv4/conf/eth1/proxy_arp  (Perhatikan baris ini yah!!)

auto vmbr1
iface vmbr1 inet static
address 192.168.37.1
netmask 255.255.255.0
bridge_ports none
bridge_stp off
bridge_fd 0
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
post-up iptables -t nat -A POSTROUTING -s ‘192.168.37.0/24’ -o vmbr0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s ‘192.168.37.0/24’ -o vmbr0 -j MASQUERADE

Restart Network

root@proxmox1:/etc/network# /etc/init.d/networking restart

Run on HOST

iptables -t nat -A PREROUTING -i vmbr0 -p tcp –dport 2222 -j DNAT –to 192.168.37.2:22

iptables -t nat -A PREROUTING -i vmbr0 -p tcp –dport 8888 -j DNAT –to 192.168.37.2:80

 

VM :
ifconfig eth0 192.168.37.2 netmask 255.255.255.0

route add default gw 192.168.37.1

Thanks

 

 

 

DRBD + HEARTBEAT CENTOS 6.3


[root@node1 drbd.d]# rpm -aq | egrep -i “heartbeat|drbd|kmod”
heartbeat-libs-3.0.4-1.el6.x86_64
kmod-drbd83-8.3.13-2.el6_3.elrepo.x86_64
drbd83-utils-8.3.13-1.el6.elrepo.x86_64
heartbeat-3.0.4-1.el6.x86_64
[root@node1 drbd.d]#

[root@node1 drbd.d]# cat global_common.conf
global {
usage-count yes;
dialog-refresh 1;
minor-count 5;
# minor-count dialog-refresh disable-ip-verification
}

common {
protocol C;

handlers {
pri-on-incon-degr “/usr/lib/drbd/notify-pri-on-incon-degr.sh; /usr/lib/drbd/notify-emergency-reboot.sh; echo b > /proc/sysrq-trigger ; reboot -f”;
pri-lost-after-sb “/usr/lib/drbd/notify-pri-lost-after-sb.sh; /usr/lib/drbd/notify-emergency-reboot.sh; echo b > /proc/sysrq-trigger ; reboot -f”;
local-io-error “/usr/lib/drbd/notify-io-error.sh; /usr/lib/drbd/notify-emergency-shutdown.sh; echo o > /proc/sysrq-trigger ; halt -f”;
# fence-peer “/usr/lib/drbd/crm-fence-peer.sh”;
# split-brain “/usr/lib/drbd/notify-split-brain.sh root”;
# out-of-sync “/usr/lib/drbd/notify-out-of-sync.sh root”;
# before-resync-target “/usr/lib/drbd/snapshot-resync-target-lvm.sh -p 15 — -c 16k”;
# after-resync-target /usr/lib/drbd/unsnapshot-resync-target-lvm.sh;
}

startup {
# wfc-timeout degr-wfc-timeout outdated-wfc-timeout wait-after-sb
wfc-timeout 20;
degr-wfc-timeout 30;
}

disk {
# on-io-error fencing use-bmbv no-disk-barrier no-disk-flushes
# no-disk-drain no-md-flushes max-bio-bvecs
on-io-error detach;
}

net {
# sndbuf-size rcvbuf-size timeout connect-int ping-int ping-timeout max-buffers
# max-epoch-size ko-count allow-two-primaries cram-hmac-alg shared-secret
# after-sb-0pri after-sb-1pri after-sb-2pri data-integrity-alg no-tcp-cork
timeout 20;
connect-int 20;
ping-int 20;
max-buffers 2048;
max-epoch-size 2048;
ko-count 30;
cram-hmac-alg “sha1”;
shared-secret “drbdtestingIntelix”;
}

syncer {
# rate after al-extents use-rle cpu-mask verify-alg csums-alg
rate 10M;
al-extents 257;
}
}

 

Load Balance Webserver + HAProxy On Centos 6.2 / 64 bit


“HAProxy is a free, very fast and reliable solution offering high availability, load balancing, and proxying for TCP and HTTP-based applications. It is particularly suited for web sites crawling under very high loads while needing persistence or Layer7 processing. Supporting tens of thousands of connections is clearly realistic with todays hardware. Its mode of operation makes its integration into existing architectures very easy and riskless, while still offering the possibility not to expose fragile web servers to the Net.” reff http://www.howtoforge.com/setting-up-a-high-availability-load-balancer-with-haproxy-keepalived-on-debian-lenny

 

Keterangan:

Server : 192.168.0.253 berfungsi sebagai load balancer ( server inilah yang akan di akses oleh client)

Server : 192.168.0.7 & 192.168.0.11 sebagai web server, sekaligus tempat aplikasi web yang akan di akses. so pastikan sudah terinstall paket apache.

Server 192.168.0.253

Install haproxy (sesuaikan dengan versi nya apakah menggunakan 32 or 64 bit)

[root@svrrepo ~]# rpm -ivh http://mirrors.ispros.com.bd/fedora-epel/6/x86_64/epel-release-6-7.noarch.rpm

[root@svrrepo ~]# yum search haproxy
haproxy.x86_64 : HA-Proxy is a TCP/HTTP reverse proxy for high availability environments
[root@svrrepo ~]# yum install haproxy.x86_64
Setelah proses instalasi ini maka akan membentuk satu user haproxy di /etc/passwd
[root@svrrepo haproxy]# cat /etc/passwd
haproxy:x:497:497:HAProxy user:/var/lib/haproxy:/bin/false

[root@svrrepo ~]# cd /etc/haproxy/
Backup config aslinya

[root@svrrepo haproxy]# cp haproxy.cfg haproxy.cfg.def

[root@svrrepo html]# vim /etc/haproxy/haproxy.cfg

#tambahkan baris berikut

listen SVR253 192.168.0.253:80 # ip server load balancer
mode http
balance roundrobin
cookie JSESSIONID prefix
option httpchk HEAD /check.txt HTTP/1.0
option httpclose
option forwardfor
stats auth testing1:testing1 #username untuk authentikasi untuk mengakses statistic haproxy
server server7 192.168.0.7:80 check cookie A check  # ip server web server1
server server11 192.168.0.11:80 check cookie B check # ip server web server 2

save wq!

check configurasi valid or not
[root@svrrepo haproxy]# haproxy -f /etc/haproxy/haproxy.cfg -c
Restart service

[root@svrrepo haproxy]#service haproxy start

Register sebagai service (runlevel) so boot pada saat startup server

[root@svrrepo haproxy]#chkconfig haproxy on

Login ke server 192.168.0.7 & 192.168.0.11

[root@server11 ~]# vim /var/www/html/index.php
<?php phpinfo();?>
[root@telephony ~]# vim /var/www/html/index.php
<?php phpinfo();?>

Akses http://192.168.0.253/index.php
harusnya sudah muncul isi dari phpinfo();

Untuk memonitor apakah loadbalancing sudah jalan maka akses http://192.168.0.253/haproxy?stats dan login dengan username sesuai dengan config yang ada di haproxy.conf (testing1:testing1)

Coba amati log di server 192.168.0.7 & 192.168.0.11 dengan command tail -f /var/log/http/access.log, kemudian matikan salah satu webserver apa yang terjadi??? Juga amati Bytes IN/Out pada monitoring:D

Vmware Interview Questions


Vmware Interview Questions

  1. Explain about your production environment? How many cluster’s, ESX, Data Centers, H/w etc ?
  2. How does VMotion works? What’s the port number used for it?
  3. Prerequisites for VMotion
  4. How does HA works? Port number? How many host failure allowed and why?
  5. What are active host / primary host in HA? Explain it?
  6. Prerequisites for HA ?
  7. How do DRS works? Which technology used? What are the priority counts to migrate the VM’s?
  8. How does snap shot’s works?
  9. What are the files will be created while creating a VM and after powering on the VM?
  10. If the VMDK header file corrupt what will happen? How do you troubleshoot?
  11. Prerequisites VC, Update manager?
  12. Have you ever patched the ESX host? What are the steps involved in that?
  13. Have you ever installed an ESX host?  What are the pre and post conversion steps involved in that? What would be the portions listed? What would be the max size of it?
  14. I turned on Maintenance mode in an ESX host, all the VM’s has been migrated to another host, but only one VM failed to migrate? What are the possible reasons?
  15. How will you turn start / stop a VM through command prompt?
  16. I have upgraded a VM from 4 to 8 GB RAM; it’s getting failed at 90% of powering on? How do you troubleshoot?
  17. Storage team provided the new LUN ID to you? How will you configure the LUN in VC? What would be the block size (say for 500 GB volume size)?
  18. I want to add a new VLAN to the production network? What are the steps involved in that? And how do you enable it?
  19. Explain about VCB? What it the minimum priority (*) to consolidate a machine?
  20. How VDR works?
  21. What’s the difference between Top and ESXTOP command?
  22. How will you check the network bandwidth utilization in an ESXS host through command prompt?
  23. How will you generate a report for list of ESX, VM’s, RAM and CPU used in your Vsphere environment?
  24. What the difference between connecting the ESX host through VC and Vsphere? What are the services involved in that? What are the port numbers’s used?
  25. How does FT works? Prerequisites? Port used?
  26. Can I VMotion between 2 different data centers? Why?
  27. Can I deploy a VM by template in different data centers ?
  28. I want to increase the system partition size (windows 2003 server- Guest OS) of a VM? How will you do it without any interruption to the end user?
  29. Which port number used while 2 ESX transfer the data in between?
  30. Unable to connect to a VC through Vsphere client? What could be the reason? How do you troubleshoot?
  31. Have you ever upgraded the ESX 3.5 to 4.0? How did you do it?
  32. What are the Vsphere 4.0, VC 4.0, ESX 4.0, VM 7.0 special features?
  33. What is AAM? Where is it used? How do you start or stop through command prompt?
  34. Have you ever called VMWare support? Etc
  35. Explain about Vsphere Licensing? License server?
  36. How will you change the service console IP?
  37. What’s the difference between ESX and ESXi?
  38. What’s the difference between ESX 3.5 and ESX 4.0?

TIP’S DRBD


Langkah-langkahnya adalah sbb:

1. Tambahkan resources baru di /etc/drbd.conf
2. Create metadata untuk node1
[root@node1 ~]# drbdadm create-md asterisk
[root@node1 ~]# /etc/init.d/drbd start
[root@node1 ~]# /etc/init.d/drbd (harusnya ini masih secondary/secondary dan inconsistence
[root@node2 ~]# /etc/init.d/drbd start
3. Jadikan node1 sebagai primary
[root@node1 ~]# drbdadm — –overwrite-data-of-peer asterisk
4. Format /dev/drdb1 (lakukan hanya di node1
[root@node1 ~]# mkfs -j /dev/drbd1
[root@node1 ~]# tune2fs -j 1 -c 0 /dev/drdb1
[root@node1 ~]# mkdir /asterisk
[root@node2 ~]# mkdir /asterisk
[root@node1 ~]# mount -o rw /dev/drbd1 /asterisk
[root@node1 ~]# mkdir -p /asterisk/{01,02}
5. Jadikan node1 sbg secondary
[root@node1 ~]# umount /asterisk
[root@node1 ~]# drbdam secondary asterisk
6. Jadikan node2 sebagai primary
[root@node2 ~]# drbdadm primary asterisk
[root@node2 ~]# mount -o rw /dev/drbd1 /asterisk
[root@node2 ~]# ls -l /asterisk ( harusnya folder 01, dan 02 harus muncul)
7. Kembalikan node1 sbg primary
[root@node2 ~]# umount /asterisk
[root@node2 ~]# drbdam secondary asterisk
[root@node1 ~]# drbdadm primary asterisk
[root@node1 ~]# mount -o rw /dev/drbd1 /asterisk
[root@node1 ~]# ls -l /asterisk
8. Tambahkan di /etc/ha.d/haresources (node1 & node2)
node1 IPaddr::192.168.137.100 drbddisk::mydrbd Filesystem::/dev/drbd0::/asterisk::ext3 mysql httpd drbddisk::asterisk Filesystem::/dev/drbd1::/asterisk::ext3 asterisk
9. Restat heartbeat di masing-masing node
10.Check hasilnya
============================================================================================

[root@node1 ~]# lvcreate -n lvasterisk -L+100M /dev/vgdata
[root@node2 /]# lvcreate -n lvasterisk -L+100M /dev/vgdata
[root@node1 ~]# drbdadm create-md asterisk
[root@node1 ~]# /etc/init.d/drbd start
[root@node1 ~]# cat /proc/drbd

[root@node1 etc]# cat /proc/drbd
version: 8.0.16 (api:86/proto:86)
GIT-hash: d30881451c988619e243d6294a899139eed1183d build by mockbuild@v20z-x86-64.home.local, 2009-08-22 13:23:34
0: cs:Connected st:Secondary/Secondary ds:UpToDate/UpToDate C r—
ns:0 nr:0 dw:0 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0
resync: used:0/61 hits:0 misses:0 starving:0 dirty:0 changed:0
act_log: used:0/257 hits:0 misses:0 starving:0 dirty:0 changed:0
1: cs:Connected st:Secondary/Secondary ds:Inconsistent/Inconsistent C r—
ns:0 nr:0 dw:0 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0
resync: used:0/61 hits:0 misses:0 starving:0 dirty:0 changed:0
act_log: used:0/257 hits:0 misses:0 starving:0 dirty:0 changed:0

[root@node1 etc]# /etc/init.d/drbd status
drbd driver loaded OK; device status:
version: 8.0.16 (api:86/proto:86)
GIT-hash: d30881451c988619e243d6294a899139eed1183d build by mockbuild@v20z-x86-64.home.local, 2009-08-22 13:23:34
m:res cs st ds p mounted fstype
0:mydrbd Connected Secondary/Secondary UpToDate/UpToDate C
1:asterisk Connected Secondary/Secondary Inconsistent/Inconsistent C

[root@node2 ha.d]# cat /proc/drbd
version: 8.0.16 (api:86/proto:86)
GIT-hash: d30881451c988619e243d6294a899139eed1183d build by mockbuild@v20z-x86-64.home.local, 2009-08-22 13:23:34
0: cs:Connected st:Secondary/Secondary ds:UpToDate/UpToDate C r—
ns:0 nr:0 dw:0 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0
resync: used:0/61 hits:0 misses:0 starving:0 dirty:0 changed:0
act_log: used:0/257 hits:0 misses:0 starving:0 dirty:0 changed:0
1: cs:Connected st:Secondary/Secondary ds:Inconsistent/Inconsistent C r—
ns:0 nr:0 dw:0 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0
resync: used:0/61 hits:0 misses:0 starving:0 dirty:0 changed:0
act_log: used:0/257 hits:0 misses:0 starving:0 dirty:0 changed:0
[root@node2 ha.d]# /etc/init.d/drbd status
drbd driver loaded OK; device status:
version: 8.0.16 (api:86/proto:86)
GIT-hash: d30881451c988619e243d6294a899139eed1183d build by mockbuild@v20z-x86-64.home.local, 2009-08-22 13:23:34
m:res cs st ds p mounted fstype
0:mydrbd Connected Secondary/Secondary UpToDate/UpToDate C
1:asterisk Connected Secondary/Secondary Inconsistent/Inconsistent C
[root@node1 etc]# drbdadm — –overwrite-data-of-peer primary asterisk
[root@node1 etc]# /etc/init.d/drbd status
drbd driver loaded OK; device status:
version: 8.0.16 (api:86/proto:86)
GIT-hash: d30881451c988619e243d6294a899139eed1183d build by mockbuild@v20z-x86-64.home.local, 2009-08-22 13:23:34
m:res cs st ds p mounted fstype
0:mydrbd Connected Secondary/Secondary UpToDate/UpToDate C
… sync’ed: 36.0% (65976/102360)K
1:asterisk SyncSource Primary/Secondary UpToDate/Inconsistent C

[root@node2 ha.d]# /etc/init.d/drbd status
drbd driver loaded OK; device status:
version: 8.0.16 (api:86/proto:86)
GIT-hash: d30881451c988619e243d6294a899139eed1183d build by mockbuild@v20z-x86-64.home.local, 2009-08-22 13:23:34
m:res cs st ds p mounted fstype
0:mydrbd Connected Secondary/Secondary UpToDate/UpToDate C
1:asterisk Connected Secondary/Primary UpToDate/UpToDate C
[root@node1 etc]# mkfs -j /dev/drbd1
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
25688 inodes, 102360 blocks
5118 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=67371008
13 block groups
8192 blocks per group, 8192 fragments per group
1976 inodes per group
Superblock backups stored on blocks:
8193, 24577, 40961, 57345, 73729

Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 27 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
[root@node1 etc]#
[root@node1 etc]# tune2fs -c 1 -i 0 /dev/drbd1
tune2fs 1.39 (29-May-2006)
Setting maximal mount count to 1
Setting interval between checks to 0 seconds
[root@node1 etc]# mkdir /asterisk
[root@node2 ha.d]# mkdir /asterisk
[root@node1 etc]# mount -o rw /dev/drbd1 /asterisk/

[root@node1 etc]# vim /etc/ha.d/haresources
node1 IPaddr::192.168.137.100 drbddisk::mydrbd Filesystem::/dev/drbd0::/data::ext3 httpd mysqld drbddisk::asterisk Filesystem::/dev/drbd1::/asterisk::ext3 asterisk

[root@node2 ha.d]# vim /etc/ha.d/haresources
node1 IPaddr::192.168.137.100 drbddisk::mydrbd Filesystem::/dev/drbd0::/data::ext3 httpd mysqld drbddisk::asterisk Filesystem::/dev/drbd1::/asterisk::ext3 asterisk
[root@node1 etc]# /etc/init.d/drdbd restart
[root@node2 etc]# /etc/init.d/drdbd restart

Apabila terjadi WFCONNECTION OR STANDALONE

[root@node2 etc]# drbdadm secondary mydrbd
[root@node2 etc]# drbdadm — –discard-my-data connect mydrbd

[root@node1 etc]# drbdadm primary mydrbd
[root@node1 etc]# drbdadm connect mydrbd

DRBD & HEARTBEAT (High Availability Cluster)


Percobaan dilakukan pada virtualbox dengan mencreate 2 oS centos 5.5 32 bit dan mencreate  hardisk virtual di masing-masing node. Untuk kali hanya di testing fungsi dari si heartbeat dan next akan di uraikan lagi secara detail fungsi si DRBD.

Case I
Service yang akan di failover adalah httpd,mysql maka pastikan di kedua server sudah terinstall apache dan pastikan bisa diakses dari jaringan, dalam kasus ini http://192.168.137.200 & http://192.168.137.201

1. Config /etc/hosts

[root@node1 ~]# vim /etc/hosts
127.0.0.1 localhost.localdomain localhost
#::1 localhost6.localdomain6 localhost6
192.168.137.200 node1.intelix.co.id node1
192.168.137.201 node2.intelix.co.id node2

[root@node2~]# vim /etc/hosts
127.0.0.1 localhost.localdomain localhost
#::1 localhost6.localdomain6 localhost6
192.168.137.200 node1.intelix.co.id node1
192.168.137.201 node2.intelix.co.id node2

Config /etc/sysctl.conf


[root@node1 ~]# echo “kernel.hostname = node1” >> /etc/sysctl.conf
[root@node1 ~]# sysctl –p

[root@node2 ~]# echo “kernel.hostname = node2” >> /etc/sysctl.conf
[root@node1 ~]# sysctl -p

2. Paket yang harus di install di kedua node
[root@node1 ]yum -y install heartbeat.i386 OpenIPMI-libs heartbeat-pils.i386 heartbeat-stonith.i386 libnet.i386
[root@node2 ]yum -y install heartbeat.i386 OpenIPMI-libs heartbeat-pils.i386 heartbeat-stonith.i386 libnet.i386

3. File configuration
[root@node1 ~]# cd /usr/share/doc/heartbeat-2.1.4/
[root@node1 heartbeat-2.1.4]# cp authkeys ha.cf haresources /etc/ha.d/
a. authkeys
[root@node1 ha.d]# vim /etc/ha.d/authkeys
Tambahkan isi di baris paling bawah
auth 2
2 sha1 intelix-ha-igc
b. ha.cf
[root@node1 ha.d]# vim /etc/ha.d/ha.cf
logfile /var/log/ha-log
logfacility local0
keepalive 2
deadtime 30
initdead 120
udpport 694
bcast eth0
auto_failback on
node node1
node node2
c. haresources
[root@node1 ha.d]# vim /etc/ha.d/ haresources
node1 192.168.137.100 httpd

4. Copy semua file config /etc/ha.d/ ke node2
[root@node1 ha.d]# cd /etc/ha.d/
[root@node1 ha.d]# scp -r authkeys ha.cf haresources root@192.168.137.201:/etc/ha.d/

5. Rubah configurasi file httpd.conf di kedua node
[root@node1 ~]# vim /etc/httpd/conf/httpd.conf
Option Listen harus dalam format sbb:
Listen 192.168.137.100:80

[root@node2 ~]# vim /etc/httpd/conf/httpd.conf
Option Listen harus dalam format sbb:
Listen 192.168.137.100:80

6. Stop service httpd dengan menggunakan command “chkconfig” sehingga ketika boot service itu tidak “up”
[root@node1 ~]# chkconfig httpd off
[root@node2~]# chkconfig httpd off

7. Restart Service heartbeat di kedua node
[root@node1 ~]# /etc/init.d/heartbeat start
Starting High-Availability services:
2011/11/03_20:57:00 INFO: Resource is stopped
[ OK ]

[root@node2 ~]# /etc/init.d/heartbeat stop
Stopping High-Availability services:
[ OK ]

[root@node2 ~]# /etc/init.d/heartbeat start
Starting High-Availability services:
2011/11/03_20:57:42 INFO: Resource is stopped

8. Pengujian
Untuk menguji apakah system yang sudah di setup berjalan dengan benar maka buka masing-masing 3 terminal untuk node1 dan node2

Node 1
Terminal 1
[root@node1 ~]# echo “node01 apache test server” > /var/www/html/index.html
Terminal 2
[root@node1~]# tail –f /var/log/ha-log
Terminal 3
[root@node1~]# for i in `seq 1 199`; do ifconfig eth0:0; sleep 5; done

Node2
[root@node2 ~]# echo “node02 apache test server” > /var/www/html/index.html
Terminal 2
[root@node2~]# tail –f /var/log/ha-log
Terminal 3
[root@node2~]# for i in `seq 1 199`; do ifconfig eth0:0; sleep 5; done

Buka url via browser , http://192.168.137.100/
Maka jika muncul tulisan “node01 apache test server” maka config anda sudah benar

Stop service heartbeat di node1 dan amati masing-masing log + status eth0:0 di terminal masing-masing node
[root@node1~]# /etc/init.d/heartbeat stop
Buka kembali url http://192.168.137.100/
Maka jika muncul tulisan “node02 apache test server” maka config anda sudah benar

Start Service hearbeat di node1
[root@node1~]# /etc/init.d/heartbeat start
Buka kembali url http://192.168.137.100/
Maka jika muncul tulisan “node01 apache test server” maka config anda sudah benar berjalan 100%

MYSQL
Untuk mengimplementasikan di mysql maka pastikan di masing-masing node sudah terinstall msysql. Caranya adalah sbb:

1. Edit file /etc/ha.d/resources di node1 & node2
Sebelum
[root@node1 ]# vim /etc/ha.d/ haresources
node1 192.168.137.100 httpd

Sesudah
[root@node1d]# vim /etc/ha.d/ haresources
node1 192.168.137.100 httpd mysqld

2. Stop runlevel service mysql sehingga tidak up ketika boot

[root@node1 ]# chkconfig mysqld off
[root@node2 ]# chkconfig mysqld off

3. Restart Service heartbeat
[root@node1 ]# /etc/init.d/heartbeat restart
[root@node2 ]# /etc/init.d/heartbeat restart

4. Grant privilege di node1 sehingga bisa di remote via mysqlyog or front
[root@node1 ]# mysql -uroot –p
enter
mysql> select user,password,host from user;
mysql> update user set user=’root’,host=’%’ where user=” and host=’localhost’;
mysql> flush privileges;
mysql> exit;

5. Stop service hearbeat di node1
[root@node1 ]# /etc/init.d/heartbeat stop

6. Grant privilege di node2 sehingga bisa di remote via mysqlyog or front
[root@node2 ]# mysql -uroot –p
enter
mysql> select user,password,host from user;
mysql> update user set user=’root’,host=’%’ where user=” and host=’localhost’;
mysql> flush privileges;
mysql> exit;

7. Start Service heartbeat di node1
[root@node1 ]# /etc/init.d/heartbeat start

8. Akses ip 192.168.137.100 via mysqlfront or mysqlyog dan create 1 database
9. Stop Service heartbeat di node1
10. Akses ip 192.168.137.100 via mysqlfront or mysqlyog dan harusnya masih tetap ada nanum database yang anda create sebelumnya tidak akan muncul , itu disebabkan belum ada syncronisasi data antar node. Nah agar data tetap ada maka diperlukanlah :

“Si -DRBD(Distributed Replicated Block Device)”

Tampilan drbd.conf yang menggunakan lvm (/dev/vgdata/lvdata)

drbd.conf

ASTERISK

Bagaimana dengan service yang lain seperti ssh, asterisk,ecentrix???? Mari kita coba bersama dan persiapkan alat-alat yang kita butuhkan untuk mensimulasikan sesuai dengan “dilapangan”

Created by moses tambunan

http://dev.centos.org/centos/5/testing/i386/RPMS/

shisdew

Listens until think alike

moses.spaceku@yahoo.com / voip ipbx

Hosted PBX, IP-PBX SOHO/ CALL CENTER, VOICE GATEWAY, VOICE CARD, COST EFECTIVE SOLUTIONS (LCR), GSM/CDMA GATEWAY

%d bloggers like this: