3 if [[ ${CONTROLLERFEATURES} == *federation* ]]; then
5 cat > ${WORKSPACE}/install_federation_rabbit.sh <<EOF
7 echo "Install rabbit server ..."
8 sudo yum install -y erlang
9 sudo yum install -y rabbitmq-server # Technically we should only install on the first ODL
11 echo "Starting rabbit server ..."
12 sudo chkconfig rabbitmq-server
13 sudo service rabbitmq-server start
15 echo "Add federation user to rabbit server ..."
16 sudo /usr/sbin/rabbitmqctl add_user federation federation
17 sudo rabbitmqctl set_permissions -p / federation ".*" ".*" ".*"
21 cat > ${WORKSPACE}/configure_federation_rabbit.sh <<EOF
23 echo "Configuring rabbit broker for ODL ..."
24 SERVICECONF=\$(find "/tmp/${BUNDLEFOLDER}/" -name "federation-service-impl-*config.xml")
25 sed -ie "s/<mqBrokerIp>.*</<mqBrokerIp>\$1</g" \${SERVICECONF}
26 sed -ie "s/<site-ip>.*</<site-ip>\$2</g" \${SERVICECONF}
27 sed -ie "s/CONTROL_QUEUE_.*</CONTROL_QUEUE_\$2</g" \${SERVICECONF}
28 sed -ie "s/guest/federation/g" \${SERVICECONF}
33 NUM_ODLS_PER_SITE=$((NUM_ODL_SYSTEM / NUM_OPENSTACK_SITES))
34 echo "Copying config files to ODL Controller folder"
35 for i in `seq 1 ${NUM_OPENSTACK_SITES}`
37 FIRST_ODL_IN_SITE=ODL_SYSTEM_$(((i - 1) * NUM_ODLS_PER_SITE + 1))_IP
38 RABBIT_SERVER_IP=${!FIRST_ODL_IN_SITE} # We install Rabbit on the first ODL in each site
39 CONTROLLERIP=ODL_SYSTEM_$(((i - 1) * NUM_ODLS_PER_SITE + j))_IP
41 scp ${WORKSPACE}/install_federation_rabbit.sh ${RABBIT_SERVER_IP}:/tmp/
42 ssh ${RABBIT_SERVER_IP} 'bash /tmp/install_federation_rabbit.sh'
44 for j in `seq 1 ${NUM_ODLS_PER_SITE}`
46 ODL_IP=ODL_SYSTEM_$(((i - 1) * NUM_ODLS_PER_SITE + j))_IP
47 if [ ${NUM_ODLS_PER_SITE} -gt 1 ]; then
48 HA_PROXY_IP=OPENSTACK_HAPROXY_${i}_IP
49 SITE_IP=${!HA_PROXY_IP}
51 SITE_IP=${RABBIT_SERVER_IP}
53 echo "Setting rabbit client site IP to ${SITE_IP} and rabbit servier IP to ${RABBIT_SERVER_IP} on ${!ODL_IP}"
55 scp ${WORKSPACE}/configure_federation_rabbit.sh ${!ODL_IP}:/tmp/
56 ssh ${!ODL_IP} 'bash /tmp/configure_federation_rabbit.sh' ${RABBIT_SERVER_IP} ${SITE_IP}