KVM virtualization open-source high availability solution (iii) glusterfs

Source: Internet
Author: User
Tags node server glusterfs gluster

 

 

 

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/0351246148-0.jpg "border =" 0 "alt =" "/>

Note:

Purpose:

1. The cluster is designed with a virtual machine capacity of 70 to 300 units. It occupies 1 Cabinet and is composed of 1U servers, including 6 storage servers, GB x 8 storage servers, and 10 node servers;

2. the VM can be migrated between the host machines in the KVM cluster;

Glusterfs cluster architecture:

1. The storage server and the node server are composed. The storage server can be elastically increased or reduced by using the hash algorithm and achieves redundancy;

2. each server requires at least four NICs. If the server only has two NICs on board, you need to add one dual-port Nic to bind the four NICs, this improves the network bandwidth;

3. Each host in the KVM cluster acts as the glusterfs client, mounts the file system of the glusterfs cluster, and places the Virtual Machine on it;

Build a glusterfs cluster:

Storage node Construction

1. Install related components

Yum-y install wget fuse-libs

2. Download, install, and test

Yum-y install wget fuse-libs

Wget http://download.gluster.org/pub/gluster/glusterfs/LATEST/CentOS/glusterfs-3.3.0-1.el6.x86_64.rpm

Wget http://download.gluster.org/pub/gluster/glusterfs/LATEST/CentOS/glusterfs-debuginfo-3.3.0-1.el6.x86_64.rpm

Wget http://download.gluster.org/pub/gluster/glusterfs/LATEST/CentOS/glusterfs-devel-3.3.0-1.el6.x86_64.rpm

Wget http://download.gluster.org/pub/gluster/glusterfs/LATEST/CentOS/glusterfs-fuse-3.3.0-1.el6.x86_64.rpm

Wget http://download.gluster.org/pub/gluster/glusterfs/LATEST/CentOS/glusterfs-geo-replication-3.3.0-1.el6.x86_64.rpm

Wget http://download.gluster.org/pub/gluster/glusterfs/LATEST/CentOS/glusterfs-rdma-3.3.0-1.el6.x86_64.rpm

Wget http://download.gluster.org/pub/gluster/glusterfs/LATEST/CentOS/glusterfs-server-3.3.0-1.el6.x86_64.rpm

Yum install glusterfs-*-y

/Usr/sbin/glusterfs-V

3. Start the glusterd Service

By default, the service is automatically started after installation. After installation, the service is a standard redhat service, which can be started, stopped, and restarted.

/Etc/init. d/glusterd start

/Etc/init. d/glusterd stop

/Etc/init. d/glusterd restart

Chkconfig glusterd on

4. Add servers to the storage pool

Perform the probe operation on the first Server

Gluster peer probe server1

Gluster peer probe server2

Gluster peer probe server3

Gluster peer probe server4

Gluster peer probe server5

Check cluster status

[Root @ hp246 ~] # Gluster peer status

Number of Peers: 4

Hostname: server1

Uuid: 59cd74a9-a555-4560-b98e-a7eaf2058926

State: Peer in Cluster (Connected)

Hostname: server2

Uuid: 278d94f8-cf55-42cc-a4ad-9f84295c140b

State: Peer in Cluster (Connected)

Hostname: server3

Uuid: 7fd840a2-53f5-4540-b455-3e5e7eded813

State: Peer in Cluster (Connected)

Hostname: server4

Uuid: 4bfd8649-7f74-4a9f-9f04-4407cc80a1c3

State: Peer in Cluster (Connected)

...

Run the following command to remove the cluster:

Gluster peer detach server

5. Create a cluster volume

1) creating a distributed volume is only connecting the volumes and cross-zone volumes)

Gluster volume create test-volume server1:/exp1 server2:/exp2 server3:/exp3 server4 :/

Exp4

2) create a copy volume (similar to raid1)

Gluster volume create test-volume replica 2 transport tcp server1:/exp1 server2:/exp2

3) create a strip volume (similar to raid0)

Gluster volume create test-volume stripe 2 transport tcp server1:/exp1 server2:/exp2

4) create a distributed strip volume (similar to raid0 + 0)

Gluster volume create test-volume stripe 4 transport tcp server1:/exp1 server2:/exp2

Server3:/exp3 server4:/exp4 server5:/exp5 server6:/exp6 server7:/exp7 server8:/exp8

5) create a duplicate strip volume (similar to raid1 and then cross-zone)

Gluster volume create test-volume replica 2 transport tcp server1:/exp1 server2:/exp2

Server3:/exp3 server4:/exp4

6) create a branch copy strip volume (similar to raid10)

Gluster volume create test-volume stripe 2 replica 2 transport tcp server1:/exp1

Server2:/exp2 server3:/exp3 server4:/exp4 server5:/exp5 server6:/exp6 server7:/exp7

Server8:/exp8

7) create a striped copy volume (similar to raid01)

Gluster volume create test-volume stripe 2 replica 2 transport tcp server1:/exp1

Server2:/exp2 server3:/exp3 server4:/exp4

View volume information

Gluster volume info

Start volume

Gluster volume start test-volume

6. Client mounting

Modprobe fuse

Verify that the FUSE module is loaded:

# Dmesg | grep-I fuse

Fuse init (API version 7.13)

Yum-y install wget fuse-libs

Wget http://download.gluster.org/pub/gluster/glusterfs/LATEST/CentOS/glusterfs-3.3.0-1.el6.x86_64.rpm

Wget http://download.gluster.org/pub/gluster/glusterfs/LATEST/CentOS/glusterfs-debuginfo-3.3.0-1.el6.x86_64.rpm

Wget http://download.gluster.org/pub/gluster/glusterfs/LATEST/CentOS/glusterfs-devel-3.3.0-1.el6.x86_64.rpm

Wget http://download.gluster.org/pub/gluster/glusterfs/LATEST/CentOS/glusterfs-fuse-3.3.0-1.el6.x86_64.rpm

Wget http://download.gluster.org/pub/gluster/glusterfs/LATEST/CentOS/glusterfs-geo-replication-3.3.0-1.el6.x86_64.rpm

Wget http://download.gluster.org/pub/gluster/glusterfs/LATEST/CentOS/glusterfs-rdma-3.3.0-1.el6.x86_64.rpm

Wget http://download.gluster.org/pub/gluster/glusterfs/LATEST/CentOS/glusterfs-server-3.3.0-1.el6.x86_64.rpm

Yum install glusterfs-*-y

Mount a volume

Mount-t glusterfs server1:/test-volume/mnt/glusterfs

Mount-t glusterfs hp246:/test-volume/gfs

Automatic mounting

Vim fstab

Server1:/test-volume/mnt/glusterfs defaults, _ netdev 0 0

Virtual Machine creation: omitted

This article is from the "xiaoli110 blog". For more information, contact the author!

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.