From 702d105ef26c9868632aab515484ae7eef1fea4e Mon Sep 17 00:00:00 2001 From: Trevor Tait Date: Fri, 20 Apr 2018 11:21:09 -0400 Subject: Fix startODL.sh Issue-ID: SDNC-286 Change-Id: I223e97c634deac5d235701f30e755b86b13a27ad Signed-off-by: Trevor Tait --- kubernetes/sdnc/resources/config/bin/startODL.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'kubernetes/sdnc/resources') diff --git a/kubernetes/sdnc/resources/config/bin/startODL.sh b/kubernetes/sdnc/resources/config/bin/startODL.sh index aa5b6d1479..288ce11b8b 100755 --- a/kubernetes/sdnc/resources/config/bin/startODL.sh +++ b/kubernetes/sdnc/resources/config/bin/startODL.sh @@ -34,17 +34,17 @@ function enable_odl_cluster(){ hm=$(hostname) echo "Get current Hostname ${hm}" - node=($(echo ${hm} | tr '-' '\n')) - node_name=${node[0]} - node_index=${node[1]} + node=($(echo ${hm} | sed 's/-[0-9]*$//g')) + node_index=($(echo ${hm} | awk -F"-" '{print $NF}')) + member_offset=1 if [ -z $PEER_ODL_CLUSTER ]; then echo "This is a local cluster" - node_list="${node_name}-0.{{.Values.service.name}}-cluster.{{.Release.Namespace}}"; + node_list="${node}-0.{{.Values.service.name}}-cluster.{{.Release.Namespace}}"; for ((i=1;i<${SDNC_REPLICAS};i++)); do - node_list="${node_list} ${node_name}-$i.{{.Values.service.name}}-cluster.{{.Release.Namespace}}" + node_list="${node_list} ${node}-$i.{{.Values.service.name}}-cluster.{{.Release.Namespace}}" done /opt/opendaylight/current/bin/configure_cluster.sh $((node_index+1)) ${node_list} else @@ -70,6 +70,7 @@ function enable_odl_cluster(){ ODL_HOME=${ODL_HOME:-/opt/opendaylight/current} ODL_ADMIN_PASSWORD=${ODL_ADMIN_PASSWORD:-Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U} SDNC_HOME=${SDNC_HOME:-/opt/onap/sdnc} +CCSDK_HOME=${CCSDK_HOME:-/opt/onap/ccsdk} SLEEP_TIME=${SLEEP_TIME:-120} MYSQL_PASSWD=${MYSQL_PASSWD:-{{.Values.config.dbRootPassword}}} ENABLE_ODL_CLUSTER=${ENABLE_ODL_CLUSTER:-false} @@ -95,6 +96,7 @@ then echo "Installing SDN-C keyStore" ${SDNC_HOME}/bin/addSdncKeyStore.sh echo "Starting OpenDaylight" + ${CCSDK_HOME}/bin/installOdlHostKey.sh ${ODL_HOME}/bin/start echo "Waiting ${SLEEP_TIME} seconds for OpenDaylight to initialize" sleep ${SLEEP_TIME} -- cgit 1.2.3-korg