summaryrefslogtreecommitdiffstats
path: root/Fedora/gluster-brickmultiplex.sh
diff options
context:
space:
mode:
authorHumble Devassy Chirammal <humble.devassy@gmail.com>2017-11-28 17:23:27 +0530
committerGitHub <noreply@github.com>2017-11-28 17:23:27 +0530
commit9a29c12bcaec4d68d35fbfdc634d5e60cd5154ce (patch)
tree4f25c9429eabae74a924ae9596dcba879a6667c3 /Fedora/gluster-brickmultiplex.sh
parentc1b18923604acad7456dbac367382c3fa2def29c (diff)
parent5588a0f2448cb855fb8df8cba772dc548c9770d3 (diff)
downloadgluster-9a29c12bcaec4d68d35fbfdc634d5e60cd5154ce.tar.gz
gluster-9a29c12bcaec4d68d35fbfdc634d5e60cd5154ce.tar.bz2
gluster-9a29c12bcaec4d68d35fbfdc634d5e60cd5154ce.tar.xz
gluster-9a29c12bcaec4d68d35fbfdc634d5e60cd5154ce.zip
Merge pull request #59 from jarrpa/fedora-update
Bring Fedora image up to date.
Diffstat (limited to 'Fedora/gluster-brickmultiplex.sh')
-rw-r--r--Fedora/gluster-brickmultiplex.sh74
1 files changed, 74 insertions, 0 deletions
diff --git a/Fedora/gluster-brickmultiplex.sh b/Fedora/gluster-brickmultiplex.sh
new file mode 100644
index 0000000..968a3e2
--- /dev/null
+++ b/Fedora/gluster-brickmultiplex.sh
@@ -0,0 +1,74 @@
+#!/bin/bash
+
+###
+# Description: Script to enable brick multiplexing in gluster.
+# Copyright (c) 2017 Red Hat, Inc. <http://www.redhat.com>
+#
+# This file is part of GlusterFS.
+#
+# This file is licensed to you under your choice of the GNU Lesser
+# General Public License, version 3 or any later version (LGPLv3 or
+# later), or the GNU General Public License, version 2 (GPLv2), in all
+# cases as published by the Free Software Foundation.
+###
+
+main () {
+ GLUSTERFS_CONF_DIR="/etc/glusterfs"
+ GLUSTERFS_LOG_DIR="/var/log/glusterfs"
+ GLUSTERFS_META_DIR="/var/lib/glusterd"
+ GLUSTERFS_LOG_CONT_DIR="/var/log/glusterfs/container"
+ GLUSTERFS_CUSTOM_FSTAB="/var/lib/heketi/fstab"
+
+ GLUSTER_BRICKMULTIPLEX=${GLUSTER_BRICKMULTIPLEX-yes}
+
+ case "$GLUSTER_BRICKMULTIPLEX" in
+ [nN] | [nN][Oo] )
+ gluster v info | grep 'cluster.brick-multiplex: off' > $GLUSTERFS_LOG_CONT_DIR/brickmultiplexing
+ if [[ ${?} == 0 ]]; then
+ echo "cluster brick-multiplexing already disabled." >> $GLUSTERFS_LOG_CONT_DIR/brickmultiplexing
+ exit 0
+ fi
+
+ gluster --mode=script volume set all cluster.brick-multiplex off >> $GLUSTERFS_LOG_CONT_DIR/brickmultiplexing
+ if [[ ${?} != 0 ]]; then
+ echo "cluster brick-multiplexing set failed." >> $GLUSTERFS_LOG_CONT_DIR/brickmultiplexing
+ exit 1
+ fi
+
+ systemctl restart glusterd
+ if [[ ${?} != 0 ]]; then
+ echo "Restarting glusterd failed." >> $GLUSTERFS_LOG_CONT_DIR/brickmultiplexing
+ exit 1
+ fi
+
+ echo "Brick Multiplexing Successfully Disabled"
+ exit 0
+ ;;
+ [yY] | [yY][Ee][Ss] )
+ gluster v info | grep 'cluster.brick-multiplex: on' > $GLUSTERFS_LOG_CONT_DIR/brickmultiplexing
+ if [[ ${?} == 0 ]]; then
+ echo "cluster brick-multiplexing already set." >> $GLUSTERFS_LOG_CONT_DIR/brickmultiplexing
+ exit 0
+ fi
+
+ gluster --mode=script volume set all cluster.brick-multiplex on >> $GLUSTERFS_LOG_CONT_DIR/brickmultiplexing
+ if [[ ${?} != 0 ]]; then
+ echo "cluster brick-multiplexing set failed." >> $GLUSTERFS_LOG_CONT_DIR/brickmultiplexing
+ exit 1
+ fi
+
+ systemctl restart glusterd
+ if [[ ${?} != 0 ]]; then
+ echo "Restarting glusterd failed." >> $GLUSTERFS_LOG_CONT_DIR/brickmultiplexing
+ exit 1
+ fi
+
+ echo "Brick Multiplexing Successfully Enabled"
+ exit 0
+ ;;
+ *) echo "Invalid input"
+ ;;
+ esac
+}
+
+main