GlusterFS是一个开源的分布式文件系统,于2011年被红帽收购.它具有高扩展性、高性能、高可用性、可横向扩展的弹性特点,无元数据服务器设计使glusterfs没有单点故障隐患,详细介绍请查看官网:www.gluster.org 。

部署环境: 
OS: CentOS release 6.5 (Final) x64 
Server: 
c1:192.168.242.132 
c2:192.168.242.133 
c3:192.168.242.134 
c4:192.168.242.135 
hosts: 
192.168.242.132 c1 
192.168.242.133 c2 
192.168.242.134 c3 
192.168.242.135 c4

具体操作: 
c1/c2/c3/c4上执行 
[root@c1 ~]# wget -P /etc/yum.repos.d http://download.gluster.org/pub/gluster/glusterfs/LATEST/CentOS/glusterfs-epel.repo 
[root@c1 yum.repos.d]# yum install -y glusterfs glusterfs-server glusterfs-fuse 
[root@c1 yum.repos.d]# /etc/init.d/glusterd start 
Starting glusterd: [ OK ] 
[root@c1 yum.repos.d]# chkconfig glusterd on

c1上配置集群 
[root@c1 ~]# gluster peer probe c1 
peer probe: success. Probe on localhost not needed 
[root@c1 ~]# gluster peer probe c2

peer probe: success. 
[root@c1 ~]# gluster peer probe c3 
peer probe: success. 
[root@c1 ~]# gluster peer probe c4 
peer probe: success.

如果c1在peer表中被识别为ip地址,可能后面集群过程中会出现通讯问题, 
我们可以使用ip来进行修复: 
[root@c3 ~]# gluster peer status 
Number of Peers: 3

Hostname: 192.168.242.132 
Uuid: 6e8d6880-ec36-4331-a806-2e8fb4fda7be 
State: Peer in Cluster (Connected)

Hostname: c2 
Uuid: 9a722f50-911e-4181-823d-572296640486 
State: Peer in Cluster (Connected)

Hostname: c4 
Uuid: 1ee3588a-8a16-47ff-ba59-c0285a2a95bd 
State: Peer in Cluster (Connected) 
[root@c3 ~]# gluster peer detach 192.168.242.132 
peer detach: success 
[root@c3 ~]# gluster peer probe c1 
peer probe: success. 
[root@c3 ~]# gluster peer status 
Number of Peers: 3

Hostname: c2 
Uuid: 9a722f50-911e-4181-823d-572296640486 
State: Peer in Cluster (Connected)

Hostname: c4 
Uuid: 1ee3588a-8a16-47ff-ba59-c0285a2a95bd 
State: Peer in Cluster (Connected)

Hostname: c1 
Uuid: 6e8d6880-ec36-4331-a806-2e8fb4fda7be 
State: Peer in Cluster (Connected)

c1上创建集群磁盘 
[root@c1 ~]# gluster volume create datavolume1 replica 2 transport tcp c1:/usr/local/share/datavolume1 c2:/usr/local/share/datavolume1 c3:/usr/local/share/datavolume1 c4:/usr/local/share/datavolume1 force 
volume create: datavolume1: success: please start the volume to access data 
[root@c1 ~]# gluster volume create datavolume2 replica 2 transport tcp c1:/usr/local/share/datavolume2 c2:/usr/local/share/datavolume2 c3:/usr/local/share/datavolume2 c4:/usr/local/share/datavolume2 force 
volume create: datavolume2: success: please start the volume to access data 
[root@c1 ~]# gluster volume create datavolume3 replica 2 transport tcp c1:/usr/local/share/datavolume3 c2:/usr/local/share/datavolume3 c3:/usr/local/share/datavolume3 c4:/usr/local/share/datavolume3 force 
volume create: datavolume3: success: please start the volume to access data 
[root@c1 ~]# gluster volume start datavolume1 
volume start: datavolume1: success 
[root@c1 ~]# gluster volume start datavolume2 
volume start: datavolume2: success 
[root@c1 ~]# gluster volume start datavolume3 
volume start: datavolume3: success

[root@c1 ~]# gluster volume info

Volume Name: datavolume1 
Type: Distributed-Replicate 
Volume ID: 819d3dc4-2a3a-4342-b49b-3b7961ef624f 
Status: Started 
Number of Bricks: 2 x 2 = 4 
Transport-type: tcp 
Bricks: 
Brick1: c1:/usr/local/share/datavolume1 
Brick2: c2:/usr/local/share/datavolume1 
Brick3: c3:/usr/local/share/datavolume1 
Brick4: c4:/usr/local/share/datavolume1

Volume Name: datavolume2 
Type: Distributed-Replicate 
Volume ID: d9ebaee7-ef91-4467-9e44-217a63635bfc 
Status: Started 
Number of Bricks: 2 x 2 = 4 
Transport-type: tcp 
Bricks: 
Brick1: c1:/usr/local/share/datavolume2 
Brick2: c2:/usr/local/share/datavolume2 
Brick3: c3:/usr/local/share/datavolume2 
Brick4: c4:/usr/local/share/datavolume2

Volume Name: datavolume3 
Type: Distributed-Replicate 
Volume ID: 1e8b21db-f377-468b-b76e-868edde93f15 
Status: Started 
Number of Bricks: 2 x 2 = 4 
Transport-type: tcp 
Bricks: 
Brick1: c1:/usr/local/share/datavolume3 
Brick2: c2:/usr/local/share/datavolume3 
Brick3: c3:/usr/local/share/datavolume3 
Brick4: c4:/usr/local/share/datavolume3

客户端环境部署 
Centos OS 6.5 x64 并加入hosts 
[root@c5 ~]#wget -P /etc/yum.repos.d http://download.gluster.org/pub/gluster/glusterfs/LATEST/CentOS/glusterfs-epel.repo 
[root@c5 ~]#yum install -y glusterfs glusterfs-fuse 
[root@c5 ~]# mkdir -p /mnt/{datavolume1,datavolume2,datavolume3} 
[root@c5 ~]# mount -t glusterfs -o ro c1:datavolume1 /mnt/datavolume1/ 
[root@c5 ~]# mount -t glusterfs -o ro c1:datavolume2 /mnt/datavolume2/ 
[root@c5 ~]# mount -t glusterfs -o ro c1:datavolume3 /mnt/datavolume3/ 
me3 
[root@c5 ~]# df -h 
Filesystem Size Used Avail Use% Mounted on 
/dev/mapper/VolGroup-lv_root 
38G 840M 36G 3% / 
tmpfs 242M 0 242M 0% /dev/shm 
/dev/sda1 485M 32M 429M 7% /boot 
c1:datavolume1 57G 2.4G 52G 5% /mnt/datavolume1 
c1:datavolume2 57G 2.4G 52G 5% /mnt/datavolume2 
c1:datavolume3 57G 2.4G 52G 5% /mnt/datavolume3

客户端测试 
[root@c5 ~]# umount /mnt/datavolume1/ 
[root@c5 ~]# mount -t glusterfs c1:datavolume1 /mnt/datavolume1/ 
[root@c5 ~]# touch /mnt/datavolume1/test.txt 
[root@c5 ~]# ls /mnt/datavolume1/test.txt 
/mnt/datavolume1/test.txt

[root@c2 ~]# ls -al /usr/local/share/datavolume1/ 
total 16 
drwxr-xr-x. 3 root root 4096 May 15 03:50 . 
drwxr-xr-x. 8 root root 4096 May 15 02:28 .. 
drw——-. 6 root root 4096 May 15 03:50 .glusterfs 
-rw-r–r–. 2 root root 0 May 20 2014 test.txt 
[root@c1 ~]# ls -al /usr/local/share/datavolume1/ 
total 16 
drwxr-xr-x. 3 root root 4096 May 15 03:50 . 
drwxr-xr-x. 8 root root 4096 May 15 02:28 .. 
drw——-. 6 root root 4096 May 15 03:50 .glusterfs 
-rw-r–r–. 2 root root 0 May 20 2014 test.txt

删除GlusterFS磁盘: 
gluster volume stop datavolume1 
gluster volume delete datavolume1

卸载GlusterFS磁盘: 
gluster peer detach idc1-server4

访问控制: 
gluster volume set datavolume1 auth.allow 192.168.242.*,192.168.241.*

添加GlusterFS节点: 
gluster peer probe c6 
gluster peer probe c7 
gluster volume add-brick datavolume1 c6:/usr/local/share/datavolume1 c7:/usr/local/share/datavolume1

迁移GlusterFS磁盘数据: 
gluster volume remove-brick datavolume1 c1:/usr/local/share/datavolume1 c6:/usr/local/share/datavolume1 start 
gluster volume remove-brick datavolume1 c1:/usr/local/share/datavolume1 c6:/usr/local/share/datavolume1 status 
gluster volume remove-brick datavolume1 c1:/usr/local/share/datavolume1 c6:/usr/local/share/datavolume1 commit

数据重新分配: 
gluster volume rebalance datavolume1 start 
gluster volume rebalance datavolume1 status 
gluster volume rebalance datavolume1 stop

修复GlusterFS磁盘数据(例如在c1宕机的情况下): 
gluster volume replace-brick datavolume1 c1:/usr/local/share/datavolume1 c6:/usr/local/share/datavolume1 commit -force 
gluster volume heal datavolume1 full

转自:http://www.btschina.com/home/index.php/glusterfs-an-zhuang-yu-pei-zhi.html

GlusterFS 安装与配置相关推荐

  1. GlusterFS安装配置

    俩台服务端,一台客户端. 环境: Centos7. 服务端安装和配置 零.编辑hosts文件 添加 192.168.1.230 GFS230 192.168.1.231 GFS231 230.231两 ...

  2. GlusterFs安装部署文档

    1.安装步骤 把"fuse-2.8.4.tar.gz"和"glusterfs-3.2.5.tar.gz"上传到/home/xmail目录下,解压,编译,安装都在 ...

  3. glusterfs安装详解

    Gluster 文件系统 3.3 管理员手册 使用gluster 文件系统 前言 本指南介绍如何配置,操作和管理Gluster的文件系统(GlusterFS) 本指南是针对那些有兴趣在配置和管理Glu ...

  4. Tachyon的安装、配置和使用

    发布人:南京大学PASA大数据实验室董乾豪 0. 前言 在上一篇博文<Tachyon简介>中,我们简要地介绍了Tachyon,一个以内存为中心的分布式文件系统,及其一些基本工作原理.这一次 ...

  5. 025-Cinder服务--安装并配置一个本地存储节点(ISCSI)

    一:Cinder提供块级别的存储服务,块存储提供一个基础设施为了管理卷,以及和OpenStack计算服务交互,为实例提供卷.此服务也会激活管理卷的快照和卷类型的功能,块存储服务通常包含下列组件: ci ...

  6. Maven安装与配置(最实用!!!)eclipse中配置maven

    Maven安装与配置 一.需要准备的东西 JDK Eclipse(本章主要是在eclipse中进行配置maven) Maven程序包 二.下载与安装 1. 前往maven下载最新版的Maven程序: ...

  7. Portainer 安装与配置

    文章目录 Portainer 安装与配置 一.介绍 二.安装使用 1.单机运行 2.基于swarm集群方式运行 Portainer 安装与配置 一.介绍 ​ Portainer 是一个开源.轻量级Do ...

  8. Myeclipse安装、配置、测试

    Myeclipse安装.配置.测试(win7_64bit) 目录 1.概述 2.本文用到的工具 3.安装与激活 4.JavaSE开发测试(确保JDK已正确安装) 5.JavaEE开发测试(确保服务器和 ...

  9. [网摘学习]在Ubuntu上安装和配置OpenStack Nova之二

    再收藏一份Openstack的文章,这两天的操作与此相同.但其中出现的问题还需要查找原因.待个人继续学习研究. 原文参考:http://www.linuxde.net/2011/11/1599.htm ...

最新文章

  1. 从宇宙、互联网和脑的关系看元宇宙的终极形态
  2. HR只在这些时间里看你的简历!
  3. Horizon组件安装详解 - 远程连接OpenStack服务
  4. python函数递归 汉诺塔
  5. 联想集团大裁员:公司不是家
  6. MC2D v0.0.6 Source Code
  7. 计算机的硬件地址在哪看,电脑的MAC地址在哪里查看
  8. vim 配置及插件安装管理(超级详细)
  9. 计算机网络安全在电子商务中的应用 魏娟,[网络安全最新技术论文]网络安全技术探究...
  10. 乌镇AI论坛最全盘点:中国互联网半壁江山坐在了一起,他们怎么看AI
  11. lammps案例:聚乙烯/石墨烯侧面pull out模拟案例
  12. 计算机病毒是怎么工作的,计算机病毒是如何工作的(转载)
  13. 未来固码市场的可持续发展性
  14. 如何录制微课?简单,手把手教你:教学微课视频如何录制
  15. MD5中使用16进制消息摘要
  16. 华为LAB实验室:0-Ubuntu搭建实验环境
  17. SQL中的字母的大小写转换
  18. php程序员每天都做什么,程序员每天都在做什么呢?
  19. Distractor-aware Siamese Networks for Visual Object Tracking全文翻译
  20. CSS之合并相邻边框

热门文章

  1. Nginx + Tomcat 负载均衡集群配置
  2. A Grain of Sand 一粒沙子
  3. ASP.NET虚拟主机安全漏洞解决方案
  4. 自学Python和科班出身的Python程序员差别在哪?几张图告诉你
  5. rockmq运维指令_RocketMQ运维监控
  6. 251f与ips屏显示器对比_同样是240Hz高刷新率 有了VA屏你还会选择TN?
  7. 7个让你惊叹的HTML技巧
  8. 从git仓库中删除.idea文件夹的小技巧
  9. java在何时获得对象的确切类型_JAVA面试题(1)
  10. Flask-Email的相关知识点实现(发送电子邮件)