diff options
author | Jose A. Rivera <jarrpa@redhat.com> | 2017-09-01 16:59:04 -0500 |
---|---|---|
committer | Jose A. Rivera <jarrpa@redhat.com> | 2017-11-27 07:17:17 -0600 |
commit | 5588a0f2448cb855fb8df8cba772dc548c9770d3 (patch) | |
tree | 4f25c9429eabae74a924ae9596dcba879a6667c3 /Fedora/gluster-brickmultiplex.sh | |
parent | c1b18923604acad7456dbac367382c3fa2def29c (diff) | |
download | gluster-5588a0f2448cb855fb8df8cba772dc548c9770d3.tar.gz gluster-5588a0f2448cb855fb8df8cba772dc548c9770d3.tar.bz2 gluster-5588a0f2448cb855fb8df8cba772dc548c9770d3.tar.xz gluster-5588a0f2448cb855fb8df8cba772dc548c9770d3.zip |
Bring Fedora image up to date.
Signed-off-by: Jose A. Rivera <jarrpa@redhat.com>
Diffstat (limited to 'Fedora/gluster-brickmultiplex.sh')
-rw-r--r-- | Fedora/gluster-brickmultiplex.sh | 74 |
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 |