|
| 1 | +# Setting up GlusterFS Volumes |
| 2 | + |
| 3 | +The commands that differ with GD2 are mentioned in this doc. For info about volume types and so on you can refer [here](https://docs.gluster.org/en/latest/Administrator%20Guide/Setting%20Up%20Volumes/) |
| 4 | + |
| 5 | +## Creating New Volumes: |
| 6 | + |
| 7 | +### Creating Distributed Volumes |
| 8 | + |
| 9 | + `# glustercli volume create --name <VOLNAME> <UUID1>:<brick1> .. <UUIDn>:<brickm> ` |
| 10 | + |
| 11 | + where n is the number of servers and m is the number of bricks. n and m can be same or m can be more than n. |
| 12 | + |
| 13 | + For example, a four node distributed volume: |
| 14 | + |
| 15 | + # glustercli volume create --name testvol server1:/export/brick1/data server2:/export/brick2/data server3:/export/brick3/data server4:/export/brick4/data |
| 16 | + testvol Volume created successfully |
| 17 | + Volume ID: 15c1611d-aae6-44f0-ae8d-fa04f31f5c99 |
| 18 | + |
| 19 | +### Creating Replicated Volumes |
| 20 | + |
| 21 | + `# glustercli volume create --name <VOLNAME> --replica <count> <UUID1>:<brick1> .. <UUIDn>:<brickm>` |
| 22 | + |
| 23 | + where n is the server count and m is the number of bricks. |
| 24 | + |
| 25 | + For example, to create a replicated volume with two storage servers: |
| 26 | + |
| 27 | + # glustercli volume create testvol server1:/exp1 server2:/exp2 --replica 2 |
| 28 | + testvol Volume created successfully |
| 29 | + Volume ID: 15c1611d-aae6-44f0-ae8d-fa04f31f5c99 |
| 30 | + |
| 31 | + > **Note**: |
| 32 | + |
| 33 | + > - GlusterD2 creates a replicate volume if more than one brick of a replica set is present on the same peer. For eg. a four node replicated volume where more than one brick of a replica set is present on the same peer. |
| 34 | + > |
| 35 | + |
| 36 | + > # glustercli volume create --name <VOLNAME> --replica 4 server1:/brick1 server1:/brick2 server2:/brick2 server3:/brick3 |
| 37 | + > <VOLNAME> Volume created successfully |
| 38 | + > Volume ID: 15c1611d-aae6-44f0-ae8d-fa04f31f5c99 |
| 39 | + |
| 40 | +### Arbiter configuration for replica volumes |
| 41 | + |
| 42 | + '# glustercli volume create <VOLNAME> --replica 2 --arbiter 1 <UUID1>:<brick1> <UUID2>:<brick2> <UUID3>:<brick3>' |
| 43 | + |
| 44 | +>**Note:** |
| 45 | +> |
| 46 | +> 1) It is mentioned as replica 2 and not replica 3 even though there are 3 replicas (arbiter included). |
| 47 | +> 2) The arbiter configuration for replica 3 can be used to create distributed-replicate volumes as well. |
| 48 | +
|
| 49 | +## Creating Distributed Replicated Volumes |
| 50 | + |
| 51 | + `# glustercli volume create --name <VOLNAME> <UUID1>:<brick1> .. <UUIDn>:<brickm> --replica <count> ` |
| 52 | + |
| 53 | + where n is the number of servers and m is the number of bricks. |
| 54 | + |
| 55 | + For example, a four node distributed (replicated) volume with a |
| 56 | + two-way mirror: |
| 57 | + |
| 58 | + # glustercli volume create --name testvol server1:/export/brick1/data server2:/export/brick2/data server1:/export/brick3/data server2:/export/brick4/data --replica 2 |
| 59 | + testvol Volume created successfully |
| 60 | + Volume ID: 15c1611d-aae6-44f0-ae8d-fa04f31f5c99 |
| 61 | + |
| 62 | + For example, to create a six node distributed (replicated) volume |
| 63 | + with a two-way mirror: |
| 64 | + |
| 65 | + # glustercli volume create testvol server1:/exp1 server2:/exp2 server3:/exp3 server4:/exp4 server5:/exp5 server6:/exp6 --replica 2 |
| 66 | + testvol Volume created successfully |
| 67 | + Volume ID: 15c1611d-aae6-44f0-ae8d-fa04f31f5c99 |
| 68 | + |
| 69 | + > **Note**: |
| 70 | + |
| 71 | + > - GlusterD2 creates a distribute replicate volume if more than one brick of a replica set is present on the same peer. For eg. for a four node distribute (replicated) volume where more than one brick of a replica set is present on the same peer. |
| 72 | + > |
| 73 | + |
| 74 | + > # glustercli volume create --name <volname> --replica 2 server1:/brick1 server1:/brick2 server2:/brick3 server2:/brick4 |
| 75 | + > <VOLNAME> Volume created successfully |
| 76 | + > Volume ID: 15c1611d-aae6-44f0-ae8d-fa04f31f5c99 |
| 77 | + |
| 78 | + |
| 79 | +## Creating Dispersed Volumes |
| 80 | + |
| 81 | + `# glustercli volume create --name <VOLNAME> --disperse <COUNT> <UUID1>:<brick1> .. <UUIDn>:<brickm>` |
| 82 | + |
| 83 | + For example, a four node dispersed volume: |
| 84 | + |
| 85 | + # glustercli volume create --name testvol --dispersed 4 server{1..4}:/export/brick/data |
| 86 | + testvol Volume created successfully |
| 87 | + Volume ID: 15c1611d-aae6-44f0-ae8d-fa04f31f5c99 |
| 88 | + |
| 89 | + For example, to create a six node dispersed volume: |
| 90 | + |
| 91 | + # glustercli volume create testvol --disperse 6 server{1..6}:/export/brick/data |
| 92 | + testvol Volume created successfully |
| 93 | + Volume ID: 15c1611d-aae6-44f0-ae8d-fa04f31f5c99 |
| 94 | + |
| 95 | + The redundancy count is automatically set as 2 here. |
| 96 | + |
| 97 | +## Creating Distributed Dispersed Volumes |
| 98 | + |
| 99 | + `# glustercli volume create --name <VOLNAME> --disperse <COUNT> <UUID1>:<brick1> .. <UUIDn>:<brickm>` |
| 100 | + |
| 101 | + For example, to create a six node dispersed volume: |
| 102 | + |
| 103 | + # glustercli volume create testvol --disperse 3 server1:/export/brick/data{1..6} |
| 104 | + testvol Volume created successfully |
| 105 | + Volume ID: 15c1611d-aae6-44f0-ae8d-fa04f31f5c99 |
| 106 | + |
| 107 | + |
| 108 | +## Starting Volumes |
| 109 | + |
| 110 | +You must start your volumes before you try to mount them. |
| 111 | + |
| 112 | +**To start a volume** |
| 113 | + |
| 114 | +- Start a volume: |
| 115 | + |
| 116 | + `# glustercli volume start <VOLNAME>` |
| 117 | + |
| 118 | + For example, to start test-volume: |
| 119 | + |
| 120 | + # glustercli volume start testvol |
| 121 | + Volume testvol started successfully |
0 commit comments