How to create a replicated glusterfs volume?
-
Do this from only one of the nodes in the gluster cluster.
Make the directory for the volume under the brick
gluster1> mkdir -p /data/brick1/gv0
Create the volume
gluster1> gluster volume create gv0 replica 2 server1:/data/brick1/gv0 ip-server2:/data/brick1/gv0 volume create: gv0: success: please start the volume to access data
Start the volume
gluster1> gluster volume start gv0 volume start: gv0: success
Check the status of the volume
gluster1> gluster volume info Volume Name: gv0 Type: Replicate Volume ID: e4454eb2-b87f-4855-bb3e-5ee1b72c169d Status: Started Snapshot Count: 0 Number of Bricks: 1 x 2 = 2 Transport-type: tcp Bricks: Brick1: server1:/data/brick1/gv0 Brick2: server2:/data/brick1/gv0 Options Reconfigured: transport.address-family: inet performance.readdir-ahead: on nfs.disable: on
The client can use either Gluster Native Client (FUSE) or NFSv3 see link: http://gluster.readthedocs.io/en/latest/Administrator Guide/Setting Up Clients/
Mount the gluster volume on a client.gluster1> mount -t glusterfs server1:/gv0 /mnt
Create test file(s)
gluster1> pwd /mnt gluster1> touch myfile gluster1> ls -l total 0 -rw-r--r--. 1 root root 0 Jan 31 05:00 myfile
Check the glusterfs mount points - on both nodes
gluster1> ls -la /data/brick1/gv0/ total 0 drwxr-xr-x. 4 root root 55 Jan 31 05:00 . drwxr-xr-x. 3 root root 17 Jan 31 04:46 .. drw-------. 9 root root 178 Jan 31 05:00 .glusterfs -rw-r--r--. 2 root root 0 Jan 31 05:00 myfile drwxr-xr-x. 3 root root 25 Jan 31 04:49 .trashcan gluster2> ls -la /data/brick1/gv0/ total 0 drwxr-xr-x. 4 root root 55 Jan 31 05:00 . drwxr-xr-x. 3 root root 17 Jan 31 04:46 .. drw-------. 9 root root 178 Jan 31 05:00 .glusterfs -rw-r--r--. 2 root root 0 Jan 31 05:00 myfile drwxr-xr-x. 3 root root 25 Jan 31 04:49 .trashcan
© Lightnetics 2024