1788
Comment:
|
← Revision 17 as of 2021-03-26 21:20:49 ⇥
2230
|
Deletions are marked like this. | Additions are marked like this. |
Line 18: | Line 18: |
A regular fstab entry with an IP-address for one of the GlustarFS servers can be added, but if that specific server is down when we attempt to mount the GlusterFS volume, then it will fail. Instead we will create a file that describes how to mount the volume. | A regular fstab entry with an IP-address for one of the GlusterFS servers can be added, but if that specific server is down when we attempt to mount the GlusterFS volume, then it will fail. Instead we will create a file that describes how to mount the volume. |
Line 24: | Line 24: |
Create the `www.vol` file. | Create the file `/etc/glusterfs/www.vol` and add the servers. |
Line 47: | Line 47: |
volume remote4 type protocol/client option transport-type tcp option remote-host gluster04 option remote-subvolume /srv/www/brick end-volume |
|
Line 56: | Line 49: |
subvolumes remote1 remote2 remote3 remote4 | subvolumes remote1 remote2 remote3 |
Line 67: | Line 60: |
option cache-size 512MB | option cache-size 64MB |
Line 72: | Line 65: |
=== Modules === Add the fuse modules to `/etc/modules`. If you do not add this, then the mountpoint will not be mounted automatically when the client is rebooted. {{{ fuse }}} === Network === The default network setting is `allow-hotplug`. That means that the init process will continue and the interface will get an IP-address eventually. That is not good if the system tries to mount the GlusterFS volume before the network is up. Edit `/etc/network/interfaces` and replace {{{ allow-hotplug eth0 }}} with {{{ auto eth0 }}} |
|
Line 73: | Line 81: |
Add the following th `/etc/fstab`. | Add the following to `/etc/fstab`. |
Line 77: | Line 85: |
=== Mount the Volume === {{{ mount /srv/www }}} |
GlusterFS Client
Software
Installation
Install the glusterfs client.
apt-get install glusterfs-client
Mount Point
Create the mount point.
mkdir /srv/www
Volume File
A regular fstab entry with an IP-address for one of the GlusterFS servers can be added, but if that specific server is down when we attempt to mount the GlusterFS volume, then it will fail. Instead we will create a file that describes how to mount the volume.
mkdir /etc/glusterfs
Create the file /etc/glusterfs/www.vol and add the servers.
volume remote1 type protocol/client option transport-type tcp option remote-host gluster01 option remote-subvolume /srv/www/brick end-volume volume remote2 type protocol/client option transport-type tcp option remote-host gluster02 option remote-subvolume /srv/www/brick end-volume volume remote3 type protocol/client option transport-type tcp option remote-host gluster03 option remote-subvolume /srv/www/brick end-volume volume replicate type cluster/replicate subvolumes remote1 remote2 remote3 end-volume volume writebehind type performance/write-behind option window-size 1MB subvolumes replicate end-volume volume cache type performance/io-cache option cache-size 64MB subvolumes writebehind end-volume
Modules
Add the fuse modules to /etc/modules. If you do not add this, then the mountpoint will not be mounted automatically when the client is rebooted.
fuse
Network
The default network setting is allow-hotplug. That means that the init process will continue and the interface will get an IP-address eventually. That is not good if the system tries to mount the GlusterFS volume before the network is up. Edit /etc/network/interfaces and replace
allow-hotplug eth0
with
auto eth0
fstab
Add the following to /etc/fstab.
/etc/glusterfs/www.vol /srv/www glusterfs defaults,_netdev,rw 0 0
Mount the Volume
mount /srv/www