aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHao Kuang <Hao.Kuang@amdocs.com>2017-12-04 19:30:01 +0000
committerHao Kuang <hao.kuang@amdocs.com>2017-12-11 20:20:46 +0000
commit72a9c65ab0a305e487e8aed11ff2d8ac34076943 (patch)
tree09dec61e5e37457843380f1bd0151bf8e2e618e6
parentd8e610dcaf2fcade0ac16b157125b0f68036c8eb (diff)
SDNC ODL cluster POC
Issue-ID: SDNC-163 Change-Id: I593b4d7e36e59ebcc3585029f65b24b185172cb2 Signed-off-by: Hao Kuang <Hao.Kuang@amdocs.com> Former-commit-id: 1d556c7996f91cd9a0d28aadb1ee922d44042e60
-rw-r--r--installation/sdnc/src/main/scripts/startODL.sh29
1 files changed, 29 insertions, 0 deletions
diff --git a/installation/sdnc/src/main/scripts/startODL.sh b/installation/sdnc/src/main/scripts/startODL.sh
index 79f58794..ec7fb791 100644
--- a/installation/sdnc/src/main/scripts/startODL.sh
+++ b/installation/sdnc/src/main/scripts/startODL.sh
@@ -21,6 +21,33 @@
# ============LICENSE_END=========================================================
###
+function enable_odl_cluster(){
+ if [ -z $SDNC_REPLICAS ]; then
+ echo "SDNC_REPLICAS is not configured in Env field"
+ exit
+ fi
+
+ echo "Installing Opendaylight cluster features"
+ ${ODL_HOME}/bin/client -u karaf feature:install odl-mdsal-clustering
+ ${ODL_HOME}/bin/client -u karaf feature:install odl-jolokia
+
+ echo "Update cluster information statically"
+ hm=$(hostname)
+ echo "Get current Hostname ${hm}"
+
+ node=($(echo ${hm} | tr '-' '\n'))
+ node_name=${node[0]}
+ node_index=${node[1]}
+ node_list="${node_name}-0.sdnhost-cluster.onap-sdnc.svc.cluster.local";
+
+ for ((i=1;i<${SDNC_REPLICAS};i++));
+ do
+ node_list="${node_list} ${node_name}-$i.sdnhost-cluster.onap-sdnc.svc.cluster.local"
+ done
+
+ /opt/opendaylight/current/bin/configure_cluster.sh $((node_index+1)) ${node_list}
+}
+
# Install SDN-C platform components if not already installed and start container
@@ -29,6 +56,7 @@ ODL_ADMIN_PASSWORD=${ODL_ADMIN_PASSWORD:-Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJv
SDNC_HOME=${SDNC_HOME:-/opt/onap/sdnc}
SLEEP_TIME=${SLEEP_TIME:-120}
MYSQL_PASSWD=${MYSQL_PASSWD:-openECOMP1.0}
+ENABLE_ODL_CLUSTER=${ENABLE_ODL_CLUSTER:-false}
#
# Wait for database
@@ -59,6 +87,7 @@ then
${SDNC_HOME}/svclogic/bin/install.sh
fi
+ if $ENABLE_ODL_CLUSTER ; then enable_odl_cluster ; fi
echo "Restarting OpenDaylight"
${ODL_HOME}/bin/stop