Glusterfs First Experience

Source: Internet
Author: User

Environment:

Centos 6.0-x86_64

The cluster uses three servers to form the Glusterfs cluster, where two servers provide NFS and rsync services for backup

Each server 2 LAN eth0 corresponding to the intranet, eth1 corresponding to the external network,

Glusterfs Introduction:

Glusterfs is the core of the Scale-out storage solution Gluster, an open source Distributed file system with strong scale-out capability to support petabytes of storage capacity and handle thousands of of clients through scaling. The Glusterfs aggregates the physically distributed storage resources with TCP/IP or InfiniBand RDMA networks, using a single global namespace to manage the data. The Glusterfs is based on a stackable user space design that provides superior performance for a variety of data loads. Key features of Glusterfs include: high scalability and high performance, high availability, global unified namespaces, elastic hashing algorithms, elastic volume management, standards-based protocols, technical implementation features include: Full software implementation, complete storage operating system stack, user space implementation, modular stack-style architecture, Raw data format storage, metadata-free service design.

Glusterfs commonly used volume types are as follows:

Hash Volume: Similar to composing multiple file systems into a volume, the storage file is conducted in polling mode.

Copy Volume: Automatically creates a copy of the data in the volume.

Striped volumes: Similar to RAID0, data is stored on multiple member servers in the cluster.

Hash + Copy Volume: First create a hash and then create a replicated volume with a hash volume.

Installation method:

Glusterfs installation is simple, you can choose to compile the installation or RPM package installation, here in order to facilitate the selection of RPM package installed

  1. Install the dependent packages first (using 163 sources):

    Yum-y Install rpcbind Libaio lvm2-devel OpenSSL libibverbs librdmacm

  2. Installing Glusterfs

    glusterfs-3.4.2-1.el6.x86_64.rpm

    glusterfs-cli-3.4.2-1.el6.x86_64.rpm

    glusterfs-fuse-3.4.2-1.el6.x86_64.rpm

    glusterfs-rdma-3.4.2-1.el6.x86_64.rpm
    glusterfs-api-3.4.2-1.el6.x86_64.rpm

    glusterfs-debuginfo-3.4.2-1.el6.x86_64.rpm

    glusterfs-geo-replication-3.4.2-1.el6.x86_64.rpm

    glusterfs-server-3.4.2-1.el6.x86_64.rpm
    glusterfs-api-devel-3.4.2-1.el6.x86_64.rpm

    glusterfs-devel-3.4.2-1.el6.x86_64.rpm

    glusterfs-libs-3.4.2-1.el6.x86_64.rpm

    These packages are downloaded on the official website, depending on the package after installation can be directly used RPM-IVH * installation, after the installation of the service boot Chkconfig glusterd on

  3. Here's a demonstration of creating a cluster, creating a volume, using System NFS access, using native NFS access:

    To create a cluster:

Gluster peer probe Other server addresses (you don't need to add them) to add cluster members

[Email protected] 3.4]# Gluster peer probe 192.168.1.2
Peer Probe:success:host 192.168.1.2 Port 24007 already in peer list
[Email protected] 3.4]# Gluster peer probe 192.168.1.3
Peer Probe:success:host 192.168.1.3 Port 24007 already in peer list

Gluster Peer Status View cluster state

[Email protected] 3.4]# Gluster peer status
Number of Peers:2

hostname:192.168.1.2
port:24007
uuid:35eb06f8-24da-43d9-96e5-75c6a203f858
State:peer in Cluster (Connected)

hostname:192.168.1.3
port:24007
uuid:efe5836a-555e-4c24-ba76-4b3602d0f15c
State:peer in Cluster (Connected)

To create a volume:

First look at the common commands for volume management:

Create Volume Help

Gluster Volume Create Help

To view volume information:

Gluster Volume Info

To view volume status:

Gluster Volume status

To create a volume:

Volume Create <NEW-VOLNAME> [stripe <count>] [replica <count>] [device VG] [transport <TCP|RDMA|TCP , Rdma>] <NEW-BRICK> ... [Force]

Boot Volume:

Gluster Volume start VolumeName

To stop a volume:

Gluster Volume Stop VolumeName

Here are some examples:

Gluster Volume Create Jerryafr replica 2 192.168.1.1:/glust/er/afr 192.168.1.2:/gluster/abr

The purpose of this command is to create a backup volume named Jerryafr using the/GLUSTER/AFR on the 1.1 and the/gluster/abr on 1.2, and note that if these two brick are on your OS parttion then you need to add force to the back. Otherwise it will be an error

Boot Volume:

Gluster Volume start Jerryafr

After starting up we can test the mount:

Mount-t Glusterfs192.168.1.1:/jerryafr/media

This method is based on the fuse implementation, of course, Glusterfs will not only play this way, but also can support NFS,NFS and two native NFS and system NFS.

Using native NFS mounts: mount-t nfs-o vers=3 192.168.1.1:/jerryafr/media

Use this method to ensure that the server Rpcbind to open and that the system NFS does not start

Using System NFS Mounts:

First mount the volume to a directory using the Glusterfs method

Mount-t Glusterfs 192.168.1.1:/jerryafr/media

Then modify the/etc/exports file

Example:/media * (rw,fsid=1235)

Then stop the native Nfs:gluster volume set Jerryafr nfs.disable on

Finally, you can start the System NFS service

This article is from the "Advanced Road---Jerry" blog, please be sure to keep this source http://jerry51886.blog.51cto.com/6021523/1598476

Glusterfs First Experience

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.