3
CLUSTER_PFX="127.1.1"; # ".x" for each glusterd
4
CLUSTER_COUNT=1; # Just initial definition
6
function launch_cluster() {
11
define_backends $count;
13
define_glusterds $count;
20
function define_backends() {
23
for i in `seq 1 $count`; do
27
for i in `seq 1 $count`; do
29
mkdir -pv ${!b}/glusterd;
34
function define_glusterds() {
42
for i in `seq 1 $count`; do
45
wopt="management.working-directory=${!b}/glusterd";
46
bopt="management.transport.socket.bind-address=${!h}";
47
popt="--pid-file=${!b}/glusterd.pid";
48
sopt="management.glusterd-sockfile=${!b}/glusterd/gd.sock"
49
lopt="--log-file=${!b}/glusterd.log"
50
eval "glusterd_$i='glusterd --xlator-option $wopt --xlator-option $bopt --xlator-option $sopt $lopt $popt'";
51
eval "glusterd$i='glusterd --xlator-option $wopt --xlator-option $bopt --xlator-option $sopt $lopt $popt'";
56
function start_glusterds() {
59
for i in `seq 1 $CLUSTER_COUNT`; do
66
function kill_glusterd() {
72
pidfile="${!b}/glusterd.pid";
78
function kill_node() {
84
kill -9 $(ps -ef | grep gluster | grep ${!h} | awk '{print $2}');
88
function define_hosts() {
91
for i in `seq 1 $count`; do
92
eval "H_$i=${CLUSTER_PFX}.$i"
93
eval "H$i=${CLUSTER_PFX}.$i";
98
function define_clis() {
102
for i in `seq 1 $count`; do
104
eval "CLI_$i='$CLI --glusterd-sock=${!b}/glusterd/gd.sock'";
105
eval "CLI$i='$CLI --glusterd-sock=${!b}/glusterd/gd.sock'";