summaryrefslogtreecommitdiffstats
path: root/helper_scripts
diff options
context:
space:
mode:
authorM S Vishwanath Bhat <vishwanath@gluster.com>2012-01-12 23:30:00 +0530
committerM S Vishwanath Bhat <vishwanath@gluster.com>2012-01-12 23:35:15 +0530
commitf40ffd8028d3dd4f3eef4a3409c531af941d23f0 (patch)
treec2bcf865c0623761b01ca5929d8caa3c78d527bf /helper_scripts
parent254e67dbd7a35d38dbe7a5f525955adeb86f5939 (diff)
renaming helper_scrips->helper_scripts and cleaning up the whitespaces
Change-Id: I6004e4066fab30e14716ef6475c1281270974d2b Signed-off-by: M S Vishwanath Bhat <vishwanath@gluster.com>
Diffstat (limited to 'helper_scripts')
-rw-r--r--helper_scripts/INFO23
-rwxr-xr-xhelper_scripts/clean_glusterd.sh48
-rwxr-xr-xhelper_scripts/clean_logs.sh52
-rwxr-xr-xhelper_scripts/clean_rpm_logs.sh52
-rwxr-xr-xhelper_scripts/detach.sh41
-rwxr-xr-xhelper_scripts/download_and_install.sh157
-rwxr-xr-xhelper_scripts/glusterfs_uninstall.sh46
-rwxr-xr-xhelper_scripts/install_glusterfs_rpm.sh73
-rwxr-xr-xhelper_scripts/install_parallel_glusterfs.sh64
-rwxr-xr-xhelper_scripts/multi_uninstall.sh66
-rwxr-xr-xhelper_scripts/probe.sh41
-rwxr-xr-xhelper_scripts/rpm_download_install.sh159
-rwxr-xr-xhelper_scripts/rpm_qa_download_install.sh111
-rwxr-xr-xhelper_scripts/start_glusterd.sh48
-rwxr-xr-xhelper_scripts/start_stop.sh31
15 files changed, 1012 insertions, 0 deletions
diff --git a/helper_scripts/INFO b/helper_scripts/INFO
new file mode 100644
index 0000000..d030697
--- /dev/null
+++ b/helper_scripts/INFO
@@ -0,0 +1,23 @@
+helper_scripts/download_and_install.sh ----> it downloads the specified version of glusterfs (both main release as well as qa release), builds it and installs it. The prefix for the installation can be given as the argument, otherwise it installs in the default directory. If the tarball or the untarred directory of the specified glusterfs version is already present in the present directory, it uses them to install.
+
+=============================================================================================================================================
+
+helper_scrips/rpm_qa_download_install.sh -----> downloads the rpms for the specified qa release and installs them. An option whether to upgrade to the specified version or install from scratch to the specified version can be provided as the command line argument.
+
+=============================================================================================================================================
+
+helper_scripts/clean_glusterd.sh
+helper_scripts/clean_logs.sh
+helper_scripts/start_glusterd.sh
+helper_scripts/probe.sh
+
+The above scripts are usable with the passwordless ssh connection setup between the glusterfs servers, which helps in cleaning the logs, probing, cleaning glusterd, starting glusterd etc.
+
+=============================================================================================================================================
+helper_scripts/install_parallel_glusterfs.sh --------> executes the download_and_install.sh scripts prallely on multiple machines, such that glusterfs gets installed on multiple machines simultaneously.
+
+=============================================================================================================================================
+helper_scrips/glusterfs_uninstall.sh ------> uninstalls the specified glusterfs version if it finds the source directory.
+herper_scripts/multi_uninstall.sh -------> uninstalls the specified glusterfs from multiple machines, by executing glusterfs_uninstall.sh script.
+
+helper_scrips/install_glusterfs_rpm.sh -----> installs the specified glusterfs rpms on the machines whose list is provided in /root/machines,parallely \ No newline at end of file
diff --git a/helper_scripts/clean_glusterd.sh b/helper_scripts/clean_glusterd.sh
new file mode 100755
index 0000000..a68eb97
--- /dev/null
+++ b/helper_scripts/clean_glusterd.sh
@@ -0,0 +1,48 @@
+#!/bin/bash
+
+function _init ()
+{
+ set -u;
+}
+
+function clean_glusterd ()
+{
+ local remote_server=;
+
+ if [ $# -eq 1 ]; then
+ remote_server=$1;
+ fi
+
+ if [ $remote_server ]; then
+ ssh $remote_server rm -rf /etc/glusterd;
+ return 0;
+ fi
+
+ for i in $(cat /root/servers)
+ do
+ clean_glusterd $i;
+ done
+
+}
+
+function clean_my_glusterd ()
+{
+ rm -rf /etc/glusterd;
+ return 0;
+}
+
+function main ()
+{
+ stat --printf=%i /root/servers 2>/dev/null 1>/dev/null;
+ if [ $? -ne 0 ]; then
+ echo "servers file is not present /root. Cannot execute further."
+ exit 1
+ fi
+
+ clean_my_glusterd;
+ clean_glusterd;
+
+ return 0;
+}
+
+_init && main "$@"
diff --git a/helper_scripts/clean_logs.sh b/helper_scripts/clean_logs.sh
new file mode 100755
index 0000000..d5ff90b
--- /dev/null
+++ b/helper_scripts/clean_logs.sh
@@ -0,0 +1,52 @@
+#!/bin/bash
+
+function _init ()
+{
+ set -u;
+}
+
+function clean_logs ()
+{
+ local remote_server=;
+
+ if [ $# -eq 1 ]; then
+ remote_server=$1;
+ fi
+
+ if [ $remote_server ]; then
+ ssh $remote_server rm -rf /usr/local/var/log/glusterfs/*.log;
+ ssh $remote_server rm -rf /usr/local/var/log/glusterfs/bricks/*;
+ return 0;
+ fi
+
+ for i in $(cat /root/servers)
+ do
+ clean_logs $i;
+ done
+
+}
+
+function clean_my_logs ()
+{
+ rm -rf /usr/local/var/log/glusterfs/*.log;
+ rm -rf /usr/local/var/log/glusterfs/bricks/*;
+
+ return 0;
+}
+
+function main ()
+{
+ stat --printf=%i /root/servers 2>/dev/null 1>/dev/null;
+ if [ $? -ne 0 ]; then
+ echo "servers file is not present /root. Cannot execute further.";
+
+ exit 1;
+ fi
+
+ clean_my_logs;
+ clean_logs;
+
+ return 0;
+}
+
+_init && main "$@"
diff --git a/helper_scripts/clean_rpm_logs.sh b/helper_scripts/clean_rpm_logs.sh
new file mode 100755
index 0000000..a823bf0
--- /dev/null
+++ b/helper_scripts/clean_rpm_logs.sh
@@ -0,0 +1,52 @@
+#!/bin/bash
+
+function _init ()
+{
+ set -u;
+}
+
+function clean_logs ()
+{
+ local remote_server=;
+
+ if [ $# -eq 1 ]; then
+ remote_server=$1;
+ fi
+
+ if [ $remote_server ]; then
+ ssh $remote_server rm -rf /var/log/glusterfs/*.log;
+ ssh $remote_server rm -rf /var/log/glusterfs/bricks/*;
+ return 0;
+ fi
+
+ for i in $(cat /root/servers)
+ do
+ clean_logs $i;
+ done
+
+}
+
+function clean_my_logs ()
+{
+ rm -rf /var/log/glusterfs/*.log;
+ rm -rf /var/log/glusterfs/bricks/*;
+
+ return 0;
+}
+
+function main ()
+{
+ stat --printf=%i /root/servers 2>/dev/null 1>/dev/null;
+ if [ $? -ne 0 ]; then
+ echo "servers file is not present /root. Cannot execute further.";
+
+ exit 1;
+ fi
+
+ clean_my_logs;
+ clean_logs;
+
+ return 0;
+}
+
+_init && main "$@"
diff --git a/helper_scripts/detach.sh b/helper_scripts/detach.sh
new file mode 100755
index 0000000..8ccca53
--- /dev/null
+++ b/helper_scripts/detach.sh
@@ -0,0 +1,41 @@
+#!/bin/bash
+
+function _init ()
+{
+ set -u;
+}
+
+function peer_detach ()
+{
+ local remote_server=;
+
+ if [ $# -eq 1 ]; then
+ remote_server=$1;
+ fi
+
+ if [ $remote_server ]; then
+ gluster peer detach $remote_server;
+ return 0;
+ fi
+
+ for i in $(cat /root/servers)
+ do
+ peer_detach $i;
+ done
+
+}
+
+function main ()
+{
+ stat --printf=%i /root/servers 2>/dev/null 1>/dev/null;
+ if [ $? -ne 0 ]; then
+ echo "servers file is not present /root. Cannot execute further."
+ exit 1
+ fi
+
+ peer_detach;
+
+ return 0;
+}
+
+_init && main "$@"
diff --git a/helper_scripts/download_and_install.sh b/helper_scripts/download_and_install.sh
new file mode 100755
index 0000000..76390d9
--- /dev/null
+++ b/helper_scripts/download_and_install.sh
@@ -0,0 +1,157 @@
+#!/bin/bash
+
+#set -x;
+
+function _init ()
+{
+ # echo $0;
+ # echo $#;
+ # echo $1;
+ set -u;
+ if [ $# -lt 1 ]; then
+ echo "usage: download_and_install <glusterfs-version> [install prefix]";
+ exit 1;
+ fi
+
+ version=$1;
+ echo $version;
+ echo $version | grep "glusterfs" 2>/dev/null 1>/dev/null;
+ if [ $? -ne 0 ]; then
+ echo "given argument is not glusterfs";
+ exit 1;
+ fi
+
+ check_if_qa_release $version;
+ op_ret=$?;
+
+ if [ $op_ret -eq 0 ]; then
+ download_address="http://bits.gluster.com/pub/gluster/glusterfs/src/"$version".tar.gz";
+ else
+ echo $version | grep "3.2" 2>/dev/null 1>/dev/null;
+ if [ $? -eq 0 ]; then
+ version_number=$(echo $version | cut -f 2 -d "-");
+ download_address="http://ftp.gluster.com/pub/gluster/glusterfs/3.2/$version_number/"$version".tar.gz";
+ else
+ grep "3.1" $version 2>/dev/null 1>/dev/null;
+ echo "haha yes"
+ if [ $? -eq 0 ]; then
+ version_number=$(echo $version | cut -f 2 -d "-");
+ download_address="http://ftp.gluster.com/pub/gluster/glusterfs/3.1/$version_number/"$version".tar.gz";
+ else
+ grep "3.0" $version 2>/dev/null 1>/dev/null;
+ if [ $? -eq 0 ]; then
+ version_number=$(cut -f 2 -d "-" $version);
+ download_address="http://ftp.gluster.com/pub/gluster/glusterfs/3.2/$version_number/"$version".tar.gz";
+ fi
+ fi
+ fi
+ fi
+
+echo "KK: $download_address"
+# ls -l "$version".tar.gz 2>/dev/null 1>/dev/null
+# if [ $? -ne 0 ]; then
+}
+
+function check_if_qa_release ()
+{
+ glusterfs_version=$1;
+
+ echo $glusterfs_version | grep "qa" 2>/dev/null 1>/dev/null;
+ if [ $? -ne 0 ]; then
+ echo $glusterfs_version | grep "beta" 2>/dev/null 1>/dev/null;
+ fi
+ ret=$?;
+
+ return $ret;
+}
+
+function download_tarball ()
+{
+ address=$1;
+
+ wget $address;
+}
+
+function untar_tarball ()
+{
+ gluster_version=$1;
+
+ tar xzf $PWD/"$gluster_version".tar.gz;
+}
+
+function configure ()
+{
+ if [ $# -eq 1 ]; then
+ prefix_dir=$1;
+ else
+ prefix_dir="default";
+ fi
+
+ old_pwd=$PWD;
+
+ cd $PWD/$version;
+ check_if_qa_release $version;
+
+ if [ $? -eq 0 ]; then
+ export CFLAGS="-g -O0 -DDEBUG";
+ else
+ export CFLAGS="-g -O0";
+ fi
+
+ if [ ! -d build ]; then
+ mkdir build;
+ fi
+
+ cd build;
+
+ echo "KKKKK: $prefix_dir"
+ sleep 1;
+ if [ $prefix_dir != "default" ]; then
+ ../configure --prefix=$prefix_dir --quiet;
+ else
+ ../configure --quiet;
+ fi
+
+ cd $old_pwd;
+}
+
+function build_install ()
+{
+ cd $PWD/$version;
+
+ cd build;
+ make -j 32 >/dev/null && make -j 32 install >/dev/null;
+
+ cd /root;
+}
+
+main ()
+{
+ if [ ! -e $version.tar.gz ]; then
+ echo $download_address;
+ download_tarball $download_address;
+ else
+ echo "tarball already present in the directory";
+ fi
+
+ if [ ! -d $version ]; then
+ untar_tarball $version;
+ else
+ echo "Source directory already present in the directory";
+ fi
+
+ install_prefix="default";
+ if [ $# -eq 2 ]; then
+ install_prefix=$2;
+ fi
+
+ if [ $install_prefix != "default" ]; then
+ configure $install_prefix;
+ else
+ configure;
+ fi
+
+ build_install;
+}
+
+_init "$@" && main "$@"
diff --git a/helper_scripts/glusterfs_uninstall.sh b/helper_scripts/glusterfs_uninstall.sh
new file mode 100755
index 0000000..b3378fd
--- /dev/null
+++ b/helper_scripts/glusterfs_uninstall.sh
@@ -0,0 +1,46 @@
+#!/bin/bash
+
+#set -x;
+
+function _init ()
+{
+ # echo $0;
+ # echo $#;
+ # echo $1;
+ set -u;
+ if [ $# -lt 1 ]; then
+ echo "usage: download_and_install <glusterfs-version>";
+ exit 1;
+ fi
+
+ version=$1;
+ echo $version;
+ echo $version | grep "glusterfs" 2>/dev/null 1>/dev/null;
+ if [ $? -ne 0 ]; then
+ echo "given argument is not glusterfs";
+ exit 1;
+ fi
+}
+
+function un_install ()
+{
+ cd /root/$version;
+
+ cd build;
+ make uninstall && make clean && make distclean;
+
+ cd /root;
+}
+
+main ()
+{
+
+ if [ ! -d $version ]; then
+ echo "the glusterfs version ($version) directory is not there."
+ return 1;
+ fi
+
+ un_install;
+}
+
+_init "$@" && main "$@"
diff --git a/helper_scripts/install_glusterfs_rpm.sh b/helper_scripts/install_glusterfs_rpm.sh
new file mode 100755
index 0000000..9b5c6fa
--- /dev/null
+++ b/helper_scripts/install_glusterfs_rpm.sh
@@ -0,0 +1,73 @@
+#!/bin/bash
+
+function _init ()
+{
+ set -u;
+ VERSION=$1;
+ if [ $# -lt 2 ]; then
+ upgrade="no";
+ else
+ if [ $2 == "yes" ]; then
+ upgrade="yes";
+ else
+ upgrade="no";
+ fi
+ fi
+}
+
+function install_glusterfs ()
+{
+ local remote_server=;
+
+ if [ $# -eq 1 ]; then
+ remote_server=$1;
+ fi
+
+ if [ $remote_server ]; then
+ ssh $remote_server cp -f /root/scripts/rpm_download_install.sh /root/;
+ ssh $remote_server /root/rpm_download_install.sh $VERSION $upgrade;
+ return 0;
+ fi
+
+ j=0;
+ for i in $(cat /root/machines)
+ do
+ j=$(($j+1));
+ (install_glusterfs $i)&
+ done
+
+}
+
+function install_my_glusterfs ()
+{
+ old_PWD=$PWD;
+
+ cd /root;
+ cp /root/scripts/rpm_download_install.sh /root/;
+ /root/rpm_download_install.sh $VERSION $upgrade;
+
+ cd $old_PWD;
+ return 0;
+}
+
+function main ()
+{
+ stat --printf=%i /root/machines 2>/dev/null 1>/dev/null;
+ if [ $? -ne 0 ]; then
+ echo "servers file is not present /root. Cannot execute further.";
+
+ exit 1;
+ fi
+
+ install_glusterfs;
+ for i in $(1 $j)
+ do
+ wait %$j;
+ done
+
+ install_my_glusterfs;
+
+ return 0;
+}
+
+_init "$@" && main "$@"
diff --git a/helper_scripts/install_parallel_glusterfs.sh b/helper_scripts/install_parallel_glusterfs.sh
new file mode 100755
index 0000000..de5840a
--- /dev/null
+++ b/helper_scripts/install_parallel_glusterfs.sh
@@ -0,0 +1,64 @@
+#!/bin/bash
+
+function _init ()
+{
+ set -u;
+ VERSION=$1;
+}
+
+function install_glusterfs ()
+{
+ local remote_server=;
+
+ if [ $# -eq 1 ]; then
+ remote_server=$1;
+ fi
+
+ if [ $remote_server ]; then
+ ssh $remote_server cp -f /root/scripts/download_and_install.sh /root/;
+ ssh $remote_server /root/download_and_install.sh $VERSION;
+ return 0;
+ fi
+
+ j=0;
+ for i in $(cat /root/machines)
+ do
+ j=$(($j+1));
+ (install_glusterfs $i)&
+ done
+
+}
+
+function install_my_glusterfs ()
+{
+ old_PWD=$PWD;
+
+ cd /root;
+ cp /root/scripts/download_and_install.sh /root/;
+ /root/download_and_install.sh $VERSION;
+
+ cd $old_PWD;
+ return 0;
+}
+
+function main ()
+{
+ stat --printf=%i /root/machines 2>/dev/null 1>/dev/null;
+ if [ $? -ne 0 ]; then
+ echo "servers file is not present /root. Cannot execute further.";
+
+ exit 1;
+ fi
+
+ install_glusterfs;
+ for i in $(1 $j)
+ do
+ wait %$j;
+ done
+
+ install_my_glusterfs;
+
+ return 0;
+}
+
+_init "$@" && main "$@"
diff --git a/helper_scripts/multi_uninstall.sh b/helper_scripts/multi_uninstall.sh
new file mode 100755
index 0000000..4f6a1cd
--- /dev/null
+++ b/helper_scripts/multi_uninstall.sh
@@ -0,0 +1,66 @@
+#!/bin/bash
+
+#!/bin/bash
+
+function _init ()
+{
+ set -u;
+ VERSION=$1;
+}
+
+function uninstall_glusterfs ()
+{
+ local remote_server=;
+
+ if [ $# -eq 1 ]; then
+ remote_server=$1;
+ fi
+
+ if [ $remote_server ]; then
+ ssh $remote_server cp -f /root/scripts/glusterfs_uninstall.sh /root/;
+ ssh $remote_server /root/glusterfs_uninstall.sh $VERSION;
+ return 0;
+ fi
+
+ j=0;
+ for i in $(cat /root/machines)
+ do
+ j=$(($j+1));
+ (uninstall_glusterfs $i)&
+ done
+
+}
+
+function uninstall_my_glusterfs ()
+{
+ old_PWD=$PWD;
+
+ cd /root;
+ cp -f /root/scripts/glusterfs_uninstall.sh /root/;
+ /root/glusterfs_uninstall.sh $VERSION;
+
+ cd $old_PWD;
+ return 0;
+}
+
+function main ()
+{
+ stat --printf=%i /root/machines 2>/dev/null 1>/dev/null;
+ if [ $? -ne 0 ]; then
+ echo "servers file is not present /root. Cannot execute further.";
+
+ exit 1;
+ fi
+
+ uninstall_glusterfs;
+ for i in $(1 $j)
+ do
+ wait %$j;
+ done
+
+ uninstall_my_glusterfs;
+
+ return 0;
+}
+
+_init "$@" && main "$@"
diff --git a/helper_scripts/probe.sh b/helper_scripts/probe.sh
new file mode 100755
index 0000000..f6fc217
--- /dev/null
+++ b/helper_scripts/probe.sh
@@ -0,0 +1,41 @@
+#!/bin/bash
+
+function _init ()
+{
+ set -u;
+}
+
+function peer_probe ()
+{
+ local remote_server=;
+
+ if [ $# -eq 1 ]; then
+ remote_server=$1;
+ fi
+
+ if [ $remote_server ]; then
+ gluster peer probe $remote_server;
+ return 0;
+ fi
+
+ for i in $(cat /root/servers)
+ do
+ peer_probe $i;
+ done
+
+}
+
+function main ()
+{
+ stat --printf=%i /root/servers 2>/dev/null 1>/dev/null;
+ if [ $? -ne 0 ]; then
+ echo "servers file is not present /root. Cannot execute further."
+ exit 1
+ fi
+
+ peer_probe;
+
+ return 0;
+}
+
+_init && main "$@"
diff --git a/helper_scripts/rpm_download_install.sh b/helper_scripts/rpm_download_install.sh
new file mode 100755
index 0000000..4de3a2b
--- /dev/null
+++ b/helper_scripts/rpm_download_install.sh
@@ -0,0 +1,159 @@
+#!/bin/bash
+
+#set -x;
+
+function _init ()
+{
+ # echo $0;
+ # echo $#;
+ # echo $1;
+ set -u;
+ if [ $# -lt 1 ]; then
+ echo "usage: download_and_install <glusterfs-version> [upgrade decision]";
+ exit 1;
+ fi
+
+ version=$1;
+ echo $version;
+ echo $version | grep "glusterfs" 2>/dev/null 1>/dev/null;
+ if [ $? -ne 0 ]; then
+ echo "given argument is not glusterfs";
+ exit 1;
+ fi
+
+ version_number=$(echo $version | cut -f 2 -d "-");
+ check_if_qa_release $version;
+ op_ret=$?;
+
+ if [ $op_ret -eq 0 ]; then
+ download_address="http://bits.gluster.com/pub/gluster/glusterfs/";
+ else
+ echo $version | grep "3.2" 2>/dev/null 1>/dev/null;
+ if [ $? -eq 0 ]; then
+ version_number=$(echo $version | cut -f 2 -d "-");
+ download_address="http://download.gluster.com/pub/gluster/glusterfs/3.2/$version_number/RHEL/";
+ else
+ grep "3.1" $version 2>/dev/null 1>/dev/null;
+ echo "haha yes"
+ if [ $? -eq 0 ]; then
+ version_number=$(echo $version | cut -f 2 -d "-");
+ download_address="http://download.gluster.com/pub/gluster/glusterfs/3.1/$version_number/RHEL/";
+ else
+ grep "3.0" $version 2>/dev/null 1>/dev/null;
+ if [ $? -eq 0 ]; then
+ version_number=$(cut -f 2 -d "-" $version);
+ download_address="http://download.gluster.com/pub/gluster/glusterfs/3.0/$version_number/RHEL/";
+ fi
+ fi
+ fi
+ fi
+
+ echo "Download address: $download_address" && sleep 2;
+# ls -l "$version".tar.gz 2>/dev/null 1>/dev/null
+# if [ $? -ne 0 ]; then
+}
+
+function check_if_qa_release ()
+{
+ glusterfs_version=$1;
+
+ echo $glusterfs_version | grep "qa" 2>/dev/null 1>/dev/null;
+ ret=$?;
+
+ return $ret;
+}
+
+function download_rpms ()
+{
+ address=$1;
+ local ret;
+
+ if [ ! -d $PWD/rpms ] || [ ! -d $PWD/rpms/$version_number ]; then
+ mkdir $PWD/rpms/$version_number -p;
+ else
+ echo "the directory for the mentioned versrion $version_number is present";
+ return;
+ fi
+
+ cd $PWD/rpms/$version_number;
+
+ echo $version_number | grep "3.2";
+ is_32=$?;
+ if [ $is_32 -ne 0 ]; then
+ echo $version_number | grep "3.3";
+ is_32=$?;
+ fi
+
+ check_if_qa_release $version;
+ ret=$?
+
+ if [ $ret -eq 0 ]; then
+ wget $address/$version_number/x86_64/glusterfs-core-$version_number-1.x86_64.rpm;
+ wget $address/$version_number/x86_64/glusterfs-debuginfo-$version_number-1.x86_64.rpm;
+ wget $address/$version_number/x86_64/glusterfs-fuse-$version_number-1.x86_64.rpm;
+ if [ $is_32 -eq 0 ]; then
+ wget $address/$version_number/x86_64/glusterfs-geo-replication-$version_number-1.x86_64.rpm;
+ echo "3.2 version";
+ fi
+ else
+ wget $address/glusterfs-core-$version_number-1.el6.x86_64.rpm;
+ wget $address/glusterfs-debuginfo-$version_number-1.el6.x86_64.rpm;
+ wget $address/glusterfs-fuse-$version_number-1.el6.x86_64.rpm;
+ if [ $is_32 -eq 0 ]; then
+ wget $address/glusterfs-geo-replication-$version_number-1.el6.x86_64.rpm;
+ echo "3.2 version";
+ fi
+ fi
+}
+
+
+function install_or_upgrade ()
+{
+ local old_PWD;
+
+ old_PWD=$PWD;
+
+ cd $PWD/rpms/$version_number;
+ if [ $upgrade != "yes" ]; then
+ for i in $(ls)
+ do
+ rpm -ivh $i;
+ done
+ else
+ for i in $(ls)
+ do
+ rpm -Uvh $i;
+ done
+ fi
+
+ ret=$?;
+ cd $old_PWD;
+
+ ldconfig;
+ return $ret;
+}
+
+main ()
+{
+ echo $download_address;
+ download_rpms $download_address;
+
+ upgrade="no";
+ if [ $# -eq 2 ]; then
+ upgrade=$2;
+ fi
+
+ if [ $upgrade != "yes" ] && [ $upgrade != "no" ]; then
+ echo "Invalid upgrade decision $upgrade";
+ rm -rf /root/rpms/$version_number;
+ exit 1;
+ fi
+
+ install_or_upgrade $upgrade;
+ ret=$?;
+ if [ $ret -ne 0 ]; then
+ rm -rf /root/rpms/$version_number;
+ fi
+}
+
+_init "$@" && main "$@"
diff --git a/helper_scripts/rpm_qa_download_install.sh b/helper_scripts/rpm_qa_download_install.sh
new file mode 100755
index 0000000..1f878f7
--- /dev/null
+++ b/helper_scripts/rpm_qa_download_install.sh
@@ -0,0 +1,111 @@
+#!/bin/bash
+
+#set -x;
+
+function _init ()
+{
+ # echo $0;
+ # echo $#;
+ # echo $1;
+ set -u;
+ if [ $# -lt 1 ]; then
+ echo "usage: download_and_install <glusterfs-version> [upgrade decision]";
+ exit 1;
+ fi
+
+ version=$1;
+ echo $version;
+ echo $version | grep "glusterfs" 2>/dev/null 1>/dev/null;
+ if [ $? -ne 0 ]; then
+ echo "given argument is not glusterfs";
+ exit 1;
+ fi
+
+ version_number=$(echo $version | cut -f 2 -d "-");
+ check_if_qa_release $version;
+ op_ret=$?;
+
+ if [ $op_ret -eq 0 ]; then
+ download_address="http://bits.gluster.com/pub/gluster/glusterfs/";
+ fi
+
+ echo "KK: $download_address"
+# ls -l "$version".tar.gz 2>/dev/null 1>/dev/null
+# if [ $? -ne 0 ]; then
+}
+
+function check_if_qa_release ()
+{
+ glusterfs_version=$1;
+
+ echo $glusterfs_version | grep "qa" 2>/dev/null 1>/dev/null;
+ ret=$?;
+
+ return $ret;
+}
+
+function download_rpms ()
+{
+ address=$1;
+
+ mkdir $PWD/rpms/$version_number;
+
+ cd $PWD/rpms/$version_number;
+
+ echo version_number | grep "3.2";
+ is_32=$?;
+
+ wget $address/$version_number/x86_64/glusterfs-core-$version_number-1.x86_64.rpm;
+ wget $address/$version_number/x86_64/glusterfs-debuginfo-$version_number-1.x86_64.rpm;
+ wget $address/$version_number/x86_64/glusterfs-fuse-$version_number-1.x86_64.rpm;
+ if [ $is_32 -eq 0 ]; then
+ wget $address/$version_number/x86_64/glusterfs-geo-replication-$version_number-1.x86_64.rpm;
+ fi
+}
+
+
+function install_or_upgrade ()
+{
+ cd /root/rpms/$version_number;
+ if [ $upgrade != "yes" ]; then
+ for i in $(ls)
+ do
+ rpm -ivh $i;
+ done
+ else
+ for i in $(ls)
+ do
+ rpm -Uvh $i;
+ done
+ fi
+
+ ret=$?;
+ cd /root;
+
+ return $ret;
+}
+
+main ()
+{
+ echo $download_address;
+ download_rpms $download_address;
+
+ upgrade="no";
+ if [ $# -eq 2 ]; then
+ upgrade=$2;
+ fi
+
+ if [ $upgrade != "yes" ] && [ $upgrade != "no" ]; then
+ echo "Invalid upgrade decision $upgrade";
+ rm -rf /root/rpms/$version_number;
+ exit 1;
+ fi
+
+ install_or_upgrade $upgrade;
+ ret=$?;
+ if [ $ret -ne 0 ]; then
+ rm -rf /root/rpms/$version_number;
+ fi
+}
+
+_init "$@" && main "$@"
diff --git a/helper_scripts/start_glusterd.sh b/helper_scripts/start_glusterd.sh
new file mode 100755
index 0000000..09c1210
--- /dev/null
+++ b/helper_scripts/start_glusterd.sh
@@ -0,0 +1,48 @@
+#!/bin/bash
+
+function _init ()
+{
+ set -u;
+}
+
+function start_glusterd ()
+{
+ local remote_server=;
+
+ if [ $# -eq 1 ]; then
+ remote_server=$1;
+ fi
+
+ if [ $remote_server ]; then
+ ssh $remote_server glusterd;
+ return 0;
+ fi
+
+ for i in $(cat /root/servers)
+ do
+ start_glusterd $i;
+ done
+
+}
+
+function start_my_glusterd ()
+{
+ glusterd;
+ return $?;
+}
+
+function main ()
+{
+ stat --printf=%i /root/servers 2>/dev/null 1>/dev/null;
+ if [ $? -ne 0 ]; then
+ echo "servers file is not present /root. Cannot execute further."
+ exit 1
+ fi
+
+ start_glusterd;
+ start_my_glusterd;
+
+ return 0;
+}
+
+_init && main "$@"
diff --git a/helper_scripts/start_stop.sh b/helper_scripts/start_stop.sh
new file mode 100755
index 0000000..05ed6fa
--- /dev/null
+++ b/helper_scripts/start_stop.sh
@@ -0,0 +1,31 @@
+#!/bin/bash
+
+
+function _init ()
+{
+ set -u;
+ volume_name=$1;
+}
+
+function start_and_stop ()
+{
+ while true;
+ do
+ gluster --mode=script volume stop $volume_name;
+ sleep 1;
+ gluster volume start $volume_name;
+ sleep 1;
+ done
+
+ return 0;
+}
+
+function main ()
+{
+
+ start_and_stop;
+
+ return 0;
+}
+
+_init "$@" && main "$@" \ No newline at end of file