3.3然后执行以下命令(只需要在其中一台服务器上执行即可,本例使用118):
[iyunv@server1 ~]# gluster volume create gv0 replica 2 192.168.99.118:/data/gfsdata 192.168.99.119:/data/gfsdatavolume create: gv0: success: please start the volume to access data
这条命令的意思是使用Replicated的方式,建立一个名为gv0的卷(Volume),存储块(Brick)为2个,分别为server1:/data/gfsdata和server2:/data/gfsdata
volume create: testglustervol: failed: The brick 192.168.21.19:/data0/gluster1/brick1 is being created in the root partition. It is recommended that you don't use the system's root partition for storage backend. Or use 'force' at the end of the command if you want to override this behavior.
发现报错了,这是因为我们创建的brick在系统盘,这个在gluster的默认情况下是不允许的,生产环境下也尽可能的与系统盘分开,如果必须这样请使用force
[iyunv@server1 ~]# gluster volume create gv0 replica 2 192.168.99.118:/data/gfsdata 192.168.99.119:/data/gfsdata forcevolume create: gv0: success: please start the volume to access data
//条带化
gluster volume create gv0 stripe 2 192.168.99.118:/data/gfsdata 192.168.99.119:/data/gfsdata
3.4启用GlusterFS逻辑卷:
[iyunv@node1 ~]# gluster volume start gv0
volume start: gv0: success
[iyunv@node1 ~]# gluster volume info
Volume Name: gv0
Type: Replicate
Volume ID: fcdb6b69-f5b0-44d7-be73-5544dd85a91c
Status: Started
Snapshot Count: 0
Number of Bricks: 1 x 2 = 2
Transport-type: tcp
Bricks:
Brick1: 192.168.99.118:/data/gfsdata
Brick2: 192.168.99.119:/data/gfsdata
Options Reconfigured:
transport.address-family: inet
nfs.disable: on
//GlusterFS逻辑卷当前信息
[iyunv@master ~]# gluster volume info
Volume Name: gv0
Type: Distribute
Volume ID: f7e47eef-f1e3-44b6-af78-4e4f5329e7f8
Status: Started
Snapshot Count: 0
Number of Bricks: 3
Transport-type: tcp
Bricks:
Brick1: 192.168.99.118:/data/gfsdata
Brick2: 192.168.99.119:/data/gfsdata
Brick3: 192.168.99.117:/data/glusterfs
Options Reconfigured:
nfs.disable: on
transport.address-family: inet
[iyunv@node1 ~]# gluster volume status gv0
Status of volume: gv0
Gluster process TCP Port RDMA Port Online Pid
------------------------------------------------------------------------------
Brick 192.168.99.118:/data/gfsdata 49153 0 Y 19843
Brick 192.168.99.119:/data/gfsdata 49153 0 Y 4848
Task Status of Volume gv0
------------------------------------------------------------------------------
There are no active volume tasks