What is glusterfs?
Glusterfs distributed file system is an open source, has a strong ability to scale to support the number of number of dry storage capacity PB client through a network interconnection into a parallel network file system. Scalable, high-performance, high availability characteristics.
glusterfs installation process
#所有节点操作
yum install centos-release-gluster -y
yum install install glusterfs-server -y
systemctl start glusterd.service
systemctl enable glusterd.service
#为glusterfs集群增加存储单元brick
mkdir -p /gfs/test1
mkdir -p /gfs/test2
mkdir -p /gfs/test3
Adding storage resource pool
#在master节点上操作
查看资源池
glusterfs pool list
增加资源池
glusterfs peer probe k8s-node1
glusterfs peer probe k8s-node2
Creating a distributed volume
#创建
gluster volume create oldxu k8s-master:/gfs/test1 k8s-node-1:/gfs/test1 k8s-node-2:/gfs/test1 force
查看
gluster volume info oldxu
启动
gluster volume start oldxu
挂载
mount -t glusterfs 127.0.0.1:/oldxu /mnt
现在就可以使用了
Creating a distributed replicated volumes
在分布式的基础上,创建复制卷
gluster volume add-brick oldxu replica 2 k8s-master:/gfs/test2 k8s-node-1:/gfs/test2 k8s-node-2:/gfs/test2 force
Increase node expansion
gluster volume add-brick oldxu k8s-master:/gfs/test3 k8s-node1:/gfs/test3 force
Volume of balanced storage
gluster volume rebalance oldxu start