KVM虚拟化开源高可用方案sheepdog
2012-09-03 15:06:58 来源:WEB开发网核心提示:重新挂载sheepdog存储位置格式化sheepdog集群collie cluster format --copies=3copies是镜像冗余数也可以后台格式化collie cluster format -b farm --copies=3重用操作1) 查看集群状态collie node list[root@dell
重新挂载sheepdog存储位置
格式化sheepdog集群
collie cluster format --copies=3
copies是镜像冗余数
也可以后台格式化
collie cluster format -b farm --copies=3
重用操作
1) 查看集群状态
collie node list
[root@dell3 ~]# collie node list
M Id Host:Port V-Nodes Zone
- 0 10.10.11.100:7000 64 2030766602
- 1 10.10.11.101:7000 64 -720696822
- 2 10.10.11.102:7000 64 -167048694
- 3 10.10.11.103:7000 64 -133494262
2) 产生一个镜像
qemu-img create sheepdog:Alice 256G
3) 将一个现有的镜像转化到sheepdog中
qemu-img convert -t writethrough ~/amd64.raw sheepdog:Bob
4) 查看镜像
collie vdi list
5) 虚拟机启动
qemu-system-x86_64 sheepdog:Alice
6) 修改缓存方式
qemu-system-x86_64 -drive file=sheepdog:Alice,cache=writeback
7) 创建虚拟机快照
qemu-img snapshot -c name sheepdog:Alice
8) 快照查看
collie vdi list
name id size used shared creation time object id
--------------------------------------------------------------------
Bob 0 2.0 GB 1.6 GB 0.0 MB 2010-03-23 16:16 80000
Alice 0 256 GB 0.0 MB 0.0 MB 2010-03-23 16:21 c0000
Alice 1 256 GB 0.0 MB 0.0 MB 2010-03-23 16:16 40000
9) 从指定的快照启动
qemu-system-x86_64 sheepdog:Alice:1
10) 从快照克隆
qemu-img create -b sheepdog:Alice:1 sheepdog:Charlie
collie vdi list
name id size used shared creation time object id
--------------------------------------------------------------------
Bob 0 2.0 GB 1.6 GB 0.0 MB 2010-03-23 16:16 80000
Alice 0 256 GB 0.0 MB 0.0 MB 2010-03-23 16:21 c0000
s Alice 1 256 GB 0.0 MB 0.0 MB 2010-03-23 16:16 40000
Charlie 0 256 GB 0.0 MB 0.0 MB 2010-03-23 16:23 100000
11) 停止集群
collie cluster shutdown
12) libvirt支持
<disk type='network'>
<driver name="qemu" type="raw" io="threads" ioeventfd="on" event_idx="off"/>
<source protocol="sheepdog" name="image_name">
<host name="hostname" port="7000"/>
</source>
<target dev="hdb" bus="ide"/>
<boot order='1'/>
<transient/>
<address type='drive' controller='0' bus='1' unit='0'/>
</disk>
13) 启动一个虚拟机,vnc端口是5902,网卡是e1000
qemu-system-x86_64 --enable-kvm -m 2048 -drive file=sheepdog:w2k3 -drive file=sheepdog:w2k3d -net nic,model=e1000 -vnc :2
格式化sheepdog集群
collie cluster format --copies=3
copies是镜像冗余数
也可以后台格式化
collie cluster format -b farm --copies=3
重用操作
1) 查看集群状态
collie node list
[root@dell3 ~]# collie node list
M Id Host:Port V-Nodes Zone
- 0 10.10.11.100:7000 64 2030766602
- 1 10.10.11.101:7000 64 -720696822
- 2 10.10.11.102:7000 64 -167048694
- 3 10.10.11.103:7000 64 -133494262
2) 产生一个镜像
qemu-img create sheepdog:Alice 256G
3) 将一个现有的镜像转化到sheepdog中
qemu-img convert -t writethrough ~/amd64.raw sheepdog:Bob
4) 查看镜像
collie vdi list
5) 虚拟机启动
qemu-system-x86_64 sheepdog:Alice
6) 修改缓存方式
qemu-system-x86_64 -drive file=sheepdog:Alice,cache=writeback
7) 创建虚拟机快照
qemu-img snapshot -c name sheepdog:Alice
8) 快照查看
collie vdi list
name id size used shared creation time object id
--------------------------------------------------------------------
Bob 0 2.0 GB 1.6 GB 0.0 MB 2010-03-23 16:16 80000
Alice 0 256 GB 0.0 MB 0.0 MB 2010-03-23 16:21 c0000
Alice 1 256 GB 0.0 MB 0.0 MB 2010-03-23 16:16 40000
9) 从指定的快照启动
qemu-system-x86_64 sheepdog:Alice:1
10) 从快照克隆
qemu-img create -b sheepdog:Alice:1 sheepdog:Charlie
collie vdi list
name id size used shared creation time object id
--------------------------------------------------------------------
Bob 0 2.0 GB 1.6 GB 0.0 MB 2010-03-23 16:16 80000
Alice 0 256 GB 0.0 MB 0.0 MB 2010-03-23 16:21 c0000
s Alice 1 256 GB 0.0 MB 0.0 MB 2010-03-23 16:16 40000
Charlie 0 256 GB 0.0 MB 0.0 MB 2010-03-23 16:23 100000
11) 停止集群
collie cluster shutdown
12) libvirt支持
<disk type='network'>
<driver name="qemu" type="raw" io="threads" ioeventfd="on" event_idx="off"/>
<source protocol="sheepdog" name="image_name">
<host name="hostname" port="7000"/>
</source>
<target dev="hdb" bus="ide"/>
<boot order='1'/>
<transient/>
<address type='drive' controller='0' bus='1' unit='0'/>
</disk>
13) 启动一个虚拟机,vnc端口是5902,网卡是e1000
qemu-system-x86_64 --enable-kvm -m 2048 -drive file=sheepdog:w2k3 -drive file=sheepdog:w2k3d -net nic,model=e1000 -vnc :2
- ››KVM虚拟化开源高可用方案sheepdog
- ››KVM虚拟化linux系统模版制作步骤
- ››开源平台Meego和Android之间的对弈
- ››开源的Kingthy.Mail邮件组件库
- ››开源飞信Openfetion最新发布v1.8版
- ››开源重复数据删除技术纵览
- ››开源的 iPhone 杀手终于到来
- ››开源有优势:Android首超Windows Mobile
- ››开源只不过是个幌子 揭示 Android 的真面目
- ››开源面向对象数据库 db4o 之旅,第 1 部分: 初识 ...
- ››开源面向对象数据库 db4o 之旅,第 2 部分: db4o ...
- ››开源面向对象数据库 db4o 之旅,第 3 部分: 深入d...
更多精彩
赞助商链接