...
Install GlusterFS server
Code Block yum install -y glusterfs-server restorecon /var/run/glusterd.socket service glusterd start
- Set up connectivity
On the new node, connect to all the previous cluster nodes with the following commands (repeated once for every node):
Code Block gluster peer probe 10.1.87.10 gluster peer probe 10.1.87.11
On all previous nodes execute the following command (with the IP of the new server that is being added):
Code Block gluster peer probe 10.1.87.12
Create or extend the volume
If this is the first installation, then create the cluster file system. For fresh installations steps 1-2 can be executed on all the servers first, to then execute the "volume create" command here just once.
Code Block gluster volume create gv0 replica 2 10.1.87.10:/var/lib/squirro/storage/gv0/brick0 10.1.87.11:/var/lib/squirro/storage/gv0/brick0 10.1.87.12:/var/lib/squirro/storage/gv0/brick0 force gluster volume start gv0
Repeat the IP/directory part of the command for every cluster node, both the previous ones as well as the new one.
Thereplica 2
option can be modified to indicate how many replicas should be kept of each file. The force option at the end confirms that we are okay to create the volume on the linux system's root file system partition.
If this is a new server, being added to an existing GlusterFS installation, then execute this command to use this server for the volume:
Code Block gluster volume add-brick gv0 10.1.87.12:/var/lib/squirro/storage/gv0/brick0 force
The force option at the end confirms that we are okay to create the volume on the linux system's root file system partition.
Configure the cluster storage volume to be mounted. Add the following line to
/etc/fstab
:Code Block language text title /etc/fstab (excerpt) 127.0.0.1:/gv0 /mnt/gv0 glusterfs defaults 0 0
Then create the mount-point and mount the new file system:
Code Block mkdir -p /mnt/gv0 mount /mnt/gv0
Set up all the required directories in the shared file system:
Code Block install -o sqprovid -g squirro -d /mnt/gv0/storage install -o sqsqirrl -g squirro -d /mnt/gv0/squirrel_log install -o sqplumbr -g squirro -d /mnt/gv0/pipelets install -o sqfile -g squirro -d /mnt/gv0/fileimport install -o sqfile -g squirro -d /mnt/gv0/fileimport/uploads install -o sqtrends -g squirro -d /mnt/gv0/trends_data install -o sqtopic -g squirro -d /mnt/gv0/assets install -o sqtopic -g squirro -d /mnt/gv0/widgets
Change the configuration of the various Squirro services to point to the right folder. Below you see for each config file the desired sections and values - all the values that have been left out here should be left unmodified.
Code Block language text title /etc/squirro/storage.ini (excerpt) [storage] default_bucket = cluster
Code Block language text title /etc/squirro/squirrel.ini (excerpt) [storage] directory = /mnt/gv0/squirrel_log/ url_prefix = /storage/cluster/squirrel_log/
Code Block language text title /etc/squirro/plumber.ini (excerpt) [storage] directory = /mnt/gv0/pipelets/
Code Block language text title /etc/squirro/topic.ini (excerpt) [topic] custom_assets_directory = /mnt/gv0/widgetsassets/ custom_widgets_directory = /mnt/gv0/widgets/
Code Block language text title /etc/squirro/trends.ini (excerpt) [offline_processing] data_directory = /mnt/gv0/trends_data
Replace the previous assets and widgets folders with symlinks:
Code Block rm -ir /var/lib/squirro/topic/assets rm -ir /var/lib/squirro/topic/widgets ln -s /mnt/gv0/assets /var/lib/squirro/topic/assets ln -s /mnt/gv0/widgets /var/lib/squirro/topic/widgets
- In the nginx config file
/etc/nginx/conf.d/frontend.conf
change a few of thealias
declarations:- Inside the
location /storage/localfile/
block change the alias from its default toalias /mnt/gv0/storage/
- Inside the
location /storage/squirrel_log
block change the alias from its default toalias /mnt/gv0/squirrel_log/
Verify that the configuration is still valid:
Code Block nginx -t
Reload the nginx configuration:
Code Block service nginx reload
- Inside the
Restart all services:
Code Block monit -g all-active restart