Waiting for your How-to tutorial作者: candenn 時間: 2012-6-16 00:27
0 – 基本設定:
Download Openfiler ver. 2.99
用 VirtualBox 設定兩台 VM,每台VM需要兩張 LAN Card。VM設定如下:
CPU – 1 Core
RAM – 512MB
Hard Disk 1 (sda)– SATA 12GB
Hard Disk 2 (sdb)– SATA 32GB
LAN 1 (eth0)– Bridging在 Host machine 的網卡上。
LAN 2 (eth1)– 連接 Virtualbox Host-Only Adapter 上。
安裝Openfiler 在各台VM上。請安裝在 sda 上。留下sdb 一會兒安裝好後再人手設定為 cluster 的 data partition。
修改在 san2上的host file
root@san1 ~# vi /etc/hosts
加入:
192.168.56.1 san1.host.local
1.2 – 設定 SSH Key,使兩台機器經 scp交換檔案不需要輸入密碼,方便一些:
在 san1 上:
root@san1 ~# ssh-keygen -t dsa
Generating public/private dsa key pair. Enter file in which to save the key (/root/.ssh/id_dsa): Created directory ‘/root/.ssh’. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /root/.ssh/id_dsa. Your public key has been saved in /root/.ssh/id_dsa.pub. The key fingerprint is:
在 san2 上作同樣的動作:
root@san2 ~# ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/root/.ssh/id_dsa):
Created directory ‘/root/.ssh’.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_dsa.
Your public key has been saved in /root/.ssh/id_dsa.pub.
The key fingerprint is:
root@san1 ~# fdisk /dev/sda Disk /dev/sda: 12.9 GB, 12884901888 bytes
255 heads, 63 sectors/track, 1566 cylinders, total 25165824 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000c6d56
Device Boot Start End Blocks Id System
/dev/sda1 * 63 610469 305203+ 83 Linux
/dev/sda2 610470 17382329 8385930 83 Linux
/dev/sda3 17382330 19486844 1052257+ 82 Linux swap / Solaris
/dev/sda4 19486845 25165823 2839489+ 83 Linux
root@san1 ~# fdisk /dev/sdb Disk /dev/sdb: 34.4 GB, 34359738368 bytes 86 heads, 4 sectors/track, 195083 cylinders, total 67108864 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0×00000000
Device Boot Start End Blocks Id System /dev/sdb1 2048 67108863 33553408 83 Linux
root@san2 ~# fdisk /dev/sda Disk /dev/sda: 12.9 GB, 12884901888 bytes
255 heads, 63 sectors/track, 1566 cylinders, total 25165824 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000c6d56
Device Boot Start End Blocks Id System
/dev/sda1 * 63 610469 305203+ 83 Linux
/dev/sda2 610470 17382329 8385930 83 Linux
/dev/sda3 17382330 19486844 1052257+ 82 Linux swap / Solaris
/dev/sda4 19486845 25165823 2839489+ 83 Linux
root@san2 ~# fdisk /dev/sdb Disk /dev/sdb: 34.4 GB, 34359738368 bytes
86 heads, 4 sectors/track, 195083 cylinders, total 67108864 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0×00000000
Device Boot Start End Blocks Id System
/dev/sdb1 2048 67108863 33553408 83 Linux
在 san1 上設定 /etc/drbd.conf。如下:
# You can find an example in /usr/share/doc/drbd.../drbd.conf.example
crm_mon[3602]: 2012/06/01_19:32:07 ERROR: unpack_resources: Resource start-up disabled since no STONITH resources have been defined crm_mon[3602]: 2012/06/01_19:32:07 ERROR: unpack_resources: Either configure some or disable STONITH with the stonith-enabled option crm_mon[3602]: 2012/06/01_19:32:07 ERROR: unpack_resources: NOTE: Clusters with shared data need STONITH to ensure data integrity ============ Stack: openais Current DC: san1.host.local – partition with quorum Version: 1.1.2-c6b59218ee949eebff30e837ff6f3824ed0ab86b 2 Nodes configured, 2 expected votes 0 Resources configured. ============