Skip to content

Instantly share code, notes, and snippets.

@skpy
Last active August 29, 2015 14:06
Show Gist options
  • Save skpy/29cf2a4fe334cd2a142b to your computer and use it in GitHub Desktop.
Save skpy/29cf2a4fe334cd2a142b to your computer and use it in GitHub Desktop.

A simple distributed replicated Gluster volume:

root@p1:DEVELOPMENT:~> gluster volume info g0

Volume Name: g0
Type: Distributed-Replicate
Volume ID: 9b3eb30d-9faf-44fd-8225-afc3f21fbfec
Status: Stopped
Number of Bricks: 2 x 2 = 4
Transport-type: tcp
Bricks:
Brick1: p1.dev:/bricks/brick1/brick
Brick2: p2.dev:/bricks/brick1/brick
Brick3: p1.dev:/bricks/brick2/brick
Brick4: p2.dev:/bricks/brick2/brick
Options Reconfigured:
nfs.disable: true
server.allow-insecure: true

Let's enable worm:

root@p1:DEVELOPMENT:~> gluster volume set g0 features.worm enable
volume set: success
root@p1:DEVELOPMENT:~> gluster volume info g0

Volume Name: g0
Type: Distributed-Replicate
Volume ID: 9b3eb30d-9faf-44fd-8225-afc3f21fbfec
Status: Stopped
Number of Bricks: 2 x 2 = 4
Transport-type: tcp
Bricks:
Brick1: p1.dev:/bricks/brick1/brick
Brick2: p2.dev:/bricks/brick1/brick
Brick3: p1.dev:/bricks/brick2/brick
Brick4: p2.dev:/bricks/brick2/brick
Options Reconfigured:
features.worm: enable
nfs.disable: true
server.allow-insecure: true

Great. Now let's start the volume and mount it:

root@p1:DEVELOPMENT:~> gluster volume start g0
volume start: g0: success
root@p1:DEVELOPMENT:~> grep gluster /etc/fstab
p1.dev:/g0	/mnt	glusterfs	_netdev,defaults	0	0
root@p1:DEVELOPMENT:~> mount /mnt
root@p1:DEVELOPMENT:~>

So far so good. But now when we try to write to the volume....

root@p1:DEVELOPMENT:~> touch /mnt/foo
touch: cannot touch `/mnt/foo': Read-only file system
root@p1:DEVELOPMENT:~> cp /etc/redhat-release /mnt
cp: cannot create regular file `/mnt/redhat-release': Read-only file system
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment