blob: 968a3e2a587a5ec84ebb529d8e806bd8e7d44e01 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
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
|