• GlusterFS 部署


    服务器

    操作系统

    系统IP

    主机名

    挂载磁盘

    挂载目录

    CentOS7.5

    192.168.200.111

    node1

    /dev/sdb(3GB)
    /dev/sdc(4GB)
    /dev/sdd(5GB)
    /dev/sde(6GB)

    /b3
    /c4
    /d5
    /e6

    CentOS7.5

    192.168.200.112

    node2

    /dev/sdb(3GB)
    /dev/sdc(4GB)
    /dev/sdd(5GB)
    /dev/sde(6GB)

    /b3
    /c4
    /d5
    /e6

    CentOS7.5

    192.168.200.113

    node3

    /dev/sdb(3GB)
    /dev/sdc(4GB)
    /dev/sdd(5GB)

    /b3
    /c4
    /d5

    CentOS7.5

    192.168.200.114

    node4

    /dev/sdb(3GB)
    /dev/sdc(4GB)
    /dev/sdd(5GB)

    /b3
    /c4
    /d5

    CentOS7.5

    192.168.200.115

    Client

     

     

    服务器的相关信息

    卷名称

    卷类型

    空间大/小/GB

    Brick

    dis-volume

    分布式卷

    12

    node1(/e6)、node2(/e6)

    stripe-volume

    条带卷

    10

    node1/d5)、node2(/d5)

    rep-volume

    复制卷

    5

    node3/d5)、node4/d5)

    dis-stripe

    分布式条卷

    12

    node1(/b3)、node2(/b3)、node3(/b3)、node4(/b3)

    dis-rep

    分布式复制卷

    8

    node1/c4)、node2/c4)、node3(/c4)、node4(/c4)

    1、准备环境
    在所有节点上执行以下操作。
    开启4台虚拟机,根据表-1添加磁盘,通过fdisk命令分区,mkfs命令格式化,创建相应的挂载目录,并将格式化的磁盘挂载到相应的目录中,最后修改/etc/fstab配置文件,使其永久生效。

    注意:首先创建/gfs国录,把软件包全部拷贝到目录

    四台主机创建目录,导入包,将目录下内容发送到其余三台主机

    mkdir /gfs

    通过 FTP 服务 ,把相关软件包导入 /gfs 下

    cd /gfs

    scp -r * 192.168.200.112:/gfs

    scp -r * 192.168.200.113:/gfs

    scp -r * 192.168.200.114:/gfs

    编写shell脚本,并将脚本发送到其他三台在主机

    vim gfsconf.sh

    脚本内容:

    #!/bin/bash
    for i in $(fdisk -l | grep -wo "/dev/sd[b-z]" | sort)
    do
    dd if=/dev/zero of=$i bs=1024 count=1024 
    fdisk $i << EOF
    n
    p

    w
    EOF

    partprobe $i
    mkfs.ext4 ${i}1
    done

    mkdir /b3 /c4 /d5 /e6 
    fdisk -l | grep -w "/dev/sd[b-z]" | sed -r 's/.*(/d.{8}).*/1/g' | sed -r 's/(.*)(.):(.*)/mount 121 /23/' | bash

    fdisk -l | grep -w "/dev/sd[b-z]" | sed -r 's/.*(/d.{8}).*/1/g' | sed -r 's/(.*)(.):(.*)/121 /23 xfs default 0 0/' >> /etc/fstab

    iptables -F
    systemctl stop firewalld
    setenforce 0

    cat << EOF >> /etc/hosts
    192.168.200.111 node1
    192.168.200.112 node2
    192.168.200.113 node3
    192.168.200.114 node4
    EOF

    cat << EOF >> /etc/yum.repos.d/gfs.repo 
    [gfs]
    name=gfs
    baseurl=file:///gfs
    gpgcheck=0
    enabled=1
    EOF

    yum clean all && yum makecache
    yum -y install glusterfs glusterfs-server glusterfs-fuse glusterfs-rdma
    systemctl start glusterd
    systemctl enable glusterd

    read -p "请输入主机名: " hn
    hostname $hn
    bash

    将脚本发送到其他三台在主机:

    scp gfsconf.sh 192.168.200.112:/root/

    scp gfsconf.sh 192.168.200.113:/root/

    scp gfsconf.sh 192.168.200.114:/root/

    四台主机执行

    bash gfsconf.sh 

    主机名分别为node1、node2、node3、node4

    到此步骤,四台主机环境已经搭建好。

    第五台机器操作:

    [root@localhost ~]# hostname client
    [root@localhost ~]# bash
    [root@client ~]#

    在所有机器操作:

    iptables -F
    systemctl stop firewalld
    setenforce 0

    安装软件
    在所有节点上执行以下操作
    [root@node1~]#yum-y install glusterfs glusterfs-server glusterfs-fuse glusterfs-rdma
    启动GlusterFS
    在所有节点上执行以下操作
    [root@node1~]#systemctl start glusterd
    [root@node1~l#systemctl enable glusterd 1
    Created symlink from/etc/systemd/system/multi-user.target.wants/glusterd.service to
    /usr/lib/systemd/system/glusterd.service.

    添加节点
    只在node1上执行操作,添加node1~node4节点
    [root@node1~]#gluster peer probe node1
    peer probe:success.Probe on localhost not needed#node1页可以不执行
    [root@node1~]#gluster peer probe node2
    peer probe:success.
    [root@node1~]#gluster peer probe node3
    peer probe:success.
    [root@node1~]#gluster peer probe node4
    peer probe:success.

    7、查看集群状态
    通过以下命令在每个节点上查看集群状态,正常情况下,每个节点的输出结果为,State: Peer in Cluster(Connected)。如果现实Disconnected,请检查hosts文件配置。
    [root@node1 ~]# gluster peer status
    Number of Peers: 3

    Hostname: node2
    Uuid: f0dd1524-da67-4c8d-9fd5-24a4dcb1aa2a
    State: Peer in Cluster (Connected)

    Hostname: node3
    Uuid: 3355d0ed-7089-4725-af68-dcfc327367b8
    State: Peer in Cluster (Connected)

    Hostname: node4
    Uuid: a8da5b05-c94f-42c1-8f3a-f8ebac06cc17
    State: Peer in Cluster (Connected)

    --------------------------------------------------------------------------------
    创建卷
    1、创建分布式卷
    [root@node1 ~]# gluster volume create dis-volume node1:/e6 node2:/e6 force
    volume create: dis-volume: success: please start the volume to access data
    [root@node1 ~]# gluster volume info dis-volume

    Volume Name: dis-volume
    Type: Distribute
    Volume ID: 1b97b4b4-5999-490f-b2bb-b290474b1dc6
    Status: Created
    Snapshot Count: 0
    Number of Bricks: 2
    Transport-type: tcp
    Bricks:
    Brick1: node1:/e6
    Brick2: node2:/e6
    Options Reconfigured:
    transport.address-family: inet
    nfs.disable: on
    [root@node1 ~]# gluster volume start dis-volume
    volume start: dis-volume: success
    没有执行类型,默认创建的是分布式卷。

    2、创建条带卷
    [root@node1 ~]# gluster volume create stripe-volume stripe 2 node1:/d5 node2:/d5 force
    volume create: stripe-volume: success: please start the volume to access data
    [root@node1 ~]# gluster volume info stripe-volume

    Volume Name: stripe-volume
    Type: Stripe
    Volume ID: 07cb5e43-d657-4a39-9a70-0bac746a3447
    Status: Created
    Snapshot Count: 0
    Number of Bricks: 1 x 2 = 2
    Transport-type: tcp
    Bricks:
    Brick1: node1:/d5
    Brick2: node2:/d5
    Options Reconfigured:
    transport.address-family: inet
    nfs.disable: on
    [root@node1 ~]# gluster volume start stripe-volume
    volume start: stripe-volume: success
    指定类型为stripe,数值为2,而且后面跟了2个Brick Server,所以创建的是条带卷。

    3、创建复制卷
    [root@node1 ~]# gluster volume create rep-volume replica 2 node3:/d5 node4:/d5 force
    volume create: rep-volume: success: please start the volume to access data
    [root@node1 ~]# gluster volume info rep-volume

    Volume Name: rep-volume
    Type: Replicate
    Volume ID: 8586ffaa-700b-4532-80ff-3f68fbeaebf9
    Status: Created
    Snapshot Count: 0
    Number of Bricks: 1 x 2 = 2
    Transport-type: tcp
    Bricks:
    Brick1: node3:/d5
    Brick2: node4:/d5
    Options Reconfigured:
    transport.address-family: inet
    nfs.disable: on
    [root@node1 ~]# gluster volume start rep-volume
    volume start: rep-volume: success
    指定类型为replica,数值为2,而且后面跟了2个Brick Server,所以创建的是复制卷。

    4、创建分布式条带卷
    [root@node1 ~]# gluster volume create dis-stripe stripe 2 node1:/b3 node2:/b3 node3:/b3 node4:/b3 force
    volume create: dis-stripe: success: please start the volume to access data
    [root@node1 ~]# gluster volume info dis-stripe

    Volume Name: dis-stripe
    Type: Distributed-Stripe
    Volume ID: 9575b910-e00a-4290-b3a7-5dfbe5bca210
    Status: Created
    Snapshot Count: 0
    Number of Bricks: 2 x 2 = 4
    Transport-type: tcp
    Bricks:
    Brick1: node1:/b3
    Brick2: node2:/b3
    Brick3: node3:/b3
    Brick4: node4:/b3
    Options Reconfigured:
    transport.address-family: inet
    nfs.disable: on
    [root@node1 ~]# gluster volume start dis-stripe
    volume start: dis-stripe: success
    指定类型为Distributed-Stripe,数值为2,而且后面跟了4个Brick Server,是2的2倍,所以创建的是分布式条带卷。

    5、创建分布式复制卷
    [root@node1 ~]# gluster volume create dis-rep replica 2 node1:/c4 node2:/c4 node3:/c4 node4:/c4 force
    volume create: dis-rep: success: please start the volume to access data
    [root@node1 ~]# gluster volume info dis-rep

    Volume Name: dis-rep
    Type: Distributed-Replicate
    Volume ID: e00678d3-fc48-4b8a-b50d-8fa9f36b1737
    Status: Created
    Snapshot Count: 0
    Number of Bricks: 2 x 2 = 4
    Transport-type: tcp
    Bricks:
    Brick1: node1:/c4
    Brick2: node2:/c4
    Brick3: node3:/c4
    Brick4: node4:/c4
    Options Reconfigured:
    transport.address-family: inet
    nfs.disable: on
    [root@node1 ~]# gluster volume start dis-rep
    volume start: dis-rep: success

    指定类型为Distributed-Replicate,数值为2,而且后面跟了4个Brick Server,是2的2倍,所以创建的是分布式复制卷。


    部署Gluster客户端
    1、安装客户端软件
    [root@client ~]# cat gfsconf.sh
    #!/bin/bash

    iptables -F
    systemctl stop firewalld
    setenforce 0

    cat << EOF >> /etc/hosts
    192.168.200.111 node1
    192.168.200.112 node2
    192.168.200.113 node3
    192.168.200.114 node4
    EOF

    cat << EOF >> /etc/yum.repos.d/gfs.repo
    [gfs]
    name=gfs
    baseurl=file:///gfs
    gpgcheck=0
    enabled=1
    EOF

    yum clean all && yum makecache
    yum -y install glusterfs glusterfs-fuse
    systemctl start glusterd
    systemctl enable glusterd

    read -p "请输入主机名: " hn
    hostname $hn
    bash

    2、创建挂载目录
    [root@client ~]# mkdir -p /test/{dis,stripe,rep,dis_and_stripe,dis_and_rep}
    [root@client ~]# ls /test/
    dis dis_and_rep dis_and_stripe rep stripe

    3、修改hosts文件
    [root@client ~]# tail -4 /etc/hosts
    192.168.200.111 node1
    192.168.200.112 node2
    192.168.200.113 node3
    192.168.200.114 node4

    4、挂载Gluster文件系统
    [root@client ~]# mount -t glusterfs node1:dis-volume /test/dis
    [root@client ~]# mount -t glusterfs node1:stripe-volume /test/stripe
    [root@client ~]# mount -t glusterfs node1:rep-volume /test/rep/
    [root@client ~]# mount -t glusterfs node1:dis-stripe /test/dis_and_stripe/
    [root@client ~]# mount -t glusterfs node1:dis-rep /test/dis_and_rep
    如果挂载不成功,请检查hosts解析。
    在挂载时,所指定的node1只是为了从它那里获取必要的配置信息,在挂载之后,客户机会与不仅仅是node1进行通信,也会直接和逻辑存储卷内其他Brick所在的主机进行通信。

    5、修改fstab配置文件
    cat << EOF >> /etc/fstab
    node1:dis-volume /test/dis glusterfs defaults,_netdev 0 0
    node1:stripe-volume /test/stripe glusterfs defaults,_netdev 0 0
    node1:rep-volume /test/rep glusterfs defaults,_netdev 0 0
    node1:dis-rep /test/dis_and_rep glusterfs defaults,_netdev 0 0
    node1:dis-stripe /test/dis_and_stripe glusterfs defaults,_netdev 0 0
    EOF

    测试Gluster文件系统
    1、卷中写入文件
    [root@client ~]# for i in {1..5};do dd if=/dev/zero of=/root/demon$i.log bs=1M count=43;done
    [root@client ~]# ls -lh demo*
    -rw-r--r-- 1 root root 43M 4月 2 12:13 demon1.log
    -rw-r--r-- 1 root root 43M 4月 2 12:13 demon2.log
    -rw-r--r-- 1 root root 43M 4月 2 12:13 demon3.log
    -rw-r--r-- 1 root root 43M 4月 2 12:13 demon4.log
    -rw-r--r-- 1 root root 43M 4月 2 12:13 demon5.log

    cp demon* /test/dis
    cp demon* /test/stripe/
    cp demon* /test/rep
    cp demon* /test/dis_and_stripe
    cp demon* /test/dis_and_rep

    2、查看文件分布
    下面查看分布式卷文件分布:
    [root@node1 ~]# ll -h /e6/ //没有分片,原始大小43M
    总用量 130M
    -rw-r--r-- 2 root root 43M 4月 2 12:14 demon1.log
    -rw-r--r-- 2 root root 43M 4月 2 12:14 demon3.log
    -rw-r--r-- 2 root root 43M 4月 2 12:14 demon4.log

    [root@node2 ~]# ll -h /e6/ //没有分片,原始大小43M
    总用量 87M
    -rw-r--r-- 2 root root 43M 4月 2 12:14 demon2.log
    -rw-r--r-- 2 root root 43M 4月 2 12:14 demon5.log

    下面查看条带卷文件分布:
    [root@node1 ~]# ll -h /d5 //大小被分片成22M
    总用量 108M
    -rw-r--r-- 2 root root 22M 4月 2 12:14 demon1.log
    -rw-r--r-- 2 root root 22M 4月 2 12:14 demon2.log
    -rw-r--r-- 2 root root 22M 4月 2 12:14 demon3.log
    -rw-r--r-- 2 root root 22M 4月 2 12:14 demon4.log
    -rw-r--r-- 2 root root 22M 4月 2 12:14 demon5.log

    [root@node2 ~]# ll -h /d5 //大小被分片成22M
    总用量 108M
    -rw-r--r-- 2 root root 22M 4月 2 12:14 demon1.log
    -rw-r--r-- 2 root root 22M 4月 2 12:14 demon2.log
    -rw-r--r-- 2 root root 22M 4月 2 12:14 demon3.log
    -rw-r--r-- 2 root root 22M 4月 2 12:14 demon4.log
    -rw-r--r-- 2 root root 22M 4月 2 12:14 demon5.log

    下面查看复制卷文件分布:
    [root@node3 ~]# ll -h /d5 //没有分片,原始大小43M
    总用量 216M
    -rw-r--r-- 2 root root 43M 4月 2 12:14 demon1.log
    -rw-r--r-- 2 root root 43M 4月 2 12:14 demon2.log
    -rw-r--r-- 2 root root 43M 4月 2 12:14 demon3.log
    -rw-r--r-- 2 root root 43M 4月 2 12:14 demon4.log
    -rw-r--r-- 2 root root 43M 4月 2 12:14 demon5.log

    [root@node4 ~]# ll -h /d5 //没有分片,原始大小43M
    总用量 216M
    -rw-r--r-- 2 root root 43M 4月 2 12:14 demon1.log
    -rw-r--r-- 2 root root 43M 4月 2 12:14 demon2.log
    -rw-r--r-- 2 root root 43M 4月 2 12:14 demon3.log
    -rw-r--r-- 2 root root 43M 4月 2 12:14 demon4.log
    -rw-r--r-- 2 root root 43M 4月 2 12:14 demon5.log

    下面查看分布式条带卷文件分布:
    [root@node1 ~]# ll -h /b3 //大小被分片成22M
    总用量 65M
    -rw-r--r-- 2 root root 22M 4月 2 12:14 demon1.log
    -rw-r--r-- 2 root root 22M 4月 2 12:14 demon3.log
    -rw-r--r-- 2 root root 22M 4月 2 12:14 demon4.log

    [root@node2 ~]# ll -h /b3 //大小被分片成22M
    总用量 65M
    -rw-r--r-- 2 root root 22M 4月 2 12:14 demon1.log
    -rw-r--r-- 2 root root 22M 4月 2 12:14 demon3.log
    -rw-r--r-- 2 root root 22M 4月 2 12:14 demon4.log

    [root@node3 ~]# ll -h /b3 //大小被分片成22M
    总用量 44M
    -rw-r--r-- 2 root root 22M 4月 2 12:14 demon2.log
    -rw-r--r-- 2 root root 22M 4月 2 12:14 demon5.log

    [root@node4 ~]# ll -h /b3 //大小被分片成22M
    总用量 44M
    -rw-r--r-- 2 root root 22M 4月 2 12:14 demon2.log
    -rw-r--r-- 2 root root 22M 4月 2 12:14 demon5.log

    下面查看分布式复制卷文件分布:
    [root@node1 ~]# ll -h /c4 //没有分片,原始大小43M
    总用量 130M
    -rw-r--r-- 2 root root 43M 4月 2 12:14 demon1.log
    -rw-r--r-- 2 root root 43M 4月 2 12:14 demon3.log
    -rw-r--r-- 2 root root 43M 4月 2 12:14 demon4.log

    [root@node2 ~]# ll -h /c4 //没有分片,原始大小43M
    总用量 130M
    -rw-r--r-- 2 root root 43M 4月 2 12:14 demon1.log
    -rw-r--r-- 2 root root 43M 4月 2 12:14 demon3.log
    -rw-r--r-- 2 root root 43M 4月 2 12:14 demon4.log

    [root@node3 ~]# ll -h /c4 //没有分片,原始大小43M
    总用量 87M
    -rw-r--r-- 2 root root 43M 4月 2 12:14 demon2.log
    -rw-r--r-- 2 root root 43M 4月 2 12:14 demon5.log

    [root@node4 ~]# ll -h /c4 //没有分片,原始大小43M
    总用量 87M
    -rw-r--r-- 2 root root 43M 4月 2 12:14 demon2.log
    -rw-r--r-- 2 root root 43M 4月 2 12:14 demon5.log

    3、破坏性测试
    挂起node2节点,在客户端上测试文件是否可以正常使用。

    测试分布式卷数据是否可以正常访问:
    [root@client ~]# head -1 /test/dis/demon1.log
    [root@client ~]# head -1 /test/dis/demon2.log
    head: 无法打开"/test/dis/demon2.log" 读取数据: 没有那个文件或目录
    [root@client ~]# head -1 /test/dis/demon3.log
    [root@client ~]# head -1 /test/dis/demon4.log
    [root@client ~]# head -1 /test/dis/demon5.log
    head: 无法打开"/test/dis/demon5.log" 读取数据: 没有那个文件或目录
    分布在node2节点上的demon2.log和demon5.log 无法访问,分布式卷不具备冗余性

    测试条带卷数据是否可以正常访问:
    [root@client ~]# head -1 /test/stripe/demon1.log
    head: 读取"/test/stripe/demon1.log" 时出错: 没有那个文件或目录
    [root@client ~]# head -1 /test/stripe/demon2.log
    head: 读取"/test/stripe/demon2.log" 时出错: 没有那个文件或目录
    [root@client ~]# head -1 /test/stripe/demon3.log
    head: 读取"/test/stripe/demon3.log" 时出错: 没有那个文件或目录
    [root@client ~]# head -1 /test/stripe/demon4.log
    head: 读取"/test/stripe/demon4.log" 时出错: 没有那个文件或目录
    [root@client ~]# head -1 /test/stripe/demon5.log
    head: 读取"/test/stripe/demon5.log" 时出错: 没有那个文件或目录
    node2节点挂起后,所有数据全部丢失

    测试分布式条带卷数据是否可以访问:
    [root@client ~]# head -1 /test/dis_and_stripe/demon1.log
    head: 读取"/test/dis_and_stripe/demon1.log" 时出错: 没有那个文件或目录
    [root@client ~]# head -1 /test/dis_and_stripe/demon2.log
    [root@client ~]# head -1 /test/dis_and_stripe/demon3.log
    head: 读取"/test/dis_and_stripe/demon3.log" 时出错: 没有那个文件或目录
    [root@client ~]# head -1 /test/dis_and_stripe/demon4.log
    head: 读取"/test/dis_and_stripe/demon4.log" 时出错: 没有那个文件或目录
    [root@client ~]# head -1 /test/dis_and_stripe/demon5.log
    node2节点挂起后,分布在node1和node2节点的数据丢失,而分布在node3和node4节点的数据不丢失

    测试分布式复制卷数据是否可以访问:
    [root@client ~]# head -1 /test/dis_and_rep/demon1.log
    [root@client ~]# head -1 /test/dis_and_rep/demon2.log
    [root@client ~]# head -1 /test/dis_and_rep/demon3.log
    [root@client ~]# head -1 /test/dis_and_rep/demon4.log
    [root@client ~]# head -1 /test/dis_and_rep/demon5.log
    node2节点挂起后,数据不丢失

    继续挂起node4节点,在客户端上测试文件是否可以正常使用。
    测试复制卷数据是否可以访问:
    [root@client ~]# head -1 /test/rep/demon1.log
    [root@client ~]# head -1 /test/rep/demon2.log
    [root@client ~]# head -1 /test/rep/demon3.log
    [root@client ~]# head -1 /test/rep/demon4.log
    [root@client ~]# head -1 /test/rep/demon5.log
    node2和node4节点挂起后,数据不丢失

    测试分布式条带卷数据是否可以访问:
    [root@client ~]# head -1 /test/dis_and_stripe/demon1.log
    head: 读取"/test/dis_and_stripe/demon1.log" 时出错: 没有那个文件或目录
    [root@client ~]# head -1 /test/dis_and_stripe/demon2.log
    head: 读取"/test/dis_and_stripe/demon2.log" 时出错: 没有那个文件或目录
    [root@client ~]# head -1 /test/dis_and_stripe/demon3.log
    head: 读取"/test/dis_and_stripe/demon3.log" 时出错: 没有那个文件或目录
    [root@client ~]# head -1 /test/dis_and_stripe/demon4.log
    head: 读取"/test/dis_and_stripe/demon4.log" 时出错: 没有那个文件或目录
    [root@client ~]# head -1 /test/dis_and_stripe/demon5.log
    head: 读取"/test/dis_and_stripe/demon5.log" 时出错: 没有那个文件或目录
    node2和node4节点挂起后,数据丢失

    测试分布式复制卷数据是否可以访问:
    [root@client ~]# tail -1 /test/dis_and_rep/demon1.log
    [root@client ~]# tail -1 /test/dis_and_rep/demon2.log
    [root@client ~]# tail -1 /test/dis_and_rep/demon3.log
    [root@client ~]# tail -1 /test/dis_and_rep/demon4.log
    [root@client ~]# tail -1 /test/dis_and_rep/demon5.log
    node2和node4节点挂起后,数据不丢失


    其他的维护命令
    1、查看GlusterFS卷
    [root@node1 ~]# gluster volume list //查看卷的列表
    dis-rep
    dis-stripe
    dis-volume
    rep-volume
    stripe-volume

    [root@node1 ~]# gluster volume info //查看所有卷的信息

    Volume Name: dis-rep
    Type: Distributed-Replicate
    Volume ID: e00678d3-fc48-4b8a-b50d-8fa9f36b1737
    Status: Started
    Snapshot Count: 0
    Number of Bricks: 2 x 2 = 4
    Transport-type: tcp
    Bricks:
    Brick1: node1:/c4
    Brick2: node2:/c4
    Brick3: node3:/c4
    Brick4: node4:/c4
    Options Reconfigured:
    transport.address-family: inet
    nfs.disable: on

    Volume Name: dis-stripe
    Type: Distributed-Stripe
    Volume ID: 9575b910-e00a-4290-b3a7-5dfbe5bca210
    Status: Started
    Snapshot Count: 0
    Number of Bricks: 2 x 2 = 4
    Transport-type: tcp
    Bricks:
    Brick1: node1:/b3
    Brick2: node2:/b3
    Brick3: node3:/b3
    Brick4: node4:/b3
    Options Reconfigured:
    transport.address-family: inet
    nfs.disable: on
    ......

    [root@node1 ~]# gluster volume status //查看卷的状态
    Status of volume: dis-rep
    Gluster process TCP Port RDMA Port Online Pid
    ------------------------------------------------------------------------------
    Brick node1:/c4 49155 0 Y 2168
    Brick node2:/c4 49155 0 Y 2027
    Brick node3:/c4 49154 0 Y 1848
    Brick node4:/c4 49154 0 Y 1861
    Self-heal Daemon on localhost N/A N/A Y 2188
    Self-heal Daemon on node3 N/A N/A Y 1868
    Self-heal Daemon on node2 N/A N/A Y 2047
    Self-heal Daemon on node4 N/A N/A Y 1881
    ......


    2、停止/删除卷
    [root@node1 ~]# gluster volume stop dis-stripe
    Stopping volume will make its data inaccessible. Do you want to continue? (y/n) y
    volume stop: dis-stripe: success
    [root@node1 ~]# gluster volume delete dis-stripe
    Deleting volume will erase all information about the volume. Do you want to continue? (y/n) y
    volume delete: dis-stripe: failed: Some of the peers are down

    3、设置卷的访问控制
    下面只允许192.168.200.0和10.1.1.0网段的客户端访问dis-rep卷。

  • 相关阅读:
    简单区间dp
    【题解】石子合并
    【2019.7.6】刷题记录
    【题解】大朋友的数字
    【基础】dp系列1
    【题解】垃圾陷阱
    【题解】导弹拦截
    hadoop各组件安装(非专业人士,不定期更新)
    python逼格提升
    python第三十二天-----算法
  • 原文地址:https://www.cnblogs.com/2567xl/p/11834555.html
Copyright © 2020-2023  润新知