sheepdog+zookeeper儲存叢集搭建:4個節點安裝sheepdog(其中有3個為zookeeper節點)
1、首先在4個儲存節點中的3個節點上安裝3節點zookeeper,詳見 http://blog.csdn.net/u010855924/article/details/52847308
2、第四個儲存節點僅僅需要rpm -ivh zookeeper-3.4.6-redhat6.4.x86_64.rpm即可,不需要配置和啟動,原因在於安裝sheepdog的時候./configure需要指定sheepdog的zookeeper,否則執行./configure --enable-zookeeper --disable-corosync不通過
3、開始編譯安裝sheepdog
3.1 首先安裝以下安裝包,否則編譯sheepdog時不通過
yum install automake libtool -y //./autogen.sh時需要這兩個工具,否則不能生成configure檔案
rpm -ivhuserspace-rcu-0.7.9-1.el7.x86_64.rpm //以下三個安裝包在make時需要,否則make不通過
rpm -ivhuserspace-rcu-devel-0.7.9-1.el7.x86_64.rpm
rpm -ivhyasm-1.2.0-4.el7.x86_64.rpm
3.2 進入sheepdog目錄,開始安裝
cd sheepdog/
cd script/
chmod u+x gen_bash_completion.pl //下載的sheepdog目錄裡該檔案需要有執行許可權
cd ../
chmod u+x autogen.sh //下載的sheepdog目錄裡該檔案需要有執行許可權
./autogen.sh
./configure --enable-zookeeper --disable-corosync
make
make install
安裝完畢
4、四個儲存節點上格式化並掛載兩塊磁碟
mkfs.ext4 /dev/sdb
mkfs.ext4 /dev/sdc
mount -t ext4 /dev/sdb /shd/obj0
mount -t ext4 /dev/sdc /shd/obj1 // /shd/obj0和/shd/obj1目錄手動建立
5、四臺儲存節點啟動sheepdog執行:sheep /shd/obj0 /shd/obj1 -c zookeeper:192.168.232.100:2181,192.168.232.101:2181,192.168.232.102:2181,192.168.232.103:2181
6、若啟動成功,在4臺中的其中一臺機器執行dog node list可檢視叢集節點資訊如下:
[[email protected] ~]# dog node list
Id Host:Port V-Nodes Zone
0 192.168.232.100:7000128 1692969152
1 192.168.232.101:7000128 1709746368
2 192.168.232.102:7000128 1726523584
3 192.168.232.103:7000128 1743300800