glusterfs安裝和初始化

系統環境:centos 6 x86_64  centos

集羣環境:server1 server2ide

1,添加glusterfs源到centos測試

wget -P /etc/yum.repos.d http://download.gluster.org/pub/gluster/glusterfs/LATEST/RHEL/glusterfs-epel.repo

安裝glusterfs-serverui

yum install glusterfs-server

這時,若是提示缺乏pyxattr和liburcu兩個包,能夠這樣下載和安裝spa

wget ftp://ftp.pbone.net/mirror/ftp5.gwdg.de/pub/opensuse/repositories/home:/visionsoftware/CentOS_CentOS-6/x86_64/pyxattr-0.5.0-4.2.x86_64.rpm
rpm -ivh
pyxattr-0.5.0-4.2.x86_64.rpm
 
 
wget ftp://ftp.muug.mb.ca/mirror/fedora/epel/6/x86_64/userspace-rcu-0.7.7-1.el6.x86_64.rpm
rpm -ivh userspace-rcu-0.7.7-1.el6.x86_64.rpm

2,啓動glusterfs服務.net

service glusterd start

查看glusterfs服務運行狀態code

 service glusterd status

 

3,在server1中執行server

gluster peer probe server2

在server2中執行blog

gluster peer probe server1

當這兩個節點之間創建互信生成一個pool以後,再添加其它節點,只能從這兩個節點執行文檔

gluster peer probe hostname

來添加新的節點,不能重新節點或其它pool中,添加當前pool中的節點。

4,在server1和server2中分別執行

mkdir /data/brick1/gv0

5,在server1或server2任一一臺機器上執行

gluster volume create gv0 replica 2 server1:/data/brick1/gv0 server2:/data/brick1/gv0

gluster volume start gv0

6,測試glusterfs安裝結果

mount -t glusterfs server1:/gv0 /mnt

for i in `seq -w 1 100`; do cp -rp /var/log/messages /mnt/copy-test-$i; done

ls -lA /mnt | wc -l

ls -lA /data/brick1/gv0

 

隨筆內容主要摘抄自glusterfs官方文檔

相關文章
相關標籤/搜索