diff options
Diffstat (limited to 'kubernetes/sdnc/resources/config/bin/startODL.sh')
-rwxr-xr-x | kubernetes/sdnc/resources/config/bin/startODL.sh | 39 |
1 files changed, 32 insertions, 7 deletions
diff --git a/kubernetes/sdnc/resources/config/bin/startODL.sh b/kubernetes/sdnc/resources/config/bin/startODL.sh index 0c41d3e3e0..288ce11b8b 100755 --- a/kubernetes/sdnc/resources/config/bin/startODL.sh +++ b/kubernetes/sdnc/resources/config/bin/startODL.sh @@ -36,23 +36,47 @@ function enable_odl_cluster(){ node=($(echo ${hm} | sed 's/-[0-9]*$//g')) node_index=($(echo ${hm} | awk -F"-" '{print $NF}')) - node_list="${node}-0.{{ .Values.service.name }}-cluster.{{.Release.Namespace}}"; + member_offset=1 + + if [ -z $PEER_ODL_CLUSTER ]; then + echo "This is a local cluster" + node_list="${node}-0.{{.Values.service.name}}-cluster.{{.Release.Namespace}}"; + + for ((i=1;i<${SDNC_REPLICAS};i++)); + do + 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 + echo "This is a Geo cluster" + + if $IS_PRIMARY_CLUSTER; then + PRIMARY_NODE=${MY_ODL_CLUSTER} + SECONDARY_NODE=${PEER_ODL_CLUSTER} + else + PRIMARY_NODE=${PEER_ODL_CLUSTER} + SECONDARY_NODE=${MY_ODL_CLUSTER} + member_offset=4 + fi + + node_list="${PRIMARY_NODE} ${SECONDARY_NODE}" + /opt/onap/sdnc/bin/configure_geo_cluster.sh $((node_index+member_offset)) ${node_list} + fi +} - for ((i=1;i<${SDNC_REPLICAS};i++)); - do - 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} -} +# Install SDN-C platform components if not already installed and start container 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} MYSQL_HOST=${MYSQL_HOST:-{{.Release.Name}}-{{.Values.mysql.nameOverride}}-0.{{.Values.mysql.service.name}}.{{.Release.Namespace}}} +IS_PRIMARY_CLUSTER=${IS_PRIMARY_CLUSTER:-false} +MY_ODL_CLUSTER=${MY_ODL_CLUSTER:-127.0.0.1} # # Wait for database to init properly @@ -72,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} |