glusterfs安装使用
2016/07/14 20:17 于 安全 0
**介绍
glusterfs文件系统是:
- 一个分布式可伸缩,最大可超过PB,可插拔的集群I / O调度器
- 非停止性存储,非元数据存储
- 可以通过mount挂载到本地,向本地磁盘一样读写
- 简单易于管理
查看各个节点状态
gluster peer status
1.安装
- 1 配置epel源
wget -P /etc/yum.repos.d http://download.gluster.org/pub/gluster/glusterfs/LATEST/CentOS/glusterfs-epel.repo
1.2 安装软件
yum install glusterfs glusterfs-server glusterfs-fuse
- 3 添加hosts
[root@docker ~]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
10.1.1.134 docker
192.168.199.253 i2p.nginxs.net
1.4 注册并查看主机列表(不显示当前主机)
[root@cloud yum.repos.d]# gluster peer probe 192.168.199.222
peer probe: success.
[root@cloud yum.repos.d]# gluster peer status
Number of Peers: 1
Hostname: 192.168.199.222
Uuid: 67511194-333c-4919-88df-ccb5e10d9568
State: Peer in Cluster (Connected)
[root@cloud yum.repos.d]# gluster peer probe 192.168.199.8
peer probe: success. Probe on localhost not needed
1.5 创建逻辑卷
[root@cloud yum.repos.d]# gluster volume create dianjoygfs 192.168.199.{8,222}:/data1/gfs-data/
volume create: dianjoygfs: success: please start the volume to access data
1.6 启动存储逻辑卷
[root@docker ~]# gluster volume start dianjoygfs
volume start: dianjoytest: success
1.7 挂载glusterfs存储卷
[root@ntest1 ~]# mount.glusterfs 192.168.199.8:/dianjoygfs /mnt/gluster-mount/
[root@ntest1 ~]# df -hT
Filesystem Type Size Used Avail Use% Mounted on
/dev/vda1 ext4 20G 8.8G 9.8G 48% /
tmpfs tmpfs 1.9G 16K 1.9G 1% /dev/shm
/dev/vdb1 ext4 50G 20G 28G 42% /data
192.168.199.8:/dianjoygfs
fuse.glusterfs 2.7T 861G 1.8T 33% /mnt/gluster-mount
这个存储卷的大小是,每个节点挂载“/data1/gfs-data/”的磁盘大小,其它信息同是如此。