others linux服务器运维 django3 监控 k8s golang 数据库 大数据 前端 devops 理论基础 java oracle 运维日志

glusterfs 安装

访问量:1053 创建时间:2020-04-23

安装

[root@localhost ~]# yum -y install centos-release-gluster
[root@localhost ~]# yum -y install glusterfs glusterfs-fuse glusterfs-server
[root@localhost ~]# systemctl start glusterd.service
[root@localhost ~]# systemctl enable glusterd.service

加入其他节点

[root@localhost ~]# gluster peer probe k8s-n2
peer probe: success. 
[root@localhost ~]# gluster peer probe k8s-n3
peer probe: success. 
[root@localhost ~]# gluster peer probe k8s-n4
peer probe: success. 
[root@localhost ~]# gluster peer status
Number of Peers: 3

Hostname: k8s-n2
Uuid: fc6cb5f7-8836-4a85-bab7-d2c58c8501a4
State: Peer in Cluster (Connected)

Hostname: k8s-n3
Uuid: 00f09abf-51cb-461d-9233-4c2dbce8e805
State: Peer in Cluster (Connected)

Hostname: k8s-n4
Uuid: 86ae26a4-98cd-4b27-84a9-035af33d4912
State: Peer in Cluster (Connected)

创建共享vm

[root@localhost ~]# mkdir /data/glusterfsdir
[root@localhost ~]# gluster volume create gv0 replica 2 k8s-n1:/data/glusterfsdir/ k8s-n2:/data/glusterfsdir/ k8s-n3:/data/glusterfsdir/ k8s-n4:/data/glusterfsdir/ force
volume create: gv0: success: please start the volume to access data
[root@localhost ~]# gluster volume start gv0
volume start: gv0: success
[root@localhost ~]# gluster volume info

Volume Name: gv0
Type: Distributed-Replicate
Volume ID: 3d073b13-2d90-486a-b12f-81ac92576a04
Status: Started
Snapshot Count: 0
Number of Bricks: 2 x 2 = 4
Transport-type: tcp
Bricks:
Brick1: k8s-n1:/data/glusterfsdir
Brick2: k8s-n2:/data/glusterfsdir
Brick3: k8s-n3:/data/glusterfsdir
Brick4: k8s-n4:/data/glusterfsdir
Options Reconfigured:
transport.address-family: inet
storage.fips-mode-rchecksum: on
nfs.disable: on
performance.client-io-threads: off

挂载

mount -t glusterfs k8s-n1:/gv0 /mnt 

删除volume

[root@k8s-n1 ~]# gluster volume stop gv0
Stopping volume will make its data inaccessible. Do you want to continue? (y/n) y
volume stop: gv0: success
[root@k8s-n1 ~]# gluster volume delete gv0
Deleting volume will erase all information about the volume. Do you want to continue? (y/n) y
volume delete: gv0: success
登陆评论: 使用GITHUB登陆