#!/bin/bash for step in {1..$1} do mkdir /opt/uesb$step #Create a clone of UlatraESB cp -r /opt/ultraesb/* /opt/uesb$step/ #Change ULTRA_HOME sed -i "s/\/opt\/ultraesb/\/opt\/uesb$step/g" /opt/uesb$step/bin/ultraesb-daemon.sh #Change ram disk path sed -i "s/\/tmp\/ram/\/tmp\/ram$step/g" /opt/uesb$step/conf/ultra-root.xml #Change ram disk overflow path sed -i "s/\/tmp\/overflow/\/tmp\/overflow$step/g" /opt/uesb$step/conf/ultra-root.xml #Change HTTP port sed -i "s/property name=\"port\" value=\"8280\"/property name=\"port\" value=\"$((step+8280))\"/g" /opt/uesb$step/conf/ultra-root.xml #Change HTTPS port sed -i "s/property name=\"port\" value=\"8443\"/property name=\"port\" value=\"$((step+8443))\"/g" /opt/uesb$step/conf/ultra-root.xml #Change host name sed -i "s/name=\"nodeName\" value=\"192.168.56.5\"/name=\"nodeName\" value=\"node$step\"/g" /opt/uesb$step/conf/ultra-root.xml #Change JMX Ports sed -i "s/9994/${step}9994/g" /opt/uesb$step/conf/ultra-root.xml sed -i "s/1099/1${step}99/g" /opt/uesb$step/conf/ultra-root.xml #Changing wrapper name sed -i "s/wrapper.ntservice.name=UltraESB/wrapper.ntservice.name=uesb$step/g" /opt/uesb$step/conf/wrapper.conf #Add init scripts cd /etc/init.d sudo ln -s /opt/uesb$step/bin/ultraesb-daemon.sh uesb$step sudo chown -R ultraesb:ultraesb /opt/uesb$step/ #sudo service uesb$step start done
Sunday, November 29, 2015
UltraESB - Cloning Script
In some cases you may need to build a UltraESB cluster running in a single machine. In that case you should make sure ports that each UltraESB instance acquire does not conflict with others. This script makes sure that a UltraESB installed in a default location (/opt/ultraesb) is cloned into a given number of instances in /opt/uesb1,2,3.. path. To run this, you have to give number of clones you need to have as a parameter.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment