kubernetes云平台管理实战:分布式文件系统glusterfs(二十一)

一、安装glusterfs

1、什么是glusterfs

Glusterfs是一个开源分布式文件系统,具有强大的横向扩展能力,可支持数PB存储容量和数千客户端,通过网络互联成一个并行的网络文件系统。具有可扩展性、高性能、高可用性等特点

2、安装glusterfs

所有节点

yum install centos-release-gluster -y
yum install install glusterfs-server -y
systemctl start glusterd.service
systemctl enable glusterd.service
mkdir -p /gfs/test1
mkdir -p /gfs/test2

二、添加存储资源池

master节点

[root@master ~]# gluster pool list
UUID	Hostname State
e23fd83e-ed78-424d-a20c-c1cec983973e	localhost	Connected 
[root@master ~]# gluster peer probe node1
peer probe: failed: Probe returned with Transport endpoint is not connected
[root@master ~]# gluster peer probe 192.168.118.19
peer probe: success. 
[root@master ~]# gluster peer probe 192.168.118.20
peer probe: success. 
[root@master ~]# gluster pool list
UUID	Hostname State
50dddc1a-eb2b-45ee-b063-be40a7bf8ee1	192.168.118.19	Connected 
db13d4ce-c9ac-4628-824c-72a67de4aa99	192.168.118.20	Connected 
e23fd83e-ed78-424d-a20c-c1cec983973e	localhost Connected

三、glusterfs卷管理

创建分布式复制卷

root@master ~]# gluster volume create luoahong replica 2 192.168.118.18:/gfs/test1 192.168.118.18:/gfs/test2 192.168.118.19:/gfs/test1 192.168.118.19:/gfs/test2 force
volume create: luoahong: success: please start the volume to access data

启动卷

[root@master ~]# gluster volume start luoahong
volume start: luoahong: success

查看卷

[root@master ~]# gluster volume info luoahong

Volume Name: luoahong
Type: Distributed-Replicate
Volume ID: 010f95a9-0ba6-4db2-96e8-3a8ed9e73c74
Status: Started
Snapshot Count: 0
Number of Bricks: 2 x 2 = 4
Transport-type: tcp
Bricks:
Brick1: 192.168.118.18:/gfs/test1
Brick2: 192.168.118.18:/gfs/test2
Brick3: 192.168.118.19:/gfs/test1
Brick4: 192.168.118.19:/gfs/test2
Options Reconfigured:
transport.address-family: inet
storage.fips-mode-rchecksum: on
nfs.disable: on
performance.client-io-threads: off

挂载卷

[root@master ~]# mount -t glusterfs 192.168.118.18:/luoahong /mnt

四、分布式复制卷扩容

分布式复制卷讲解

kubernetes云平台管理实战:分布式文件系统glusterfs(二十一)

分布式复制卷扩容

扩容前查看容量:

[root@master ~]# df -h
Filesystem                Size  Used Avail Use% Mounted on
/dev/vda3                  96G  9.3G   86G  10% /
......
192.168.118.18:/luoahong   96G  7.1G   88G   8% /mnt

扩容命令:

[root@master ~]# gluster volume add-brick luoahong 192.168.118.20:/gfs/test1 192.168.118.20:/gfs/test2 force
volume add-brick: success

扩容后查看容量:

[root@master ~]# df -h
Filesystem                Size  Used Avail Use% Mounted on
/dev/vda3                  96G  9.3G   86G  10% /
......
192.168.118.18:/luoahong  143G  8.9G  134G   7% /mnt
上一篇:GlusterFS 分布式文件系统


下一篇:GlusterFS实战