Centos7 build GlusterFS

Source: Internet
Author: User
Tags docker registry glusterfs

Centos7 build GlusterFS

Lab requirements:

· Four machines are installed with GlusterFS to form a cluster

· The client stores docker registry in the file system

· The hard disk space of the four nodes is not integrated into one hard disk space. Each node must be stored in one copy to ensure data security.

Environment Planning


Node1: Host Name: glusterfs1

Node2: Host Name: glusterfs2

Node3: Host Name: glusterfs3

Node4: Host Name: glusterfs4

Client Host Name: master3


· All Hosts close the firewall and SElinux

· Modify the hosts file to parse each other



1. Install the GlusrerFS package on the glusterfs {1-4} Node

#wget-P/etc/yum.repos.d #yuminstall-yglusterfsglusterfs-serverglusterfs-fuse #servicegluterdstart #chkconfiggluterdon

2. Configure the entire GlusterFS cluster on the glusterfs1 node and add each node to the cluster.

[root@glusterfs1~]#glusterpeerprobeglusterfs1 1peerprobe:success:onlocalhostnotneeded [root@glusterfs1~]#glusterpeerprobeglusterfs2 1peerprobe:success [root@glusterfs1~]#glusterpeerprobeglusterfs2 1peerprobe:success [root@glusterfs1~]#glusterpeerprobeglusterfs2  1peerprobe:success

3. View node status


4. Create a data storage directory on glusterfs {1-4}


5. Create a GlusterFS disk on glusterfs1


Replica 4 is one of the four nodes, each of which stores data once, that is, four copies of data and one copy of each node.

If replica 4 is not added, the disk space of the four nodes is integrated into a hard disk,

[root@glusterfs1~]#glustervolumecreatemodelsreplica4glusterfs1:/usr/local/share/modelsglusterfs2:/usr/local/share/modelsglusterfs3:/usr/local/share/modelsglusterfs4:/usr/local/share/modelsforce 1volumecreate:models:success:pleasestartthevolumetoaccessdata

6. Start



1. Deploy the GlusterFS client and mount the GlusterFS File System

[root@master3~]#wget-P/etc/yum.repos.d [root@master3~]#yuminstall-yglusterfsglusterfs-fuse [root@master3~]#mkdir-p/mnt/models [root@master3~]#mount-tglusterfs-oroglusterfs1:models/mnt/models/

2. view results

[root@master3~]#df-h FilesystemSizeUsedAvailUse%Mountedon /dev/vda3289G5.6G284G2%/ devtmpfs3.9G03.9G0%/dev tmpfs3.9G80K3.9G1%/dev/shm tmpfs3.9G169M3.7G5%/run tmpfs3.9G03.9G0%/sys/fs/cgroup /dev/vda11014M128M887M13%/boot glusterfs1:models189G3.5G186G2%/mnt/models

Other operation commands

Delete A GlusterFS Disk

# Glustervolumestopmodels stop first # Delete glustervolumedeletemodels

Detach a GlusterFS Disk


ACL Access Control


Add a GlusterFS Node

#glusterpeerprobesc2-log5 #glusterpeerprobesc2-log6 #glustervolumeadd-brickmodelssc2-log5:/data/glustersc2-log6:/data/gluster

Migrate GlusterFS data

#glustervolumeremove-brickmodelssc2-log1:/usr/local/share/modelssc2-log5:/usr/local/share/modelsstart #glustervolumeremove-brickmodelssc2-log1:/usr/local/share/modelssc2-log5:/usr/local/share/modelsstatus #glustervolumeremove-brickmodelssc2-log1:/usr/local/share/modelssc2-log5:/usr/local/share/modelscommit

Fix GlusterFS data (when Node 1 is down)

#glustervolumereplace-brickmodelssc2-log1:/usr/local/share/modelssc2-log5:/usr/local/share/modelscommit-force #glustervolumehealmodelsfull

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.