diff options
author | Borislav Glozman <Borislav.Glozman@amdocs.com> | 2018-07-15 12:32:24 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-07-15 12:32:24 +0000 |
commit | b8a250d496d7dcdab72b0118164a3f2bb23cb7e4 (patch) | |
tree | 160bc55b0bb19203eef6811d0c71032ff2fe7aa3 /kubernetes/sdnc/resources/geo/bin/sdnc.failover | |
parent | 310736ba91c4e9f8f8037b2014e3f2ab06112f0b (diff) | |
parent | b642ee553d6dd486fc375755af9da2fdd9c94885 (diff) |
Merge "SDN-C Multi-site High-availability - Auto-failover"
Diffstat (limited to 'kubernetes/sdnc/resources/geo/bin/sdnc.failover')
-rwxr-xr-x | kubernetes/sdnc/resources/geo/bin/sdnc.failover | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/kubernetes/sdnc/resources/geo/bin/sdnc.failover b/kubernetes/sdnc/resources/geo/bin/sdnc.failover deleted file mode 100755 index 961a5cb5cf..0000000000 --- a/kubernetes/sdnc/resources/geo/bin/sdnc.failover +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/perl -s
-use strict;
-
-my $keyWord_standby = "standby";
-my $keyWord_active = "active";
-my $keyWord_true = "true";
-my $keyWord_false = "false";
-my $keyWord_success = "success";
-my $keyWord_failure = "failure";
-my $file_cluster = "sdnc.cluster";
-my $file_switchVoting = "switchVoting.sh";
-my $file_isPrimaryCluster = "sdnc.isPrimaryCluster";
-
-if ((!(-e $file_cluster)) || (!(-e $file_switchVoting))|| (!(-e $file_isPrimaryCluster))) {
- # file not exist.
- print qq|$keyWord_failure\n|;
- exit 1;
-}
-
-my $roleRes = qx("./$file_isPrimaryCluster");
-my $clusterRes = qx("./$file_cluster");
-
-if ( index ($clusterRes, $keyWord_standby) != -1) {
- # We are at standby side
- if ( index ($roleRes, $keyWord_false) != -1) {
- # We are at Secondary cluster
- sub_activate_secondary();
- } elsif ( index ($roleRes, $keyWord_true) != -1) {
- # We are at Primary cluster
- sub_activate_primary();
- } else {
- # Error.
- print qq|$keyWord_failure\n|;
- exit 1;
- }
-} elsif ( index ($clusterRes, $keyWord_active) != -1) {
- # We are at active side
- if ( index ($roleRes, $keyWord_false) != -1) {
- # We are at Secondary cluster
- sub_activate_primary();
- } elsif ( index ($roleRes, $keyWord_true) != -1) {
- # We are at Primary cluster
- sub_activate_secondary();
- } else {
- # Error.
- print qq|$keyWord_failure\n|;
- exit 1;
- }
-} else {
- # Error.
- print qq|$keyWord_failure\n|;
- exit 1;
-}
-
-sub sub_activate_primary {
- #Switching voting in Primary cluster
- system("./$file_switchVoting primary");
- print qq|$keyWord_success\n|;
-}
-
-sub sub_activate_secondary {
- #Switching voting in secondary cluster
- system("./$file_switchVoting secondary");
- print qq|$keyWord_success\n|;
-}
|