1 echo "#################################################"
2 echo "## Install Distribution in Cluster ##"
3 echo "#################################################"
7 if [ ${CONTROLLERSCOPE} == 'all' ]; then
8 ACTUALFEATURES="odl-integration-compatible-with-all,${CONTROLLERFEATURES}"
11 ACTUALFEATURES="${CONTROLLERFEATURES}"
13 # Some versions of jenkins job builder result in feature list containing spaces
14 # and ending in newline. Remove all that.
15 ACTUALFEATURES=`echo "${ACTUALFEATURES}" | tr -d '\n \r'`
17 cat > ${WORKSPACE}/deploy-controller-script.sh <<EOF
19 if [ ${JDKVERSION} == 'openjdk8' ]; then
20 echo "Setting the JDK Version to 8"
21 sudo /usr/sbin/alternatives --set java /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.60-2.b27.el7_1.x86_64/jre/bin/java
22 export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.60-2.b27.el7_1.x86_64
25 if [ ${JDKVERSION} == 'openjdk7' ]; then
26 echo "Setting the JDK Version to 7"
27 sudo /usr/sbin/alternatives --set java /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.85-2.6.1.2.el7_1.x86_64/jre/bin/java
28 export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.85-2.6.1.2.el7_1.x86_64
32 echo "Changing to /tmp"
35 echo "Downloading the distribution from ${ACTUALBUNDLEURL}"
36 wget --no-verbose '${ACTUALBUNDLEURL}'
38 echo "Extracting the new controller..."
41 echo "Configuring the startup features..."
42 FEATURESCONF=/tmp/${BUNDLEFOLDER}/etc/org.apache.karaf.features.cfg
43 sed -ie "s/featuresBoot=.*/featuresBoot=config,standard,region,package,kar,ssh,management,${ACTUALFEATURES}/g" \${FEATURESCONF}
44 sed -ie "s%mvn:org.opendaylight.integration/features-integration-index/${BUNDLEVERSION}/xml/features%mvn:org.opendaylight.integration/features-integration-index/${BUNDLEVERSION}/xml/features,mvn:org.opendaylight.integration/features-integration-test/${BUNDLEVERSION}/xml/features%g" \${FEATURESCONF}
47 echo "Configuring the log..."
48 LOGCONF=/tmp/${BUNDLEFOLDER}/etc/org.ops4j.pax.logging.cfg
49 sed -ie 's/log4j.appender.out.maxBackupIndex=10/log4j.appender.out.maxBackupIndex=1/g' \${LOGCONF}
50 # FIXME: Make log size limit configurable from build parameter.
51 sed -ie 's/log4j.appender.out.maxFileSize=1MB/log4j.appender.out.maxFileSize=100GB/g' \${LOGCONF}
54 echo "Configure max memory..."
55 MEMCONF=/tmp/${BUNDLEFOLDER}/bin/setenv
56 sed -ie 's/JAVA_MAX_MEM="2048m"/JAVA_MAX_MEM="${CONTROLLERMEM}"/g' \${MEMCONF}
59 echo "Listing all open ports on controller system"
62 echo "JDK Version ..."
67 for i in `seq 1 ${NUM_ODL_SYSTEM}`
69 CONTROLLERIP=ODL_SYSTEM_${i}_IP
70 echo "Installing distribution in member-${i} with IP address ${!CONTROLLERIP}"
71 scp ${WORKSPACE}/deploy-controller-script.sh ${!CONTROLLERIP}:/tmp
72 ssh ${!CONTROLLERIP} 'bash /tmp/deploy-controller-script.sh'
75 # vim: ts=4 sw=4 sts=4 et ft=sh :