Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
etersoft-admin-essentials
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
etersoft-admin-essentials
Commits
6f20fb2e
Commit
6f20fb2e
authored
Jul 14, 2015
by
Anton Agapov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplification of glusterupdate.sh
parent
8aa28580
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
77 deletions
+29
-77
glusterupdate.sh
gluster/update/glusterupdate.sh
+29
-77
No files found.
gluster/update/glusterupdate.sh
View file @
6f20fb2e
...
...
@@ -3,95 +3,41 @@
host
=
"snail lin-test cellar windsor nun lav vbox asu multi space1 localhost"
client
=
"euclid atlant grape"
gfs_query
(){
run_on_hosts
(){
for
i
in
$host
do
echo
$i
ssh
$i
'bash -s'
<<<
"
epm -q glusterfs3-server
"
ssh
$i
'bash -s'
<<<
"
$@
"
done
}
gfs_policy
(){
for
i
in
$host
do
echo
$i
ssh
$i
'bash -s'
<<<
"apt-get update; apt-get policy glusterfs3-server"
done
}
gfs_install
(){
for
i
in
$host
run_on_clients
(){
for
i
in
$client
do
echo
$i
ssh
$i
'bash -s'
<<<
"
epmi glusterfs3-server
"
ssh
$i
'bash -s'
<<<
"
$@
"
done
}
gfs_stop
(){
for
i
in
$host
do
echo
$i
ssh
$i
'bash -s'
<<<
"umount /var/ftp/*; killall glusterfs"
done
for
i
in
$host
do
echo
$i
ssh
$i
'bash -s'
<<<
"monit stop glusterd"
done
for
i
in
$host
do
echo
$i
ssh
$i
'bash -s'
<<<
"killall glusterd"
done
for
i
in
$host
do
echo
$i
ssh
$i
'bash -s'
<<<
"killall glusterfsd"
done
run_on_hosts umount /var/ftp/
*
;
killall glusterfs
run_on_hosts monit stop glusterd
run_on_hosts killall glusterd
run_on_hosts killall glusterfsd
}
gfs_start
(){
for
i
in
$host
do
echo
$i
ssh
$i
'bash -s'
<<<
"monit start glusterd"
done
sleep
5
for
i
in
$host
do
echo
$i
ssh
$i
'bash -s'
<<<
"service glusterd start"
done
run_on_hosts monit start glusterd
sleep
5
run_on_hosts service glusterd start
}
gfs_mount
(){
for
i
in
$host
do
echo
$i
ssh
$i
'bash -s'
<<<
"mount -a"
done
}
gfs_client
(){
for
i
in
$client
do
echo
$i
ssh
$i
'bash -s'
<<<
"umount /var/ftp/*; killall glusterfs; epmi glusterfs3-client; mount /var/ftp/*"
done
}
gfs_mount_plus
(){
echo
'Remount /var/ftp/* at cellar:'
ssh cellar
'bash -s'
<<<
"/root/bin/remount.sh /var/ftp/pub; /root/bin/remount.sh /var/ftp/pvt; /root/bin/remount.sh /var/ftp/tmp"
echo
'Eter-2.1 remount:'
ssh cellar
'bash -s'
<<<
"vzctl exec 225 /etc/rc.d/rc.local"
echo
'Remount /var/ftp/* at windsor:'
ssh windsor
'bash -s'
<<<
"/root/bin/remount.sh /var/ftp/pub; /root/bin/remount.sh /var/ftp/pvt; /root/bin/remount.sh /var/ftp/tmp"
echo
'builder remount'
...
...
@@ -102,20 +48,26 @@ gfs_mount_plus(){
case
$1
in
all
)
gfs_install
run_on_hosts epmi glusterfs3-server
gfs_stop
gfs_start
gfs_mount
run_on_hosts mount
-a
run_on_clients umount /var/ftp/
*
;
killall glusterfs
;
epmi glusterfs3-client
;
mount /var/ftp/
*
gfs_mount_plus
exit
0
;;
simulate
)
run_on_hosts epm simulate glusterfs3-server
exit
0
;;
install
)
gfs_install
run_on_hosts epmi glusterfs3-server
exit
0
;;
noinstall
)
gfs_stop
gfs_start
gfs_mount
run_on_hosts mount
-a
exit
0
;;
stop
)
...
...
@@ -124,11 +76,11 @@ case $1 in
;;
start
)
gfs_start
gfs_mount
run_on_hosts mount
-a
exit
0
;;
mount
)
gfs_mount
run_on_hosts mount
-a
exit
0
;;
mount_plus
)
...
...
@@ -136,18 +88,18 @@ case $1 in
exit
0
;;
query
)
gfs_query
run_on_hosts epm
-q
glusterfs3-server
exit
0
;;
policy
)
gfs_policy
run_on_hosts apt-get update
;
apt-get policy glusterfs3-server
exit
0
;;
client
)
gfs_client
run_on_clients umount /var/ftp/
*
;
killall glusterfs
;
epmi glusterfs3-client
;
mount /var/ftp/
*
exit
0
;;
*
)
echo
'One word is needed as arg: query, policy, start, stop, mount, install, noinstall, all. Try again...'
echo
'One word is needed as arg: query,
simulate,
policy, start, stop, mount, install, noinstall, all. Try again...'
;;
esac
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment