1, sudo yum install corosynclib-devel
1, yum update kernel
2 , wget qemu , libvirt
1, http://libvirt.org/sources/libvirt-1.1.4.tar.gz
2, http://wiki.qemu-project.org/download/qemu-1.6.1.tar.bz2
3, ftp://195.220.108.108/linux/opensuse/factory/repo/oss/suse/x86_64/liburcu2-0.8.0-3.3.x86_64.rpm
4, ftp://195.220.108.108/linux/opensuse/factory/repo/oss/suse/x86_64/liburcu-devel-0.8.0-3.3.x86_64.rpm
3, install qemu
$ cd /qemu-16.1
$ ./configure
$ sudo make; make install
$ cd ..
4, install libvirt
1, yum -y install device-mapper-devel libpciaccess-devel libnl-devel
2, ./configure ;make ;make install
5, git clone git://github.com/collie/sheepdog.git
$ cd sheepdog
$ ./autogen.sh
$ ./configure
$ sudo make install
$ cd ..
6, start service corosync  ... ...
1, cd /etc/corosync
2, cp corosync.conf.example corosync.conf
3, vim corosync.conf
# Please read the corosync.conf.5 manual page
compatibility: whitetank
totem {
version: 2
secauth: off
threads: 0
interface {
ringnumber: 0
bindnetaddr: 192.168.19.111 # my ip
mcastaddr: 226.94.1.1
mcastport: 5405
ttl: 1
}
}
logging {
fileline: off
to_stderr: no
to_logfile: yes
to_syslog: yes
logfile: /var/log/cluster/corosync.log
debug: off
timestamp: on
logger_subsys {
subsys: AMF
debug: off
}
}
amf {
mode: disabled
}
4, /etc/init.d/corosync restart
7, start sheepdog
1, sheepdog /var/lib/sheepdog or /etc/init.d/sheepdog restart
8, check node list
[root@localhost corosync]# collie node list
Id   Host:Port         V-Nodes       Zone
0   192.168.19.111:7000  128 1863559360
[root@localhost corosync]#
9, check cluster info
[root@localhost corosync]# collie cluster info
Cluster status: running, auto-recovery enabled
Cluster created at Wed Nov 20 04:57:54 2013
Epoch Time           Version
2013-11-20 11:31:59      5 [192.168.19.111:7000]
2013-11-20 11:27:40      4 []
2013-11-20 05:02:19      3 [192.168.19.111:7000]
2013-11-20 05:00:59      2 []
2013-11-20 04:57:54      1 [192.168.19.111:7000]
10, Add p_w_picpath to sheepdog storage
1, qemu-img create -f raw sheepdog:vm0000001 5G
11, add boot p_w_picpath to sheepdog storage
1, qemu-img convert -t directsync /var/lib/sheepdog/root.img sheepdog:redhat
12, list p_w_picpaths
[root@localhost corosync]# collie vdi list
Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
redhat       0   10 GB  3.2 GB  0.0 MB 2013-11-20 11:39   307f49     3
vm0000001     0  5.0 GB  0.0 MB  0.0 MB 2013-11-20 11:38   6a4207     3
vm0000002     0  5.0 GB  0.0 MB  0.0 MB 2013-11-20 11:53   6a43ba     3
data1        0  0.2 MB  4.0 MB  0.0 MB 2013-11-20 11:45   77165c     3
data2        0  5.0 GB  0.0 MB  0.0 MB 2013-11-20 11:47   771b75     3
[root@localhost corosync]#
13, from boot p_w_picpath to sheepdog storage
1, libvirt xml configure

testvm
1048576

hvm









14, full xml configure

testvm
f2a772c0-972b-4662-a143-d28be1f0a4c6
1048576
1048576
1

/machine


hvm



destroy
restart
destroy

/usr/local/bin/qemu-system-x86_64