关键词:
一、环境规划
GlusterFS服务端:10.100.0.41/10.100.0.44 GlusterFS客户端:10.100.0.43 |
二、所需软件包
glusterfs-server-3.4.2-1.el6.x86_64 glusterfs-3.4.2-1.el6.x86_64 |
三、安装
3.1、服务端安装
#wget -P /etc/yum.repos.d http://download.gluster.org/pub/gluster/glusterfs/3.6/3.6.2/CentOS/glusterfs-epel.repo #wget -P /etc/yum.repos.d http://download.gluster.org/pub/gluster/glusterfs/3.6/3.6.2/CentOS/glusterfs-epel.repo #service glusterd start#chkconfig glusterd on |
3.2、配置存储目录
GlusterFS默认不能使用根分区作为GlusterFS的存储目录,本例中使用第二块磁盘来做
# fdisk /dev/sdb Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel Building a new DOS disklabel with disk identifier 0x423f8af8. Changes will remain in memory only, until you decide to write them. After that, of course, the previous content won‘t be recoverable. Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite) WARNING: DOS-compatible mode is deprecated. It‘s strongly recommended to switch off the mode (command ‘c‘) and change display units to sectors (command ‘u‘). Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 1 First cylinder (1-78325, default 1): Using default value 1 Last cylinder, +cylinders or +size{K,M,G} (1-78325, default 78325): Using default value 78325 Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks. # mkfs.ext4 /dev/sdb1 mke2fs 1.41.12 (17-May-2010) Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) Stride=0 blocks, Stripe width=0 blocks 39321600 inodes, 157286382 blocks 7864319 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=4294967296 4800 block groups 32768 blocks per group, 32768 fragments per group 8192 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 102400000 Writing inode tables: done Creating journal (32768 blocks): done Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 35 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override. # mkdir /gfs # mount /dev/sdb1 /gfs # df -h Filesystem Size Used Avail Use% Mounted on /dev/sda2 30G 1.8G 27G 7% / tmpfs 495M 0 495M 0% /dev/shm /dev/sda1 194M 28M 157M 15% /boot /dev/sda4 65G 180M 62G 1% /home /dev/sdb1 591G 198M 561G 1% /gfs |
3.3、加入随机启动
#echo "/dev/sdb1 /gfs ext4 defaults 1 2" >> /etc/fstab |
3.4、在第一台GlusterFS server中加入存储节点。即(10.100.0.44)
# gluster peer probe 10.100.0.44 # 加入新节点 ....... |
3.5、查看节点信息
# gluster peer status Number of Peers: 1 Hostname: 10.100.0.44 Uuid: c674ccbb-072b-4f26-97a2-facd15add645 State: Peer in Cluster (Connected) |
3.5、创建存储卷。即集群磁盘
#gluster volume create gfsv replica 2 10.100.0.41:/gfs 10.100.0.44:/gfs Creation of volume gfsv has been successful. Please start the volume to access data. |
3.6、启动存储卷
# gluster volume start gfsv # 启动卷 |
3.7、查看存储卷信息
# gluster volume info Volume Name: gfsv Type: Replicate Volume ID: be627a08-1d36-40f5-add0-1277be47c328 Status: Started Number of Bricks: 1 x 2 = 2 Transport-type: tcp Bricks: Brick1: 10.100.0.41:/gfs/data Brick2: 10.100.0.44:/gfs/data |
3.8、配置访问ACL规则
# gluster volume set gfs auth.allow 10.100.0.* # 授权访问 |
四、客户端安装配置
4.1、安装客户端
客户端需要fuse支持
# yum -y install glusterfs glusterfs-fuse glusterfs-api glusterfs-devel glusterfs-libs |
4.2、挂载glusterfs存储
#mount -t glusterfs -o rw 10.100.0.41:gfsv /home/gfs/data/ |
五:存储卷模式
(1)distribute volume:分布式卷,文件通过hash算法分布到brick server上,这种卷是glusterfs的基础和最大特点;
(2)stripe volume:条带卷,类似RAID0,条带数=brick server数量,文件分成数据块以Round Robin方式分布到brick server上,并发粒度是数据块,大文件性能高;
(3)replica volume:镜像卷,类似RAID1,镜像数=brick server数量,所以brick server上文件数据相同,构成n-way镜像,可用性高;
(4)distribute stripe volume:分布式条带卷,brick server数量是条带数的倍数,兼具distribute和stripe卷的特点;
(5)distribute replica volume:分布式镜像卷,brick server数量是镜像数的倍数,兼具distribute和replica卷的特点;
六、 平衡布局是很有必要的,因为布局结构是静态的,当新的bricks加入现有卷,新创建的文件会分布到旧的bricks中,所以需要平衡布局结构,使新加入 的bricks生效。布局平衡只是使新布局生效,并不会在新的布局移动老的数据,如果你想在新布局生效后,重新平衡卷中的数据,还需要对卷中的数据进行平 衡。
gluster volume rebalance VOLNAME fix-layout start gluster volume rebalance VOLNAME migrate-data start 也可以两步合一步同时操作 gluster volume rebalance VOLNAME start 你也可以删除/停止卷 gluster volume stop/delete VOLNAME 你可以在在平衡过程中查看平衡信息: 你也可以暂停平衡,再次启动平衡的时候会从上次暂停的地方继续开始平衡。 gluster volume rebalance VOLNAME stop |
本文出自 “亮公子” 博客,请务必保留此出处http://iyull.blog.51cto.com/4664834/1946587
glusterfs分布式文件系统(代码片段)
简介Glusterfs是一个开源的分布式文件系统,是Scale存储的核心,能够处理千数量级的客户端。是整合了许多存储块(server)通过InfinibandRDMA或者 Tcp/Ip方式互联的一个并行的网络文件系统。 特征:容量可以按比例的扩展,... 查看详情
glusterfs分布式文件系统的搭建
准备工作1、安装IBA yuminstalllibradmacmlibrdmacm-devellibmlx4infiniband-diags 2、配置IPOIB /etc/sysconfig/network-scripts/ifconfig-ib0 DEVICE=ib0 TYPE=InfiniBand 查看详情
gfs分布式文件系统(代码片段)
...节点即可②在每个Node节点上查看群集状态3.创建卷①创建分布式卷②创建条带卷③创建复制卷④创建分布式条带卷⑤创建分布式复制卷4.部署Gluster客户端①安装客户端软件②创建挂载目录③配置/etc/hosts文件④挂载Gluster文件系统5... 查看详情
centos7下分布式系统glusterfs安装配置
一、主机规划操作系统版本为CentOS7.2.1511node1:172.17.0.1gfs1node2:172.17.0.2gfs2node3:172.17.0.3gfs3node4:172.17.0.4gfsclient:172.17.0.5 二、安装:1.在node1-4上安装glusterfs-serveryuminstall-ycentos-release-gluster38y 查看详情
56.glusterfs分布式文件系统
GlusterFS分布式文件系统GlusterFS是一个开源的分布式文件系统,软件的结构设计良好,易于扩展和配置,通过各个模块的灵活搭配得到针对性的解决方案。可解决一下问题:网络存储,联合存储,冗余备份,大文件的负载均衡。可... 查看详情
glusterfs分布式文件系统
第一:安装依赖包:yuminstalllibibverbslibrdmacmxfsprogsnfs-utilsrpcbindlibaioliblvm2app lvm2-devel libevent-devel nfs-utils-lib-develtcl-devellibsysfs-devel userspace-rcu atop ioz 查看详情
gfs分布式文件系统(代码片段)
目录一.GlusterFS概述1.GlusterFS简介2.GlusterFS特点3.GlusterFS术语4.模块化堆栈式架构5.GlusterFS的工作流程6.弹性HASH算法7.GlusterFs的卷类型二.部署GlusterFS群集1.准备环境(所有node节点上操作)①添加硬盘,关闭防火墙,修改所有node节... 查看详情
glusterfs分布式文件系统!(代码片段)
GlusterFSGlusterFS基本知识文件系统GlusterFSGlusterFS特点GlusterFS组成GlusterFS专业术语GlusterFS工作流程GlusterFS卷类型GlusterFS集群部署GlusterFS基本知识文件系统组成:文件系统接口,对对象管理的软件集合,对象及属性作用... 查看详情
glusterfs分布式文件系统!(代码片段)
GlusterFSGlusterFS基本知识文件系统GlusterFSGlusterFS特点GlusterFS组成GlusterFS专业术语GlusterFS工作流程GlusterFS卷类型GlusterFS集群部署GlusterFS基本知识文件系统组成:文件系统接口,对对象管理的软件集合,对象及属性作用... 查看详情
分布式文件系统---glusterfs介绍
...terFS是Scale-Out存储解决方案Gluster的核心,它是一个开源的分布式文件系统,具有强大的横向扩展能力,通过扩展能够支持数PB存储容量和处理数千客户端。GlusterFS借助TCP/IP或InfiniBandRDMA网络将物理分布的存储资源聚集在一起,使... 查看详情
centos7搭建glusterfs分布式文件系统群集(代码片段)
关于GlusterFS分布式文件系统工作原理及相关概述请参考博文:GlusterFS分布式文件系统概述一、搭建GlusterFS分布式文件系统群集此案例相关软件包请访问:https://pan.baidu.com/s/1xazQAkR2Lm31njwu88Z9qA提取码:qdiy环境如下:服务器相关信息... 查看详情
分布式文件系统-glusterfs
1.1分布式文件系统1.1.1什么是分布式文件系统 相对于本机端的文件系统而言,分布式文件系统(英语:Distributedfilesystem, DFS),或是网络文件系统(英语:NetworkFileSystem),是一种允许文件通过网络在多台主机上分享的文... 查看详情
38掌握分布式存储系统glusterfs的基本用法,包括卷管理数据复制(代码片段)
GlusterFS是一种分布式文件系统,可以将多个存储服务器集成为一个分布式存储池。以下是一些基本的使用方法和示例代码。安装和启动GlusterFS在所有节点上安装GlusterFS,并确保每个节点上的GlusterFS服务已经启动。创建Glust... 查看详情
glusterfs分布式文件系统
glusterfs第1章什么是分布式文件系统?相对于本极端的文件系统而言,分布式文件系统DFS,伙食网络文件系统NFS,是一种允许文件通过网络在多台主机上分享的文件系统你那个,可以让多机器上的多用户分享指定问加你和存储空间在这样... 查看详情
分布式文件系统--------glusterfs最佳实战
1.背景 GlusterFS是一个开源的分布式文件系统,具有强大的横向扩展能力,通过扩展能够支持数PB存储容量和处理数千客户端。GlusterFS借助TCP/IP或InfiniBandRDMA(一种支持多并发链接的“转换线缆”技术)网络将物理分布的... 查看详情
glusterfs分布式文件系统(代码片段)
GlusterFS分布式文件系统,用于存储、管理磁盘文件文件系统(FS)文件系统组成1、文件系统接口2、对对像管理的软件集合3、对象及属性文件系统作用从系统角度来看,文件系统是对文件存储设备的空间进行组织和分配... 查看详情
脑壳有点疼。。glusterfs分布式文件系统!(更新中)
GlusterFS分布式文件系统一.文件系统简介1.组成2.作用3.挂载使用二.GlusterFS分布式文件系统1.GFS是由三部分组成(组件)2.GFS特点3.GFS专业术语4.GFS模块化堆栈式架构5.工作流程6.基本卷和复合卷三.部署GFS集群1.实验准备一.文... 查看详情
gfs分布式文件系统(相关理论及实验操作详解)(代码片段)
目录一、GlusterFS简介二、GlusterFS特点三、GlusterFS术语四、模块化堆栈式架构五、GlusterFS的工作流程六、弹性HASH算法七、GlusterFs的卷类型八、部署GlusterFS群集1.关闭防火墙2.磁盘分区,并挂载(四个节点都做3.修改主机名... 查看详情