首先須要關閉CentOS的防火牆和selinux,不然glusterfs將可能沒法正常工做。linux
/etc/init.d/iptables status分佈式
會獲得一系列信息,說明防火牆開着。工具
/etc/init.d/iptables stopspa
永久關閉:orm
chkconfig --level 35 iptables offserver
永久關閉SELinuxthree
查看當前SELinux狀態:/usr/bin/setstatus -vip
編輯/etc/selinux/config,找到SELINUX 行修改爲爲:SELINUX=disabled:ci
# This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - No SELinux policy is loaded. SELINUX=disabled # SELINUXTYPE= can take one of these two values: # targeted - Only targeted network daemons are protected. # strict - Full SELinux protection. SELINUXTYPE=targeted rem
重啓系統。
1,將glusterfs的yum源加入到本機中 wget -P /etc/yum.repos.d http://download.gluster.org/pub/gluster/glusterfs/LATEST/EPEL.repo/glusterfs-epel.repo2,經過glusterfs的yum源進行安裝 yum -y install glusterfs{-fuse,-server,-geo-replication}3,啓動glusterfs服務 service glusterd start4,將機器加入到glusterfs集羣中 gluster peer probe ip 5,單機環境準備 mkdir -p /home/glusterfs6,建立分佈式卷,兩副本 gluster volume create gfs replica 2 10.10.10.1:/home/glusterfs 10.10.10.2:/home/glusterfs 7,啓動分佈式卷 gluster volume start gfs8,查看狀態 gluster volume info9,掛載分佈式存儲 mount -t glusterfs 10.10.10.1:/gfs /home/share10,擴容(注意擴容的機器數量須要是副本數的整數倍) gluster volume add-brick gfs 10.10.10.3:/home/glusterfs 10.10.10.4:/home/glusterfs 11,ACK控制(須要用逗號隔開) gluster volume set gfs auth.allow 10.10.10.5,10.10.10.612,開啓quota gluster volume quotagfs enable/disable13,對某一分區開啓quota限制1GB的空間,若是達到quota,則會直接報錯Disk quota exceeded,沒法繼續寫入 gluster volume quota gfs limit-usage /test-quota 1GB14,查詢quota gluster volume quotagfs list15,刪除quota gluster volume quotagfs remove/test-quota16,開啓profile工具 gluster volume profile gfs start/stop17,profile經常使用命令介紹 gluster volume profile gfs info18,刪除卷 gluster volume stop gfs && gluster volume delete gfs