### Installing Gluster
wget -P /etc/yum.repos.d http://download.gluster.org/pub/gluster/glusterfs/LATEST/EPEL.repo/glusterfs-epel.repo
yum install glusterfs{-fuse,-server}
# 查看gluster版本信息
# 啟動停止服務
service glusterd start
service glusterd stop
# 存儲主機加入信任存儲池
gluster peer probe fs-server-2
gluster peer probe fs-server-3
# 查看狀態
# 五中類型的volume可以被創建:
Distributed:分布式卷,文件通過hash算法隨機的分布到由bricks組成的卷上。
Replicated:復制式卷,類似raid1,replica數必須等于volume中brick所包含的存儲服務器數,可用性高。
Striped:條帶式卷,類似與raid0,stripe數必須等于volume中brick所包含的存儲服務器數,文件被分成數據塊,以Round Robin的方式存儲在bricks中,并發粒度是數據塊,大文件性能好。
Distributed Striped:分布式的條帶卷,volume中brick所包含的存儲服務器數必須是stripe的倍數(>=2倍),兼顧分布式和條帶式的功能。
Distributed Replicated:分布式的復制卷,volume中brick所包含的存儲服務器數必須是 replica 的倍數(>=2倍),兼顧分布式和復制式的功能。
# 創建分布卷
gluster volume create gv0 fs-server-1:/data/gfs fs-server-2:/data/gfs
# 創建復制卷
gluster volume create gv0 replica 2 fs-server-1:/data/gfs fs-server-2:/data/gfs
# 創建條帶卷
gluster volume create gv0 stripe 2 fs-server-1:/data/gfs fs-server-2:/data/gfs
# 啟動卷
# 查看卷
#如果以后要添加服務器,可以使用add-brick命令:
gluster volume add-brick gv0 fs-server-3:/data/gfs fs-server-4:/data/gfs
gluster volume remove-brick VOLNAME BRICK
注意:當你給分布式復制卷和分布式條帶卷中增加bricks時,你增加的bricks的數目必須是復制或者條帶數目的倍數,例如:你給一個分布式復制卷的replica為2,你在增加bricks的時候數量必須為2、4、6、8等。
當移除分布式復制卷或者分布式條帶卷的時候,移除的bricks數目必須是replica或者stripe的倍數。例如:一個分布式條帶卷的stripe是2,當你移除bricks的時候必須是2、4、6、8等。
#掛載glusterfs
mount -t glusterfs fs-server-1:/gv0 /mnt/gfs
mount -t nfs fs-server-1:/gv0 /mnt/gfs
mount -v -t nfs -o mountproto=tcp,vers=3 fs-server-1:/gv0 /mnt/gfs-nfs
posted on 2013-08-09 16:00
Derek.Guo 閱讀(1507)
評論(0) 編輯 收藏 所屬分類:
Linux/Unix