安装环境
Vmware esxi 5.1
VM*3(sheepdog-node1~sheepdog-node3)
Centos 6.4 x86_64
安装步骤
1.更新epel-release
#rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
2.安装corosync
#yum install nss-devel -y
#git clone git://github.com/corosync/corosync.git
#cd corosync
#git checkout -b flatiron origin/flatiron
#./autogen.sh
#./configure --enable-nss
#make install
2.1 配置corosync
修改corosync.conf文件中bindnetaddr地址为sheepdog cluster所处的网段
#vi /etc/corosync/corosync.conf
# Please read the corosync.conf.5 manual page
compatibility: whitetank
totem {
version: 2
# secauth: Enable mutual node authentication. If you choose to
# enable this ("on"), then do remember to create a shared
# secret with "corosync-keygen".
secauth: off
threads: 0
# interface: define at least one interface to communicate
# over. If you define more than one interface stanza, you must
# also set rrp_mode.
interface {
# Rings must be consecutively numbered, starting at 0.
ringnumber: 0
# This is normally the *network* address of the
# interface to bind to. This ensures that you can use
# identical instances of this configuration file
# across all your cluster nodes, without having to
# modify this option.
bindnetaddr: 10.10.200.0
# However, if you have multiple physical network
# interfaces configured for the same subnet, then the
# network address alone is not sufficient to identify
# the interface Corosync should bind to. In that case,
# configure the *host* address of the interface
# instead:
# bindnetaddr: 192.168.1.1
# When selecting a multicast address, consider RFC
# 2365 (which, among other things, specifies that
# 239.255.x.x addresses are left to the discretion of
# the network administrator). Do not reuse multicast
# addresses across multiple Corosync clusters sharing
# the same network.
mcastaddr: 239.255.1.1
# Corosync uses the port you specify here for UDP
# messaging, and also the immediately preceding
# port. Thus if you set this to 5405, Corosync sends
# messages over UDP ports 5405 and 5404.
mcastport: 5405
# Time-to-live for cluster communication packets. The
# number of hops (routers) that this ring will allow
# itself to pass. Note that multicast routing must be
# specifically enabled on most network routers.
ttl: 1
}
}
logging {
# Log the source file and line where messages are being
# generated. When in doubt, leave off. Potentially useful for
# debugging.
fileline: off
启动corosync
#service corosync start
#chkconfig corosync on
3.安装qemu
#git clone git://git.sv.gnu.org/qemu.git
#cd qemu
#./configure
#make install
4.安装sheepdog
#yum install userspace-rcu-devel -y
#git clone git://github.com/collie/sheepdog.git
#cd sheepdog
#./autogen.sh
#./configure
#make install
5.启动sheepdog
sheepdog存储所使用的目录为/var/lib/sheepdog,可添加磁盘挂载至该目录下面,并且在启动sheepdog前,关闭selinux及iptables。
启动sheepdog
#service sheepdog start
#chkconfig sheepdog on
初始化sheepdog cluster,设置存储副本数为3
#collie cluster format --copies=3
查看sheepdog node状态
[root@sheepdog-node1 sheepdog]# collie node list
Id Host:Port V-Nodes Zone
0 10.10.200.222:7000 64 3737651722
1 10.10.200.223:7000 64 3754428938
2 10.10.200.224:7000 64 3771206154
以上就完成了sheepdog的初始化安装