-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontrol-svcs-rhcs-DR.pl
More file actions
executable file
·63 lines (50 loc) · 1.45 KB
/
control-svcs-rhcs-DR.pl
File metadata and controls
executable file
·63 lines (50 loc) · 1.45 KB
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
#!/usr/bin/perl
#
# ###############################################################
#
# Description : controlaDR.pl
# Author : Raul da Silva Leite
# Date : 13/09/2013
#
# ###############################################################
if ( $#ARGV < 0 ) {
print "\n***************************************************************** \n";
print "\t Para ativar o DR execute './ativa_cob.pl start' \n";
print "\t Para encerrar o DR execute './ativa_cob.pl stop' \n";
print "\n ***************************************************************** \n\n";
}
if ( $ARGV[0] eq "start" ) {
&start;
}
if ( $ARGV[0] eq "stop" ) {
&stop;
}
sub start {
print "\nCarregando o DR...\n\n";
$aux=0;
@daemons=(cman,clvmd,gfs2);
while ( $aux < @daemons ) {
$dexec=`/sbin/service $daemons[$aux] start `;
print ("\n$dexec");
$aux++;
}
print "\nMontando gfs2 filesystem : \n";
$mount_1=`mount -o locktable=CLUSTER_TEST2:lv_postgresql -t gfs2 /dev/VG_TEST/lv_postgresql /var/lib/pgsql`;
$mount_2=`mount -o locktable=CLUSTER_TEST2:lv_httpd -t gfs2 /dev/VG_TEST/lv_httpd /usr/local/httpd`;
print "\n$mount_1";
print "\n$mount_2";
$dexec_post=`/sbin/service postgresql start `;
print ("\n$dexec_post");
$dexec_eng=`/sbin/service httpd start `;
print ("\n$dexec_eng");
}
sub stop {
print "\nBaixando o DR...\n\n";
$aux=0;
@daemons=(httpd,postgresql,gfs2,clvmd,cman);
while ( $aux < @daemons ) {
$dexec=`/sbin/service $daemons[$aux] stop `;
print ("\n $dexec");
$aux++;
}
}