Centos6 install sheepdog VM distributed storage

Source: Internet
Author: User
Centos6 sheepdog virtual machine distributed storage preface sheepdog is a virtual machine distributed file system specially designed for qemu. it adopts a completely symmetric structure and has no central node for metadata service, this eliminates the risk of SPOF. based on the latest version 0.7.0, This article introduces sheep... centos6 sheepdog virtual machine distributed storage preface sheepdog is a virtual machine distributed file system specially designed for qemu. it adopts a completely symmetric structure and has no central node for metadata service, this eliminates the risk of SPOF. this article describes how to install and use sheepdog based on the latest version 0.7.0. sheepdog backend cluster management is used to manage member relationships and message communication between nodes. currently, four modes can be used: local driver (for standalone testing), corosync (default), zookeeper and Accord. there are two models:-fully symmetric (Corosync dependency, run in Sheepdog's address space) ● disadvantages: small scale [<100] ● advantages: no need to configure-separate control cluster (dependent on Accord * or Zookeeper, run in independent address space) ● disadvantage: need to configure control cluster ● advantages: large scale [> 1000] the default Corosync mode is used in this Test. preparations before installation: First set echo "* soft nofile 65533">/etc/security/limits. confecho "* hard nofile 65533">/etc/security/limits. confyum install-y make automake autoconf gcc nss-devel wget git glib2 install epel Source rpm-ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm Install sheepdog1 ). the built-in version of corosync centos6 is outdated. we need to install the new yum remove corosync corosynclib-devel-ygit clone git: // github.com/corosync/corosync.gitcd corosyncgit checkout-B flatiron origin/flatiron. /autogen. sh. /configure -- enable-nssmake install 2 ). install sheepdog cd/home2/installgit clone git: // github.com/collie/sheepdog.gitcd sheepdog. /autogen. sh. /configuremake install configure corosync and sheepdogcd/etc/corosynccp corosync. conf. example corosync. conf edit corosync. conf modify bindnetaddr to your network segment, such as 192.168.1.0 # Please read the corosync. conf 5 manual pagecompatibility: whitetanktotem {version: 2 secauth: off threads: 0 # Note, feature is only needed if you're # having problems with corocorosync crashing under # heavy sheepdog traffic. this crash is due to # delayed/resent/misordered multicast packets. # fail_recv_const: 5000 interface {ringnumber: 0 bindnetaddr: 192.168.1.0 mcastaddr: 226.94.1.1 mcastport: 5405} logging {fileline: off to_stderr: no to_logfile: yes to_syslog: yes # the pathname of the log file logfile:/var/log/cluster/corosync. log debug: off timestamp: on logger_subsys {subsys: AMF debug: off} amf {mode: disabled} start the service/etc/init. d/corosync start # or start through the command (/var/lib/sheepdog is the data directory used by sheepdog, you can change it to another) # sheep/var/lib/sheepdog requires that the partitions in the/var/lib/sheepdog directory support xattr mount-o remount, user_xattr/the preceding operations must be performed on each sheepdog node to format the sheepdog cluster and set three copies, you only need to execute collie cluster format -- copies = 3 on one of the nodes to view the node status collie node list. now the sheepdog cluster has been configured, and qemu-img is used to create the sheepdog disk image because the qemu1.2 version of centos6 sheepdog is not supported, here we will compile the new version of qemu. install the dependent package yum install zlib-devel glib2-devel-y compile qemu wget http://wiki.qemu-project.org/download/qemu-1.5.2.tar.bz2 Tar jxvf qemu-1.5.2.tar.bz2 cd qemu-1.5.2. /configure make; make install create disk/usr/local/bin/qemu-img create-f qcow2 sheepdog: MyFirstDisk 10g if sheepdog runs on another machine, IP address and port/usr/local/bin/qemu-img create-f qcow2 sheepdog: 192.168.1.100: 7000: myFirstDisk 10 GB list the image collie vdi list in sheepdog to convert the existing image to qemu-img convert in sheepdog. /mysystem. raw sheepdog: mysystem boot virtual machine qemu-system-x86_64 -- enable-kvm-m 1024-drive file = sheepdog: MyFirstDisk, cache = writeback-vnc: 15-cdrom/data/CentOS-6.4-i386-minimal.iso other usage 1) create a snapshot qemu-img snapshot-c name sheepdog: after MyFirstDisk snapshot is created, view the image list collie vdi list name id size used shared creation time object id limit Bob 0 2.0 GB 1.6 GB 0.0 MB 2010-03-23 80000 MyFirstDisk 0 256 GB 0.0 MB 0.0 MB 2010-03-23 c0000s MyFirstDisk 1 256 GB 0.0 MB 0.0 MB 2010-03-23 40000 start the virtual machine qemu-system-x86_64 sheepdog with a snapshot: myFirstDisk: 12) disk clone qemu-img create-B sheepdog: MyFirstDisk sheepdog: Disk23) close sheepdog cluster collie cluster shutdown this command will close processes on all nodes 4) use fuse to mount sheepdog. first create a volume named my_volume echo my_volume>/var/lib/sheepdog/vdi/mount and format it as ext4 and mount mkfs. ext4/var/lib/sheepdog/volume/my_volumemount-o loop/var/lib/sheepdog/volume/my_volume/mnt when the connected sheepdog machine goes down, we can switch to another sheepdog online. echo ip: port>/var/lib/sheepdog/config/sheep_info
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.