Updated Branches: refs/heads/master 762394b3f -> b2f56c86f
Update Stratos Installer to support CEP Signed-off-by: Imesh Gunaratne <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/01f1ef0a Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/01f1ef0a Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/01f1ef0a Branch: refs/heads/master Commit: 01f1ef0a7cf20c9969a2bf9823c597047022b41e Parents: da3cd1d Author: Dinesh Bandara <[email protected]> Authored: Tue Dec 3 15:46:00 2013 +0530 Committer: Imesh Gunaratne <[email protected]> Committed: Tue Dec 3 16:26:32 2013 +0530 ---------------------------------------------------------------------- tools/stratos-installer/conf/setup.conf | 14 ++++ .../config/cep/repository/conf/jndi.properties | 13 ++++ tools/stratos-installer/setup.sh | 67 +++++++++++++++++++- tools/stratos-installer/start-servers.sh | 15 ++++- 4 files changed, 106 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/01f1ef0a/tools/stratos-installer/conf/setup.conf ---------------------------------------------------------------------- diff --git a/tools/stratos-installer/conf/setup.conf b/tools/stratos-installer/conf/setup.conf index 551b467..ca6c054 100644 --- a/tools/stratos-installer/conf/setup.conf +++ b/tools/stratos-installer/conf/setup.conf @@ -58,6 +58,20 @@ export mb_listen_port=$((5672 + $mb_port_offset)) export mb_ip="mb-ip" # Machine ip on which mb run +# CEP configuration +# ---------------------------------------------------------------------------- +export cep_extension_path= #Folder path containing cep extensions +export cep_extension_jar=$stratos_pack_path/"org.apache.stratos.cep.extension-1.0.0-SNAPSHOT.jar" # cep extensions jaf file name + +export cep_path=$stratos_path/"wso2cep-3.0.0" +export cep_pack=$stratos_pack_path/"wso2cep-3.0.0.zip" + +export cep_hostname=cep.$stratos_domain +export cep_port_offset=4 +export cep_listen_port=$((7611 + $cep_port_offset)) +export cep_ip="cep-ip" # Machine ip on which cep run + + # SC configuration # ---------------------------------------------------------------------------- export sc_path=$stratos_path/"apache-stratos-sc-4.0.0-SNAPSHOT" http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/01f1ef0a/tools/stratos-installer/config/cep/repository/conf/jndi.properties ---------------------------------------------------------------------- diff --git a/tools/stratos-installer/config/cep/repository/conf/jndi.properties b/tools/stratos-installer/config/cep/repository/conf/jndi.properties new file mode 100644 index 0000000..248504a --- /dev/null +++ b/tools/stratos-installer/config/cep/repository/conf/jndi.properties @@ -0,0 +1,13 @@ +java.naming.factory.initial = org.wso2.andes.jndi.PropertiesFileInitialContextFactory + +# use the following property to configure the default connector +connectionfactory.topicConnectionfactory=amqp://admin:admin@clientID/carbon?brokerlist='tcp://MB_HOSTNAME:MB_LISTEN_PORT'&reconnect='true' + +# use the following property to specify the JNDI name of the connection factory +connectionFactoryNames = connectionfactory, topicConnectionfactory + +# register some topics in JNDI using the form +# topic.[jndiName] = [physicalName] +topic.lb-stats = lb-stats +topic.instance-stats = instance-stats +topic.summarized-health-stats = summarized-health-stats http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/01f1ef0a/tools/stratos-installer/setup.sh ---------------------------------------------------------------------- diff --git a/tools/stratos-installer/setup.sh b/tools/stratos-installer/setup.sh index c77de89..baa31fb 100755 --- a/tools/stratos-installer/setup.sh +++ b/tools/stratos-installer/setup.sh @@ -36,8 +36,8 @@ cc="false" elb="false" agent="false" sc="false" -#bam="false" -product_list="mb;cc;elb;agent;sc" +cep="false" +product_list="mb;cc;cep;elb;agent;sc" enable_internal_git=false function help { @@ -83,6 +83,9 @@ do if [[ $x = "cc" ]]; then cc="true" fi + if [[ $x = "cep" ]]; then + cep="true" + fi if [[ $x = "elb" ]]; then elb="true" fi @@ -167,6 +170,9 @@ function setup_validate { if [[ -z $elb_hostname ]]; then elb_hostname=$hostname fi + if [[ -z $cep_hostname ]]; then + cep_hostname=$hostname + fi if [[ ( -z $hostip ) ]]; then hostip=$(ifconfig eth0| sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p') @@ -184,6 +190,14 @@ function setup_validate { fi fi + if [[ ( -z $cep_ip ) ]]; then + cep_ip=$(ifconfig eth0| sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p') + if [[ ( -z cep_ip ) ]]; then + helpsetup + exit 1 + fi + fi + if [[ ( -z $elb_ip ) ]]; then elb_ip=$(ifconfig eth0| sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p') if [[ ( -z elb_ip ) ]]; then @@ -237,6 +251,13 @@ function setup_validate { fi fi + if [[ $cep = "true" ]]; then + if [[ ( -z $hostname || -z $cep_path || ! -f $cep_extension_jar ) ]]; then + helpsetup + exit 1 + fi + fi + if [[ $elb = "true" ]]; then if [[ ( -z $hostname || -z $elb_path ) ]]; then helpsetup @@ -331,6 +352,11 @@ if [[ $agent = "true" ]]; then unzip $agent_pack -d $stratos_path fi fi +if [[ $cep = "true" ]]; then + if [[ ! -d $cep_path ]]; then + unzip $cep_pack -d $stratos_path + fi +fi # ------------------------------------------------ # Setup MB @@ -349,6 +375,43 @@ if [[ $mb = "true" ]]; then popd #mb_path fi +# ------------------------------------------------ +# Setup CEP +# ------------------------------------------------ +if [[ $cep = "true" ]]; then + echo "Setup CEP" >> $LOG + echo "Configuring the Complex Event Processor" + + cp -f ./config/cep/repository/conf/jndi.properties $cep_path/repository/conf/ + cp -f $cep_extension_jar $cep_path/repository/components/lib/ + cp -f $cep_extension_path/artifacts/eventbuilders/*.xml $cep_path/repository/deployment/server/eventbuilders/ + cp -f $cep_extension_path/artifacts/inputeventadaptors/*.xml $cep_path/repository/deployment/server/inputeventadaptors/ + cp -f $cep_extension_path/artifacts/outputeventadaptors/*.xml $cep_path/repository/deployment/server/outputeventadaptors/ + cp -f $cep_extension_path/artifacts/executionplans/*.xml $cep_path/repository/deployment/server/executionplans/ + cp -f $cep_extension_path/artifacts/eventformatters/*.xml $cep_path/repository/deployment/server/eventformatters/ + + pushd $cep_path + + echo "In repository/conf/carbon.xml" + cp -f repository/conf/carbon.xml repository/conf/carbon.xml.orig + cat repository/conf/carbon.xml.orig | sed -e "s@<Offset>0</Offset>@<Offset>${cep_port_offset}</Offset>@g" > repository/conf/carbon.xml + + echo "In repository/conf/jndi.properties" + cp -f repository/conf/jndi.properties repository/conf/jndi.properties.orig + cat repository/conf/jndi.properties.orig | sed -e "s@MB_HOSTNAME:MB_LISTEN_PORT@$mb_hostname:$mb_listen_port@g" > repository/conf/jndi.properties + + echo "In repository/conf/siddhi/siddhi.extension" + cp -f repository/conf/siddhi/siddhi.extension repository/conf/siddhi/siddhi.extension.orig + echo "org.apache.stratos.cep.extension.GradientFinderWindowProcessor" >> repository/conf/siddhi/siddhi.extension.orig + echo "org.apache.stratos.cep.extension.SecondDerivativeFinderWindowProcessor" >> repository/conf/siddhi/siddhi.extension.orig + echo "org.apache.stratos.cep.extension.FaultHandlingWindowProcessor" >> repository/conf/siddhi/siddhi.extension.orig + mv -f repository/conf/siddhi/siddhi.extension.orig repository/conf/siddhi/siddhi.extension + + echo "End configuring the Complex Event Processor" + popd #cep_path +fi + + if [[ $sc = "true" ]]; then ## # mysql -u${userstore_db_user} -p${userstore_db_pass} -e "GRANT ALL PRIVILEGES ON *.* TO '${userstore_db_user}'@'%' IDENTIFIED BY '${userstore_db_pass}' WITH GRANT OPTION;flush privileges;" http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/01f1ef0a/tools/stratos-installer/start-servers.sh ---------------------------------------------------------------------- diff --git a/tools/stratos-installer/start-servers.sh b/tools/stratos-installer/start-servers.sh index 9d3f194..af13e1c 100755 --- a/tools/stratos-installer/start-servers.sh +++ b/tools/stratos-installer/start-servers.sh @@ -64,6 +64,9 @@ do if [[ $x = "mb" ]]; then mb="true" fi + if [[ $x = "cep" ]]; then + cep="true" + fi if [[ $x = "cc" ]]; then cc="true" fi @@ -82,7 +85,7 @@ do elb="true" agent="true" sc="true" - bam="true" + cep="true" fi if [[ $x = "demo" ]]; then demo="true" @@ -109,6 +112,16 @@ if [[ $mb = "true" ]]; then sleep $SLEEP fi +if [[ $cep = "true" ]]; then + echo ${cep_path} + + echo "Starting CEP server ..." >> $LOG + nohup ${cep_path}/bin/wso2server.sh & + echo "CEP server started" >> $LOG + sleep $SLEEP + sleep $SLEEP +fi + if [[ $cc = "true" ]]; then echo ${cc_path}
