You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by ni...@apache.org on 2014/03/22 08:37:29 UTC
[5/5] git commit: adding set of scripts to setup single JVM - initial
version- only for default profile case
adding set of scripts to setup single JVM - initial version- only for default profile case
Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/0155eca7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/0155eca7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/0155eca7
Branch: refs/heads/master
Commit: 0155eca7dfe22e646e83528387ac74dca3831e92
Parents: 9868a68
Author: Nirmal Fernando <ni...@apache.org>
Authored: Sat Mar 22 13:05:57 2014 +0530
Committer: Nirmal Fernando <ni...@apache.org>
Committed: Sat Mar 22 13:05:57 2014 +0530
----------------------------------------------------------------------
tools/stratos-installer/conf/stratos-setup.conf | 199 ++++++
.../repository/conf/activemq/jndi.properties | 28 +
tools/stratos-installer/stratos-db-clean.sh | 4 +
tools/stratos-installer/stratos-ec2.sh | 79 +++
tools/stratos-installer/stratos-openstack.sh | 69 ++
tools/stratos-installer/stratos-setup.sh | 651 +++++++++++++++++++
.../stratos-installer/stratos-start-servers.sh | 119 ++++
tools/stratos-installer/stratos-vcloud.sh | 69 ++
8 files changed, 1218 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/0155eca7/tools/stratos-installer/conf/stratos-setup.conf
----------------------------------------------------------------------
diff --git a/tools/stratos-installer/conf/stratos-setup.conf b/tools/stratos-installer/conf/stratos-setup.conf
new file mode 100644
index 0000000..582cde5
--- /dev/null
+++ b/tools/stratos-installer/conf/stratos-setup.conf
@@ -0,0 +1,199 @@
+#!/bin/bash
+# ----------------------------------------------------------------------------
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# ----------------------------------------------------------------------------
+#
+# Server configuration script for Apache Stratos
+# ----------------------------------------------------------------------------
+#
+# Configure below parameters to install Apache Stratos using ../setup.sh.
+# General configuration parameters are mandatory and other sections are optional. Configure each section on each node where
+# Stratos product is installed.
+#
+# ----------------------------------------------------------------------------
+
+
+#########################################################################################################
+#########################################################################################################
+#########################################################################################################
+############################## User Configs Start ##################################
+#########################################################################################################
+#########################################################################################################
+#########################################################################################################
+
+# ----------------------------------------------------------------------------
+# General configuration
+# ----------------------------------------------------------------------------
+export setup_path= #path to stratos-installer directory
+
+####### path to packages/binaries/jars
+####### apache-stratos-4.0.0-SNAPSHOT.zip
+####### apache-activemq-5.8.0-bin.tar.gz
+####### org.apache.stratos.cep.extension-1.0.0-SNAPSHOT.jar
+####### mysql-connector-java-5.1.25.jar
+####### activemq jars: In activemq 5.8 case you need following jars;
+####### from activemq lib directory: activemq-broker-5.8.0.jar activemq-client-5.8.0.jar geronimo-j2ee-management_1.1_spec-1.0.1.jar geronimo-jms_1.1_spec-1.1.1.jar
+####### hawtbuf-1.2.jar from http://repo1.maven.org/maven2/org/fusesource/hawtbuf/hawtbuf/1.2/hawtbuf-1.2.jar
+export stratos_pack_path= #Path to stratos-packs directory
+
+export mysql_connector_jar=$stratos_pack_path/"mysql-connector-java-5.1.29-bin.jar" #mysql connector jar file name
+
+export stratos_path= #Folder which stratos will be installed
+
+export JAVA_HOME= #Java home path
+
+export log_path=/var/log/apache-stratos
+
+export host_user="" #A host user account for the machine which run Stratos component(s)
+
+export stratos_domain="stratos.apache.org"
+
+export machine_ip="127.0.0.1"
+export offset=0
+
+export mb_ip="127.0.0.1" # Machine ip on which mb run
+export mb_port=61616 #default port which the message broker service runs - it's 61616 in activemq case.
+
+export cep_artifacts_path= #Folder path containing cep artifacts files
+
+export puppet_ip="127.0.0.1" # Machine ip on which puppet master run
+export puppet_hostname="puppet.stratos.com" # Host name given to identify the puppet master
+# puppet_environment is not necessary to change, if you do not have any specific configuration
+export puppet_environment="stratos" # Name of puppet environment
+
+# IaaS Providers
+# ----------------------------------------------------------------------------
+# Set <iaas-name>_provider_enabled parameter to true to enable desired IaaS. A hybrid cloud could be
+# created using multiple IaaSs.
+
+# EC2
+export ec2_provider_enabled=true
+export ec2_identity="<ec2_identity>"
+export ec2_credential="<ec2_credential>"
+export ec2_keypair_name="<ec2_keypair_name>"
+export ec2_owner_id="<ec2_owner_id>"
+export ec2_availability_zone="<ec2_availability_zone>"
+export ec2_security_groups="<ec2_security_groups>"
+
+# Openstack
+export openstack_provider_enabled=false
+export openstack_identity="stratos:stratos" # Openstack project name:Openstack login user
+export openstack_credential="password" # Openstack login password
+export openstack_jclouds_endpoint="http://hostname:5000/v2.0"
+export openstack_keypair_name=""
+export openstack_security_groups="security-groups"
+
+# vCloud
+export vcloud_provider_enabled=false
+export vcloud_identity="stratos" # vCloud login user
+export vcloud_credential="password" # vCloud login password
+export vcloud_jclouds_endpoint="https://vcloud/api"
+
+# userstore database configuration
+export userstore_db_hostname="localhost"
+export userstore_db_schema="userstore"
+export userstore_db_port="3306"
+export userstore_db_user="root"
+export userstore_db_pass="root"
+
+
+#########################################################################################################
+#########################################################################################################
+#########################################################################################################
+############################## User Configs End ##################################
+#########################################################################################################
+#########################################################################################################
+#########################################################################################################
+
+export cep_ip=$machine_ip # Machine ip on which cep run
+export cc_ip=$machine_ip # Machine ip on which cc run
+export as_ip=$machine_ip # Machine ip on which auto scalar run
+export sm_ip=$machine_ip # Machine ip on which sc run
+
+export cc_port_offset=$offset
+export sm_port_offset=$offset
+export as_port_offset=$offset
+export cep_port_offset=$offset
+export mb_port_offset=$offset
+
+export mb_hostname="mb.$stratos_domain"
+export cep_hostname="cep.$stratos_domain"
+export sm_hostname="$stratos_domain"
+export cc_hostname="cc.$stratos_domain"
+export as_hostname="as.$stratos_domain"
+
+export resource_path=$setup_path/resources
+
+# ----------------------------------------------------------------------------
+# General configuration
+# ----------------------------------------------------------------------------
+export stratos_dist_path=$stratos_path/"apache-stratos-4.0.0-SNAPSHOT"
+export stratos_pack=$stratos_pack_path/"apache-stratos-4.0.0-SNAPSHOT.zip"
+
+# ----------------------------------------------------------------------------
+# MB configuration
+# ----------------------------------------------------------------------------
+export mb_path=$stratos_path/"apache-activemq-5.8.0"
+export mb_pack_path=$stratos_pack_path/"apache-activemq-5.8.0-bin.tar.gz"
+
+
+# ----------------------------------------------------------------------------
+# CEP configuration
+# ----------------------------------------------------------------------------
+export cep_extension_jar=$stratos_pack_path/"org.apache.stratos.cep.extension-1.0.0-SNAPSHOT.jar" # cep extensions jar file name
+
+export cep_path=$stratos_dist_path
+
+export cep_mb_ip=$mb_ip
+export cep_mb_listen_port=$(($mb_port + $mb_port_offset))
+
+
+# ----------------------------------------------------------------------------
+# CC configuration
+# ----------------------------------------------------------------------------
+export cc_path=$stratos_dist_path
+
+export cc_mb_listen_port=$(($mb_port + $mb_port_offset))
+export cc_https_port=$((9443 + $cc_port_offset))
+
+# ----------------------------------------------------------------------------
+# Auto Scalar configuration
+# ----------------------------------------------------------------------------
+export as_path=$stratos_dist_path
+
+export as_mb_listen_port=$(($mb_port + $mb_port_offset))
+export as_cc_https_port=$((9443 + $cc_port_offset))
+export as_sm_https_port=$((9443 + $sm_port_offset))
+
+
+# ----------------------------------------------------------------------------
+# SM configuration
+# ----------------------------------------------------------------------------
+export sm_path=$stratos_dist_path
+
+export sm_puppet_ip=$puppet_ip
+export sm_puppet_hostname=$puppet_hostname
+export sm_puppet_environment=$puppet_environment
+export sm_mb_listen_port=$(($mb_port + $mb_port_offset))
+export sm_cc_https_port=$((9443 + $cc_port_offset))
+export sm_as_https_port=$((9443 + $as_port_offset))
+export sm_https_port=$((9443 + $sm_port_offset))
+export sm_http_port=$((9763 + $sm_port_offset))
+
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/0155eca7/tools/stratos-installer/config/cep/repository/conf/activemq/jndi.properties
----------------------------------------------------------------------
diff --git a/tools/stratos-installer/config/cep/repository/conf/activemq/jndi.properties b/tools/stratos-installer/config/cep/repository/conf/activemq/jndi.properties
new file mode 100644
index 0000000..eeceda3
--- /dev/null
+++ b/tools/stratos-installer/config/cep/repository/conf/activemq/jndi.properties
@@ -0,0 +1,28 @@
+#
+# Copyright (c) 2011, WSO2 Inc. (http://wso2.com) All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# register some connection factories
+# connectionfactory.[jndiname]=[ConnectionURL]
+
+connectionfactoryName=TopicConnectionFactory
+java.naming.provider.url=tcp://MB_HOSTNAME:MB_LISTEN_PORT
+java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory
+
+# 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/0155eca7/tools/stratos-installer/stratos-db-clean.sh
----------------------------------------------------------------------
diff --git a/tools/stratos-installer/stratos-db-clean.sh b/tools/stratos-installer/stratos-db-clean.sh
new file mode 100755
index 0000000..bc4afe8
--- /dev/null
+++ b/tools/stratos-installer/stratos-db-clean.sh
@@ -0,0 +1,4 @@
+# cleans up databases
+mysql -uroot -proot -e "DROP DATABASE IF EXISTS stratos_foundation;"
+mysql -uroot -proot -e "DROP DATABASE IF EXISTS userstore;"
+
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/0155eca7/tools/stratos-installer/stratos-ec2.sh
----------------------------------------------------------------------
diff --git a/tools/stratos-installer/stratos-ec2.sh b/tools/stratos-installer/stratos-ec2.sh
new file mode 100755
index 0000000..de26fcc
--- /dev/null
+++ b/tools/stratos-installer/stratos-ec2.sh
@@ -0,0 +1,79 @@
+#!/bin/bash
+# ----------------------------------------------------------------------------
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# ----------------------------------------------------------------------------
+#
+# This script is invoked by setup.sh for configuring Amazon EC2 IaaS information.
+# ----------------------------------------------------------------------------
+
+# Die on any error:
+set -e
+
+SLEEP=60
+export LOG=$log_path/stratos-ec2.log
+
+source "./conf/stratos-setup.conf"
+
+if [[ ! -d $log_path ]]; then
+ mkdir -p $log_path
+fi
+
+pushd $cc_path
+
+echo "Set EC2 provider specific info in repository/conf/cloud-controller.xml" >> $LOG
+
+cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
+cat repository/conf/cloud-controller.xml.orig | sed -e "s@EC2_PROVIDER_START@@g" > repository/conf/cloud-controller.xml
+
+cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
+cat repository/conf/cloud-controller.xml.orig | sed -e "s@EC2_IDENTITY@$ec2_identity@g" > repository/conf/cloud-controller.xml
+
+cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
+cat repository/conf/cloud-controller.xml.orig | sed -e "s@EC2_CREDENTIAL@$ec2_credential@g" > repository/conf/cloud-controller.xml
+
+cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
+cat repository/conf/cloud-controller.xml.orig | sed -e "s@EC2_OWNER_ID@$ec2_owner_id@g" > repository/conf/cloud-controller.xml
+
+cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
+cat repository/conf/cloud-controller.xml.orig | sed -e "s@EC2_AVAILABILITY_ZONE@$ec2_availability_zone@g" > repository/conf/cloud-controller.xml
+
+cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
+cat repository/conf/cloud-controller.xml.orig | sed -e "s@EC2_SECURITY_GROUPS@$ec2_security_groups@g" > repository/conf/cloud-controller.xml
+
+cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
+cat repository/conf/cloud-controller.xml.orig | sed -e "s@EC2_KEYPAIR@$ec2_keypair_name@g" > repository/conf/cloud-controller.xml
+
+cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
+cat repository/conf/cloud-controller.xml.orig | sed -e "s@EC2_PROVIDER_END@@g" > repository/conf/cloud-controller.xml
+
+cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
+cat repository/conf/cloud-controller.xml.orig | sed -e "s@OPENSTACK_PROVIDER_START@!--@g" > repository/conf/cloud-controller.xml
+
+cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
+cat repository/conf/cloud-controller.xml.orig | sed -e "s@OPENSTACK_PROVIDER_END@--@g" > repository/conf/cloud-controller.xml
+
+cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
+cat repository/conf/cloud-controller.xml.orig | sed -e "s@VCLOUD_PROVIDER_START@!--@g" > repository/conf/cloud-controller.xml
+
+cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
+cat repository/conf/cloud-controller.xml.orig | sed -e "s@VCLOUD_PROVIDER_END@--@g" > repository/conf/cloud-controller.xml
+
+popd
+
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/0155eca7/tools/stratos-installer/stratos-openstack.sh
----------------------------------------------------------------------
diff --git a/tools/stratos-installer/stratos-openstack.sh b/tools/stratos-installer/stratos-openstack.sh
new file mode 100755
index 0000000..fe9c97f
--- /dev/null
+++ b/tools/stratos-installer/stratos-openstack.sh
@@ -0,0 +1,69 @@
+#!/bin/bash
+# ----------------------------------------------------------------------------
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# ----------------------------------------------------------------------------
+#
+# This script is invoked by setup.sh for configuring OpenStack IaaS information.
+# ----------------------------------------------------------------------------
+
+# Die on any error:
+set -e
+
+SLEEP=60
+export LOG=$log_path/stratos-openstack.log
+
+source "./conf/stratos-setup.conf"
+
+if [[ ! -d $log_path ]]; then
+ mkdir -p $log_path
+fi
+
+pushd $cc_path
+
+echo "Set OpenStack provider specific info in repository/conf/cloud-controller.xml" >> $LOG
+
+cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
+cat repository/conf/cloud-controller.xml.orig | sed -e "s@OPENSTACK_PROVIDER_START@@g" > repository/conf/cloud-controller.xml
+
+cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
+cat repository/conf/cloud-controller.xml.orig | sed -e "s@OPENSTACK_IDENTITY@$openstack_identity@g" > repository/conf/cloud-controller.xml
+
+cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
+cat repository/conf/cloud-controller.xml.orig | sed -e "s@OPENSTACK_CREDENTIAL@$openstack_credential@g" > repository/conf/cloud-controller.xml
+
+cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
+cat repository/conf/cloud-controller.xml.orig | sed -e "s@OPENSTACK_ENDPOINT@$openstack_jclouds_endpoint@g" > repository/conf/cloud-controller.xml
+
+cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
+cat repository/conf/cloud-controller.xml.orig | sed -e "s@OPENSTACK_PROVIDER_END@@g" > repository/conf/cloud-controller.xml
+
+cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
+cat repository/conf/cloud-controller.xml.orig | sed -e "s@EC2_PROVIDER_START@!--@g" > repository/conf/cloud-controller.xml
+
+cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
+cat repository/conf/cloud-controller.xml.orig | sed -e "s@EC2_PROVIDER_END@--@g" > repository/conf/cloud-controller.xml
+
+cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
+cat repository/conf/cloud-controller.xml.orig | sed -e "s@VCLOUD_PROVIDER_START@!--@g" > repository/conf/cloud-controller.xml
+
+cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
+cat repository/conf/cloud-controller.xml.orig | sed -e "s@VCLOUD_PROVIDER_END@--@g" > repository/conf/cloud-controller.xml
+
+popd
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/0155eca7/tools/stratos-installer/stratos-setup.sh
----------------------------------------------------------------------
diff --git a/tools/stratos-installer/stratos-setup.sh b/tools/stratos-installer/stratos-setup.sh
new file mode 100755
index 0000000..11e9d4d
--- /dev/null
+++ b/tools/stratos-installer/stratos-setup.sh
@@ -0,0 +1,651 @@
+#!/bin/bash
+# ----------------------------------------------------------------------------
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# ----------------------------------------------------------------------------
+#
+# Server configuration script for Apache Stratos
+# ----------------------------------------------------------------------------
+
+# Die on any error:
+set -e
+
+SLEEP=60
+
+source "./conf/stratos-setup.conf"
+export LOG=$log_path/stratos-setup.log
+
+mb="false"
+cc="false"
+as="false"
+sm="false"
+cep="false"
+product_list="mb;cc;cep;as;sm"
+enable_internal_git=false
+activemq_client_libs=(activemq-broker-5.8.0.jar activemq-client-5.8.0.jar geronimo-j2ee-management_1.1_spec-1.0.1.jar geronimo-jms_1.1_spec-1.1.1.jar hawtbuf-1.2.jar)
+
+function help {
+ echo ""
+ echo "Usage:"
+ echo "stratos-setup.sh -u <host username> -p \"all\""
+ echo "Example:"
+ echo "sudo ./setup.sh -p \"all\""
+ echo ""
+ echo "-u: <host username> The login user of the host."
+ echo ""
+}
+
+while getopts u:p:g: opts
+do
+ case $opts in
+ p)
+ product_list=${OPTARG}
+ ;;
+ g)
+ enable_internal_git=${OPTARG}
+ ;;
+ \?)
+ help
+ exit 1
+ ;;
+ esac
+done
+
+
+arr=$(echo $product_list | tr " " "\n")
+
+for x in $arr
+do
+ if [[ $x = "mb" ]]; then
+ mb="true"
+ fi
+ if [[ $x = "cc" ]]; then
+ cc="true"
+ fi
+ if [[ $x = "cep" ]]; then
+ cep="true"
+ fi
+ if [[ $x = "as" ]]; then
+ as="true"
+ fi
+ if [[ $x = "sm" ]]; then
+ sm="true"
+ fi
+ if [[ $x = "all" ]]; then
+ mb="true"
+ cep="true"
+ cc="true"
+ as="true"
+ sm="true"
+ fi
+done
+
+product_list=`echo $product_list | sed 's/^ *//g' | sed 's/ *$//g'`
+if [[ -z $product_list || $product_list = "" ]]; then
+ help
+ exit 1
+fi
+
+if [[ $host_user == "" ]]; then
+ echo "user provided in conf/stratos-setup.conf is null. Please provide a user"
+ exit 1
+fi
+
+echo "user provided in conf/stratos-setup.conf is $host_user. If you want to provide some other user name please specify it at the prompt."
+echo "If you want to continue with $host_user just press enter to continue"
+read username
+if [[ $username != "" ]]; then
+ host_user=$username
+fi
+user=`id $host_user`
+if [[ $? = 1 ]]; then
+ echo "User $host_user does not exist. The system will create it."
+ adduser --home /home/$host_user $host_user
+fi
+
+export $host_user
+
+# Check validity of IP
+function valid_ip()
+{
+ local ip=$1
+ local stat=1
+
+ if [[ $ip =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
+ OIFS=$IFS
+ IFS='.'
+ ip=($ip)
+ IFS=$OIFS
+ [[ ${ip[0]} -le 255 && ${ip[1]} -le 255 \
+ && ${ip[2]} -le 255 && ${ip[3]} -le 255 ]]
+ stat=$?
+ fi
+ return $stat
+}
+
+function helpsetup {
+ echo ""
+ echo "Please set up the $1 related environment variables correctly in conf/stratos-setup.conf"
+ echo ""
+}
+
+function general_conf_validate {
+ if [[ ! -d $setup_path ]]; then
+ echo "Please specify the setup_path folder which contains stratos setup"
+ exit 1
+ fi
+ if [[ ! -d $stratos_path ]]; then
+ echo "Please specify the stratos_path folder which stratos will be installed"
+ exit 1
+ fi
+ if [[ ! -d $stratos_pack_path ]]; then
+ echo "Please specify the stratos_pack_path folder which contains stratos packs."
+ exit 1
+ fi
+ if [[ ! -f $stratos_pack ]]; then
+ echo "Stratos_pack cannot be found at $stratos_pack"
+ exit 1
+ fi
+ if [[ ! -d $JAVA_HOME ]]; then
+ echo "Please set the JAVA_HOME environment variable for the running user"
+ exit 1
+ fi
+ export JAVA_HOME=$JAVA_HOME
+
+ if [[ -z $stratos_domain ]]; then
+ echo "Please specify the stratos domain"
+ exit 1
+ fi
+ if [[ (-z $mb_port_offset || -z $mb_ip || -z $mb_hostname) ]]; then
+ echo "Please specify the ip, the port offset and the hostname of MB"
+ exit 1
+ fi
+ if !(valid_ip $mb_ip); then
+ echo "Please provide valid ip for MB's ip"
+ exit 1
+ fi
+}
+
+function activemq_client_jar_validate {
+ if [[ ($cep = "true" || $cc = "true" || $as = "true" || $sm = "true") ]]; then
+ for activemq_client_lib in "${activemq_client_libs[@]}"
+ do
+ lib_path=$stratos_pack_path/$activemq_client_lib
+ if [[ ! -f $lib_path ]]; then
+ echo "Please copy the following activemq client jar into the $stratos_pack_path:"
+ echo $activemq_client_lib
+ exit 1
+ fi
+ done
+
+ fi
+}
+
+function mb_conf_validate {
+ if [[ -z $mb_path ]]; then
+ helpsetup MB
+ exit 1
+ fi
+}
+
+function cep_conf_validate {
+ if [[ (-z $cep_path || -z $cep_port_offset) ]]; then
+ helpsetup CEP
+ exit 1
+ fi
+ if [[ ! -d $cep_artifacts_path ]]; then
+ echo "Please specify the cep_artifacts_path folder which contains cep artifacts files"
+ exit 1
+ fi
+ if [[ ! -f $cep_extension_jar ]]; then
+ echo "Please copy the cep extension jar into the same folder as this command(stratos release pack folder) and update conf/stratos-setup.conf file"
+ exit 1
+ fi
+}
+
+function cc_conf_validate {
+ if [[ (-z $cc_path || -z $cc_port_offset) ]]; then
+ helpsetup CC
+ exit 1
+ fi
+
+ if [[ $ec2_provider_enabled = "false" && $openstack_provider_enabled = "false" && $vcloud_provider_enabled = "false" ]]; then
+ echo "Please enable at least one of the IaaS providers in conf/stratos-setup.conf file"
+ exit 1
+ fi
+
+ if [[ $openstack_provider_enabled = "true" ]]; then
+ if [[ ( -z $openstack_identity || -z $openstack_credential || -z $openstack_jclouds_endpoint ) ]]; then
+ echo "Please set openstack configuration information in conf/stratos-setup.conf file"
+ exit 1
+ fi
+ fi
+
+ if [[ $ec2_provider_enabled = "true" ]]; then
+ if [[ ( -z $ec2_identity || -z $ec2_credential || -z $ec2_keypair_name ) ]]; then
+ echo "Please set ec2 configuration information in conf/stratos-setup.conf file"
+ exit 1
+ fi
+ fi
+
+ if [[ $vcloud_provider_enabled = "true" ]]; then
+ if [[ ( -z $vcloud_identity || -z $vcloud_credential || -z $vcloud_jclouds_endpoint ) ]]; then
+ echo "Please set vcloud configuration information in conf/stratos-setup.conf file"
+ exit 1
+ fi
+ fi
+}
+
+function as_conf_validate {
+ if [[ (-z $as_path || -z $as_port_offset) ]]; then
+ helpsetup AS
+ exit 1
+ fi
+ if [[ -z $cc_port_offset || -z $sm_port_offset ]]; then
+ echo "Please specify the port offset of SM and/or CC"
+ exit 1
+ fi
+ if [[ -z $sm_ip || -z $cc_ip ]]; then
+ echo "Please specify the ips of SM and/or CC"
+ exit 1
+ elif !(valid_ip $sm_ip && valid_ip $cc_ip ); then
+ echo "Please provide valid ips for SM and/or CC"
+ exit 1
+ fi
+ if [[ -z $cc_hostname || -z $sm_hostname ]]; then
+ echo "Please specify valid hostname for SM and/or CC"
+ exit 1
+ fi
+}
+
+function sm_conf_validate {
+ if [[ (-z $sm_path || -z $sm_port_offset) ]]; then
+ helpsetup SM
+ exit 1
+ fi
+ if [[ ! -f $mysql_connector_jar ]]; then
+ echo "Please copy the mysql connector jar to the stratos release pack folder and update the JAR name in conf/stratos-setup.conf file"
+ exit 1
+ fi
+ if [[ -z $cc_port_offset || -z $as_port_offset ]]; then
+ echo "Please specify the port offset of AS and/or CC"
+ exit 1
+ fi
+ if [[ -z $sm_ip || -z $as_ip || -z $cc_ip ]]; then
+ echo "Please specify the ips of SM and/or AS and/or CC"
+ exit 1
+ elif !(valid_ip $sm_ip && valid_ip $cc_ip && valid_ip $as_ip); then
+ echo "Please provide valid ips for SM and/or AS and/or CC"
+ exit 1
+ fi
+ if [[ -z $puppet_ip ]]; then
+ echo "Please specify the ip of puppet master"
+ exit 1
+ elif !(valid_ip $puppet_ip); then
+ echo "Please provide valid ip for puppet master"
+ exit 1
+ fi
+ if [[ -z $puppet_hostname ]]; then
+ echo "Please specify the puppet master's hostname"
+ exit 1
+ fi
+ if [[ -z $puppet_environment ]]; then
+ echo "Please specify the relevant puppet environment"
+ exit 1
+ fi
+ if [[ -z $cc_hostname || -z $as_hostname ]]; then
+ echo "Please specify valid hostname for AS and/or CC"
+ exit 1
+ fi
+}
+
+
+general_conf_validate
+activemq_client_jar_validate
+if [[ $mb = "true" ]]; then
+ mb_conf_validate
+fi
+if [[ $cep = "true" ]]; then
+ cep_conf_validate
+fi
+if [[ $cc = "true" ]]; then
+ cc_conf_validate
+fi
+if [[ $as = "true" ]]; then
+ as_conf_validate
+fi
+if [[ $sm = "true" ]]; then
+ sm_conf_validate
+fi
+
+
+# Make sure the user is running as root.
+if [ "$UID" -ne "0" ]; then
+ echo ; echo " You must be root to run $0. (Try running 'sudo bash' first.)" ; echo
+ exit 69
+fi
+
+if [[ ! -d $log_path ]]; then
+ mkdir -p $log_path
+fi
+
+
+echo ""
+echo "For all the questions asked while during executing the script please just press the enter button"
+echo ""
+
+if [[ $mb = "true" ]]; then
+ if [[ ! -d $mb_path ]]; then
+ echo "Extracting $mb_pack_path"
+ tar -zxvf $mb_pack_path -C $stratos_path
+ fi
+fi
+
+if [[ ! -d $resource_path ]]; then
+ cp -rf ./resources $stratos_path
+fi
+
+if [[ ! -d $stratos_pack ]]; then
+ echo "Extracting $stratos_pack"
+ unzip -q $stratos_pack -d $stratos_path
+fi
+
+
+
+# ------------------------------------------------
+# Setup MB
+# ------------------------------------------------
+function mb_setup {
+ echo "Setup ActiveMQ" >> $LOG
+ echo "Configuring the Message Broker"
+
+ pushd $mb_path
+
+ echo "End configuring the Message Broker"
+ popd #mb_path
+}
+
+if [[ $mb = "true" ]]; then
+ mb_setup
+fi
+
+function general_setup {
+ echo "Setup Stratos" >> $LOG
+ echo "Configuring Stratos ..."
+
+ cp -f ./config/cep/repository/conf/activemq/jndi.properties $stratos_dist_path/repository/conf/
+ for activemq_client_lib in "${activemq_client_libs[@]}"
+ do
+ cp -f $stratos_pack_path/$activemq_client_lib $stratos_dist_path/repository/components/lib/
+ done
+
+ pushd $stratos_dist_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>${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:$cep_mb_listen_port@g" > repository/conf/jndi.properties
+
+ popd
+}
+
+general_setup
+
+# ------------------------------------------------
+# Setup CEP
+# ------------------------------------------------
+function cep_setup {
+ echo "Setup CEP" >> $LOG
+ echo "Configuring the Complex Event Processor"
+
+ cp -f $cep_extension_jar $cep_path/repository/components/lib/
+ cp -f $cep_artifacts_path/eventbuilders/*.xml $cep_path/repository/deployment/server/eventbuilders/
+ cp -f $cep_artifacts_path/inputeventadaptors/*.xml $cep_path/repository/deployment/server/inputeventadaptors/
+ cp -f $cep_artifacts_path/outputeventadaptors/*.xml $cep_path/repository/deployment/server/outputeventadaptors/
+ cp -f $cep_artifacts_path/executionplans/*.xml $cep_path/repository/deployment/server/executionplans/
+ cp -f $cep_artifacts_path/eventformatters/*.xml $cep_path/repository/deployment/server/eventformatters/
+ cp -f $cep_artifacts_path/streamdefinitions/*.xml $cep_path/repository/conf/
+
+ pushd $cep_path
+
+ echo "In outputeventadaptors"
+ cp -f repository/deployment/server/outputeventadaptors/JMSOutputAdaptor.xml repository/deployment/server/outputeventadaptors/JMSOutputAdaptor.xml.orig
+ cat repository/deployment/server/outputeventadaptors/JMSOutputAdaptor.xml.orig | sed -e "s@CEP_HOME@$cep_path@g" > repository/deployment/server/outputeventadaptors/JMSOutputAdaptor.xml
+
+ 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
+}
+if [[ $cep = "true" ]]; then
+ cep_setup
+fi
+
+
+# ------------------------------------------------
+# Setup CC
+# ------------------------------------------------
+function cc_setup {
+ echo "Setup CC" >> $LOG
+ echo "Configuring the Cloud Controller"
+
+ echo "Creating payload directory ... " >> $LOG
+ if [[ ! -d $cc_path/repository/resources/payload ]]; then
+ mkdir -p $cc_path/repository/resources/payload
+ fi
+
+ cp -f ./config/cc/repository/conf/cloud-controller.xml $cc_path/repository/conf/
+
+ echo "In repository/conf/cloud-controller.xml"
+ if [[ $ec2_provider_enabled = true ]]; then
+ ./stratos-ec2.sh
+ fi
+ if [[ $openstack_provider_enabled = true ]]; then
+ ./stratos-openstack.sh
+ fi
+ if [[ $vcloud_provider_enabled = true ]]; then
+ ./stratos-vcloud.sh
+ fi
+
+ pushd $cc_path
+
+ cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
+ cat repository/conf/cloud-controller.xml.orig | sed -e "s@MB_HOSTNAME:MB_LISTEN_PORT@$mb_hostname:$cc_mb_listen_port@g" > repository/conf/cloud-controller.xml
+
+ popd #cc_path
+ echo "End configuring the Cloud Controller"
+}
+
+if [[ $cc = "true" ]]; then
+ cc_setup
+fi
+
+# ------------------------------------------------
+# Setup AS
+# ------------------------------------------------
+function as_setup {
+ echo "Setup AS" >> $LOG
+ echo "Configuring the Auto Scalar"
+
+ cp -f ./config/as/repository/conf/autoscaler.xml $as_path/repository/conf/
+
+ pushd $as_path
+
+ echo "In repository/conf/autoscaler.xml"
+ cp -f repository/conf/autoscaler.xml repository/conf/autoscaler.xml.orig
+ cat repository/conf/autoscaler.xml.orig | sed -e "s@CC_HOSTNAME@$cc_hostname@g" > repository/conf/autoscaler.xml
+
+ cp -f repository/conf/autoscaler.xml repository/conf/autoscaler.xml.orig
+ cat repository/conf/autoscaler.xml.orig | sed -e "s@CC_LISTEN_PORT@$as_cc_https_port@g" > repository/conf/autoscaler.xml
+
+ cp -f repository/conf/autoscaler.xml repository/conf/autoscaler.xml.orig
+ cat repository/conf/autoscaler.xml.orig | sed -e "s@SM_HOSTNAME@$sm_hostname@g" > repository/conf/autoscaler.xml
+
+ cp -f repository/conf/autoscaler.xml repository/conf/autoscaler.xml.orig
+ cat repository/conf/autoscaler.xml.orig | sed -e "s@SM_LISTEN_PORT@$as_sm_https_port@g" > repository/conf/autoscaler.xml
+
+ popd #as_path
+ echo "End configuring the Auto smalar"
+}
+
+if [[ $as = "true" ]]; then
+ as_setup
+fi
+
+
+
+# ------------------------------------------------
+# Setup SM
+# ------------------------------------------------
+function sm_setup {
+ echo "Setup SM" >> $LOG
+ echo "Configuring Stratos Manager"
+
+ cp -f ./config/sm/repository/conf/cartridge-config.properties $sm_path/repository/conf/
+ cp -f ./config/sm/repository/conf/datasources/master-datasources.xml $sm_path/repository/conf/datasources/
+ cp -f $mysql_connector_jar $sm_path/repository/components/lib/
+
+ pushd $sm_path
+
+ echo "In repository/conf/cartridge-config.properties" >> $LOG
+ cp -f repository/conf/cartridge-config.properties repository/conf/cartridge-config.properties.orig
+ cat repository/conf/cartridge-config.properties.orig | sed -e "s@CC_HOSTNAME:CC_HTTPS_PORT@$cc_hostname:$sm_cc_https_port@g" > repository/conf/cartridge-config.properties
+
+ cp -f repository/conf/cartridge-config.properties repository/conf/cartridge-config.properties.orig
+ cat repository/conf/cartridge-config.properties.orig | sed -e "s@AS_HOSTNAME:AS_HTTPS_PORT@$as_hostname:$sm_as_https_port@g" > repository/conf/cartridge-config.properties
+
+ cp -f repository/conf/cartridge-config.properties repository/conf/cartridge-config.properties.orig
+ cat repository/conf/cartridge-config.properties.orig | sed -e "s@PUPPET_IP@$sm_puppet_ip@g" > repository/conf/cartridge-config.properties
+
+ cp -f repository/conf/cartridge-config.properties repository/conf/cartridge-config.properties.orig
+ cat repository/conf/cartridge-config.properties.orig | sed -e "s@PUPPET_HOSTNAME@$sm_puppet_hostname@g" > repository/conf/cartridge-config.properties
+
+ cp -f repository/conf/cartridge-config.properties repository/conf/cartridge-config.properties.orig
+ cat repository/conf/cartridge-config.properties.orig | sed -e "s@PUPPET_ENV@$sm_puppet_environment@g" > repository/conf/cartridge-config.properties
+
+ echo "In repository/conf/datasources/master-datasources.xml" >> $LOG
+ cp -f repository/conf/datasources/master-datasources.xml repository/conf/datasources/master-datasources.xml.orig
+ cat repository/conf/datasources/master-datasources.xml.orig | sed -e "s@USERSTORE_DB_HOSTNAME@$userstore_db_hostname@g" > repository/conf/datasources/master-datasources.xml
+
+ cp -f repository/conf/datasources/master-datasources.xml repository/conf/datasources/master-datasources.xml.orig
+ cat repository/conf/datasources/master-datasources.xml.orig | sed -e "s@USERSTORE_DB_PORT@$userstore_db_port@g" > repository/conf/datasources/master-datasources.xml
+
+ cp -f repository/conf/datasources/master-datasources.xml repository/conf/datasources/master-datasources.xml.orig
+ cat repository/conf/datasources/master-datasources.xml.orig | sed -e "s@USERSTORE_DB_SCHEMA@$userstore_db_schema@g" > repository/conf/datasources/master-datasources.xml
+
+ cp -f repository/conf/datasources/master-datasources.xml repository/conf/datasources/master-datasources.xml.orig
+ cat repository/conf/datasources/master-datasources.xml.orig | sed -e "s@USERSTORE_DB_USER@$userstore_db_user@g" > repository/conf/datasources/master-datasources.xml
+
+ cp -f repository/conf/datasources/master-datasources.xml repository/conf/datasources/master-datasources.xml.orig
+ cat repository/conf/datasources/master-datasources.xml.orig | sed -e "s@USERSTORE_DB_PASS@$userstore_db_pass@g" > repository/conf/datasources/master-datasources.xml
+
+ popd # sm_path
+
+
+ # Database Configuration
+ # -----------------------------------------------
+ echo "Create and configure MySql Databases" >> $LOG
+
+ echo "Creating userstore database"
+
+ pushd $resource_path
+ cp -f mysql.sql mysql.sql.orig
+ cat mysql.sql.orig | sed -e "s@USERSTORE_DB_SCHEMA@$userstore_db_schema@g" > mysql.sql
+
+ popd # resource_path
+
+ mysql -u$userstore_db_user -p$userstore_db_pass < $resource_path/mysql.sql
+
+ #Copy https://svn.wso2.org/repos/wso2/scratch/hosting/build/tropos/resources/append_zone_file.sh into /opt/scripts folder
+ if [[ ! -d $stratos_path/scripts ]]; then
+ mkdir -p $stratos_path/scripts
+ fi
+ cp -f ./scripts/add_entry_zone_file.sh $stratos_path/scripts/add_entry_zone_file.sh
+ cp -f ./scripts/remove_entry_zone_file.sh $stratos_path/scripts/remove_entry_zone_file.sh
+
+
+ echo "End configuring the SM"
+}
+
+if [[ $sm = "true" ]]; then
+ sm_setup
+fi
+
+
+# ------------------------------------------------
+# Mapping domain/host names
+# ------------------------------------------------
+
+cp -f /etc/hosts hosts.tmp
+
+
+echo "$mb_ip $mb_hostname # message broker hostname" >> hosts.tmp
+
+if [[ $sm = "true" || $as = "true" ]]; then
+ echo "$sm_ip $sm_hostname # stratos domain" >> hosts.tmp
+ echo "$cc_ip $cc_hostname # cloud controller hostname" >> hosts.tmp
+fi
+
+if [[ $sm = "true" ]]; then
+ echo "$as_ip $as_hostname # auto scalar hostname" >> hosts.tmp
+fi
+
+mv -f ./hosts.tmp /etc/hosts
+
+
+# ------------------------------------------------
+# Starting the servers
+# ------------------------------------------------
+echo 'Changing owner of '$stratos_path' to '$host_user:$host_user
+chown $host_user:$host_user $stratos_path -R
+
+echo "Apache Stratos setup has successfully completed"
+
+read -p "Do you want to start the servers [y/n]? " answer
+if [[ $answer != y ]] ; then
+ exit 1
+fi
+
+echo "Starting the servers" >> $LOG
+
+echo "Starting up servers. This may take time. Look at $LOG file for server startup details"
+
+chown -R $host_user.$host_user $log_path
+chmod -R 777 $log_path
+
+export setup_dir=$PWD
+su - $host_user -c "source $setup_dir/conf/stratos-setup.conf;$setup_dir/stratos-start-servers.sh -p\"$product_list\" >> $LOG"
+
+echo "Servers started. Please look at $LOG file for server startup details"
+if [[ $sm == "true" ]]; then
+ echo "**************************************************************"
+ echo "Management Console : https://$stratos_domain:$sm_https_port/console"
+ echo "**************************************************************"
+fi
+
+
+
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/0155eca7/tools/stratos-installer/stratos-start-servers.sh
----------------------------------------------------------------------
diff --git a/tools/stratos-installer/stratos-start-servers.sh b/tools/stratos-installer/stratos-start-servers.sh
new file mode 100755
index 0000000..b690063
--- /dev/null
+++ b/tools/stratos-installer/stratos-start-servers.sh
@@ -0,0 +1,119 @@
+#!/bin/bash
+# ----------------------------------------------------------------------------
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# ----------------------------------------------------------------------------
+#
+# This script is for starting Apache Stratos servers.
+# ----------------------------------------------------------------------------
+
+# Die on any error:
+set -e
+product_list=$1
+export LOG=$log_path/stratos.log
+SLEEP=40
+
+if [[ -f ./conf/stratos-setup.conf ]]; then
+ source "./conf/stratos-setup.conf"
+fi
+
+function help {
+ echo ""
+ echo "Give one or more of the servers to start on this machine. The available servers are"
+ echo "mb, cc, as, sm, cep, all. 'all' means you need to start all servers."
+ echo "usage:"
+ echo "stratos-start-servers.sh -p\"<product list>\""
+ echo "eg."
+ echo "stratos-start-servers.sh -p\"cc sm\""
+ echo ""
+}
+
+while getopts p: opts
+do
+ case $opts in
+ p)
+ product_list=${OPTARG}
+ echo $product_list
+ ;;
+ *)
+ help
+ exit 1
+ ;;
+ esac
+done
+arr=$(echo $product_list | tr ";" "\n")
+
+for x in $arr
+do
+ if [[ $x = "mb" ]]; then
+ mb="true"
+ fi
+ if [[ $x = "cep" ]]; then
+ cep="true"
+ fi
+ if [[ $x = "cc" ]]; then
+ cc="true"
+ fi
+ if [[ $x = "as" ]]; then
+ as="true"
+ fi
+ if [[ $x = "sm" ]]; then
+ sm="true"
+ fi
+ if [[ $x = "all" ]]; then
+ mb="true"
+ cc="true"
+ as="true"
+ sm="true"
+ cep="true"
+ fi
+done
+product_list=`echo $product_list | sed 's/^ *//g' | sed 's/ *$//g'`
+if [[ -z $product_list || $product_list = "" ]]; then
+ help
+ exit 1
+fi
+
+if [[ $mb = "true" ]]; then
+ echo ${mb_path}
+
+ echo "Starting ActiveMQ server ..." >> $LOG
+ bits=$(uname -m)
+ if [[ $bits =~ 64 ]]; then
+ ${mb_path}/bin/linux-x86-64/activemq start
+ elif [[ $bits =~ 32 ]]; then
+ ${mb_path}/bin/linux-x86-32/activemq start
+ else
+ ${mb_path}/bin/activemq start
+ fi
+
+ echo "ActiveMQ server started" >> $LOG
+ sleep $SLEEP
+ sleep $SLEEP
+fi
+
+echo ${stratos_dist_path}
+
+ echo "Starting Stratos server ..." >> $LOG
+ ${stratos_dist_path}/bin/stratos.sh start
+ echo "Stratos server started" >> $LOG
+ sleep $SLEEP
+ sleep $SLEEP
+
+
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/0155eca7/tools/stratos-installer/stratos-vcloud.sh
----------------------------------------------------------------------
diff --git a/tools/stratos-installer/stratos-vcloud.sh b/tools/stratos-installer/stratos-vcloud.sh
new file mode 100755
index 0000000..51bee05
--- /dev/null
+++ b/tools/stratos-installer/stratos-vcloud.sh
@@ -0,0 +1,69 @@
+#!/bin/bash
+# ----------------------------------------------------------------------------
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# ----------------------------------------------------------------------------
+#
+# This script is invoked by setup.sh for configuring OpenStack IaaS information.
+# ----------------------------------------------------------------------------
+
+# Die on any error:
+set -e
+
+SLEEP=60
+export LOG=$log_path/stratos-vcloud.log
+
+source "./conf/stratos-setup.conf"
+
+if [[ ! -d $log_path ]]; then
+ mkdir -p $log_path
+fi
+
+pushd $cc_path
+
+echo "Set vCloud provider specific info in repository/conf/cloud-controller.xml" >> $LOG
+
+cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
+cat repository/conf/cloud-controller.xml.orig | sed -e "s@VCLOUD_PROVIDER_START@@g" > repository/conf/cloud-controller.xml
+
+cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
+cat repository/conf/cloud-controller.xml.orig | sed -e "s/VCLOUD_IDENTITY/$vcloud_identity/g" > repository/conf/cloud-controller.xml
+
+cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
+cat repository/conf/cloud-controller.xml.orig | sed -e "s/VCLOUD_CREDENTIAL/$vcloud_credential/g" > repository/conf/cloud-controller.xml
+
+cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
+cat repository/conf/cloud-controller.xml.orig | sed -e "s@VCLOUD_ENDPOINT@$vcloud_jclouds_endpoint@g" > repository/conf/cloud-controller.xml
+
+cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
+cat repository/conf/cloud-controller.xml.orig | sed -e "s@VCLOUD_PROVIDER_END@@g" > repository/conf/cloud-controller.xml
+
+cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
+cat repository/conf/cloud-controller.xml.orig | sed -e "s@EC2_PROVIDER_START@!--@g" > repository/conf/cloud-controller.xml
+
+cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
+cat repository/conf/cloud-controller.xml.orig | sed -e "s@EC2_PROVIDER_END@--@g" > repository/conf/cloud-controller.xml
+
+cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
+cat repository/conf/cloud-controller.xml.orig | sed -e "s@OPENSTACK_PROVIDER_START@!--@g" > repository/conf/cloud-controller.xml
+
+cp -f repository/conf/cloud-controller.xml repository/conf/cloud-controller.xml.orig
+cat repository/conf/cloud-controller.xml.orig | sed -e "s@OPENSTACK_PROVIDER_END@--@g" > repository/conf/cloud-controller.xml
+
+popd