Ini adalah langkah-langkah membuat cluster di Proxmox menggunakan DRBD disk untuk shared storagenya.
Dalam tulisan ini saya punya dua mesin yang saya beri nama “proxmox01″ dan “proxmox02″, skenarionya adalah, dua mesin ini akan saya cluster kemudian saya akan buat satu “vm” menggunakan debian wheezy, yang kemudian akan saya failover-kan.VM “wheezy” yang saya akan failover-kan nantinya akan ditempatkan di disk drbd.
Langkah awal tentunya install dulu proxmox dan konfigurasikan agar mesin tersebut bisa terkoneksi ke internet. IP address yang saya gunakan adalah:
proxmox01 : 10.87.16.120
proxmox02 : 10.87.16.130
proxmox02 : 10.87.16.130
KONFIGURASI CLUSTER
Buat cluster dalam hal ini saya beri nama “cluster01″
root@proxmox01:~# pvecm create cluster01
Restarting pve cluster filesystem: pve-cluster[dcdb] notice: wrote new cluster config '/etc/cluster/cluster.conf'.
Starting cluster:
Checking if cluster has been disabled at boot... [ OK ]
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 ]
Tuning DLM kernel config... [ OK ]
Unfencing self... [ OK ]
Tambahkan node proxmox02 ke “cluster01″ yang tadi telah dibuat.
root@proxmox02:~# pvecm add 10.87.16.120
The authenticity of host '10.87.16.120 (10.87.16.120)' can't be established.
RSA key fingerprint is d3:8e:c7:ec:a8:20:4d:e3:79:1c:d7:b1:84:3d:36:e0.
Are you sure you want to continue connecting (yes/no)? yes
root@10.87.16.120's password:
copy corosync auth key
stopping pve-cluster service
Stopping pve cluster filesystem: pve-cluster.
backup old database
Starting pve cluster filesystem : pve-clustercan't create shared ssh key database '/etc/pve/priv/authorized_keys'
.
Starting cluster:
Checking if cluster has been disabled at boot... [ OK ]
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 ]
Tuning DLM kernel config... [ OK ]
Unfencing self... [ OK ]
waiting for quorum...OK
generating node certificates
merge known_hosts file
restart services
Restarting PVE Daemon: pvedaemon.
Restarting web server: apache2 ... waiting .
successfully added node 'proxmox02' to cluster.
root@proxmox01:~# pvecm status
Version: 6.2.0
Config Version: 2
Cluster Name: cluster01
Cluster Id: 53601
Cluster Member: Yes
Cluster Generation: 16
Membership state: Cluster-Member
Nodes: 2
Expected votes: 2
Total votes: 2
Node votes: 1
Quorum: 2
Active subsystems: 5
Flags:
Ports Bound: 0
Node name: proxmox01
Node ID: 1
Multicast addresses: 239.192.209.51
Node addresses: 10.87.16.120
Periksa node dari cluster01
root@proxmox01:~# pvecm nodes
Node Sts Inc Joined Name
1 M 20 2013-10-24 11:36:28 proxmox01
2 M 28 2013-10-24 11:36:42 proxmox02
KONFIGURASI DRBD
Install dan konfigurasikan share disk DRBD.
root@proxmox01:~# apt-get update
root@proxmox01:~# apt-get install drbd8-utils
root@proxmox01:~# reboot
root@proxmox02:~# apt-get update
root@proxmox02:~# apt-get install drbd8-utils
root@proxmox02:~# reboot
Buat konfigurasi DRBD di proxmox01 dan proxmox02.
root@proxmox01:~# vi /etc/drbd.d/r0.res
resource r0 {
protocol C;
startup {
wfc-timeout 0; # non-zero wfc-timeout can be dangerous
degr-wfc-timeout 60;
become-primary-on both;
}
net {
cram-hmac-alg sha1;
shared-secret "h4ll0w0rd";
allow-two-primaries;
after-sb-0pri discard-zero-changes;
after-sb-1pri discard-secondary;
after-sb-2pri disconnect;
}
on proxmox01 {
device /dev/drbd0;
disk /dev/sdb1;
address 10.87.16.120:7788;
meta-disk internal;
}
on proxmox02 {
device /dev/drbd0;
disk /dev/sdb1;
address 10.87.16.130:7788;
meta-disk internal;
}
}
========================================================================
root@proxmox01:~# drbdadm create-md r0
DRBD module version: 8.3.13
userland version: 8.3.7
you should upgrade your drbd tools!
Writing meta data...
initializing activity log
NOT initialized bitmap
New drbd meta data block successfully created.
========================================================================Periksa status DRBD, seharusnya statusnya masih “ro:Secondary/Secondary”
root@proxmox01:~# cat /proc/drbd
version: 8.3.13 (api:88/proto:86-96)
GIT-hash: 83ca112086600faacab2f157bc5a9324f7bd7f77 build by root@sighted, 2012-10-09 12:47:51
0: cs:Connected ro:Secondary/Secondary ds:Inconsistent/Diskless C r-----
ns:0 nr:0 dw:0 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:31454240
root@proxmox01:~# drbdadm -- --overwrite-data-of-peer primary r0
root@proxmox01:~# /etc/init.d/drbd stop
root@proxmox02:~# /etc/init.d/drbd stop
root@proxmox01:~# /etc/init.d/drbd start
root@proxmox02:~# /etc/init.d/drbd start
root@proxmox01:~# cat /proc/drbd
version: 8.3.13 (api:88/proto:86-96)
GIT-hash: 83ca112086600faacab2f157bc5a9324f7bd7f77 build by root@sighted, 2012-10-09 12:47:51
0: cs:SyncSource ro:Primary/Primary ds:UpToDate/Inconsistent C r-----
ns:137736 nr:0 dw:0 dr:146128 al:0 bm:7 lo:1 pe:81 ua:64 ap:0 ep:1 wo:b oos:31326752
[>....................] sync'ed: 0.5% (30592/30716)M
finish: 0:20:27 speed: 25,496 (25,496) K/sec
root@proxmox01:~# cat /proc/drbd
version: 8.3.13 (api:88/proto:86-96)
GIT-hash: 83ca112086600faacab2f157bc5a9324f7bd7f77 build by root@sighted, 2012-10-09 12:47:51
0: cs:Connected ro:Primary/Primary ds:UpToDate/UpToDate C r-----
ns:0 nr:31454276 dw:31454240 dr:64 al:0 bm:1920 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:0
root@proxmox01:~# vi /etc/lvm/lvm.conf
# By default we accept every block device:
filter = [ "r|/dev/sdb1|", "r|/dev/disk/|", "r|/dev/block/|", "a/.*/" ]
root@proxmox01:~# pvcreate /dev/drbd0
Writing physical volume data to disk "/dev/drbd0"
Physical volume "/dev/drbd0" successfully created
root@proxmox01:~# vgcreate vg_drbd /dev/drbd0
Volume group "vg_drbd" successfully created
Tidak ada komentar:
Posting Komentar