This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
4.1.x Install Stratos with OpenStack in a Distributed SetupOpenStack is a free and open-source cloud computing software platform, which users primarily deploy as aninfrastructure as a service (IaaS) solution.
Follow the instructions below to install Stratos with OpenStack, in a distributed setup, which has multiple Javavirtual machines (JVMs), in a :production environment
Setup your OpenStack environment. For more information, see the documentation.OpenStackEnsure that all the following prerequisites have been met based on your environment and IaaS.
Software requirements
Application Purpose Version Minimum Requirements Download Links
Development/ TestingEnvironment
ProductionEnvironment
Oracle JavaS EDevelopment Kit (JDK)
Requiredby all theproducts:
To launch the product, as each productis a Java application.To buildthe productfrom the source distribut
(botionh JDK and ApacheMaven are required).
1.6.24 or later / 1.7.*
If you are using JDK 1.6, you might need to replace the Java Cryptography Extension (JCE) policy files in your JDK with the Java Cryptography Extension (JCE) Unlimited Strength
Jurisdiction Policyfiles. This will avoid "illegal key size" errors when you try to invoke a secured web service.Oracle and IBM JRE 1.7 are also supported.
http://java.sun.com/javase/downloads/index.jsp
I fyouwisht ogetsupportfor3 2bitsi nApacheStratos,downloadtheJava3 2bitsdistribution.
2.6.0 or later T h ecartridgebase imagewill varybased onthe setupthat you areusing. Forexample, Ifyou areu s i n gOpenStack,you need tohave anOpenStackb a s eimage.Whereas, ifyou areu s i n gDocker, youneed tohave aDockerbase image.
Facter Required as a prerequisite for cartridges.
2.0.0 or later X https://downloads.puppetlabs.com/facter/
AMQP Message Broker
Required for Stratos runtime. The message broker is used to communicate with CEP.
Required only when workingwith Kubernetes. As VirtualBox will be used as the provider for Vagrant
Virtual, Box needs to be installed prior to installing Vagrant.
1.7.2 or later X http://www.vagrantup.com/downloads.html
System requirements
System Requirements
Memory - 2GBDisk - 40GB hard disk spaceProcessor - 2.8GHz CPU
Environment Compatibility
Operating Systems - Linux (Ubuntu 12.04 64bit server or SUSE LinuxEnterprise 11 SP2)
Basic configurationsSet the environment variable as follows to avoid Maven OutOfMemoryError.export MAVEN_OPTS='-Xms2048m -Xmx4096m -XX:MaxPermSize=1024m'
Create an OpenStack cartridge base image.
The following sub-sections describe the steps involved in configuring a cartridge on the OpenStack IaaS:
Step 1 - Spawn an instance Step 2 - Configure the cartridgeStep 3 - Repackage the cartridge as a machine image
Step 1 - Spawn an instance
If you wish to get support for 32 bits in Apache Stratos, downloadthe Java 32 bits distribution.
Follow the instructions below to spawn a configured instance of Debian/Ubuntu based Linux 12.04.1 LTSdistributions on OpenStack:
Log in to the OpenStack management console.
Click on the menu in the left side and click .Access & Security Create Security Group
In the window, enter the configurations of the rules for the security group as required Add Ruleand click . For more information on the ports that should be defined, see .Add Default Ports
In the window, enter the configurations for the image as required and click Create an Image Creat.e Image
In the window, enter the configurations for the key pair as required and click Create Key Pair Creat. When the message is prompted, download the key pair and keep it saved in a e Key Pair
preferred location.
Protect your key pair by executing the following command in your terminal.By default, your PEM file will be unprotected. Use the following command to secure your PEM fileso that others will not have access to it:
Create a file named insidestratos_sendinfo.rb the directory. Copy the configurations/root/bin/from the file and save the stratos_sendinfo.rbfile.
Edit the script to set the TIMEZONE value to/root/bin/puppetinstall/puppetinstallmatch the timezone set on the Puppet Master.
Execute the file and provide the s , ,config.sh tratos service-name puppet master IPand when prompted as follows:puppet master hostname
This script will install and configure puppet agent, do you want to continue [y/N] yPlease provide stratos service-name: phpPlease provide puppet master IP: 192.168.1.1Please provide puppet master hostname [puppet.test.org]: puppet.test.org
Use the following command to set the timezone value. In this case we are setting thetimezone to Etc/UTC:
sed -i 's:^TIMEZONE=.*$:TIMEZONE=\"Etc/UTC\":g' /root/bin/puppetinstall/puppetinstall
stratos service-name - Enter one of the modules that are provided astemplates in Stratos. For more details on the available modules, see step 7(g) in Co
. If you enter ' ', a generic cartridge will be created.nfiguring Puppet Master defaultpuppet master IP - Enter the IP address of the machine on which PuppetMaster is configured.puppet master hostname - This should be identical to the output received whenrunning the command. For more details on executing the hostname hostname co
step 5(b) in .mmand, see Configuring Puppet Master
Domain puppet.test.orgRunning puppet installation with arguments: -n076227021438.default.php -dpuppet.test.org -s192.168.1.1
Step 3 - Repackage the cartridge as a machine image
Follow the instructions below to repackage the cartridge as a machine image on OpenStack:
Log in to the OpenStack management console.Navigate to on the menu on the left side. InstancesSelect the respective instance and click .Create Snapshot
Enter a name for the image and click .Create Snapshot
Navigate to on the menu on the left side and get the Image ID that will be used in the Images Sam JSON file. ple Cartridge Definition
After you have finished creating the cartridge, make a note of the image ID you created for thecartridge, as you will need this when you use Stratos Manager to add a cartridge.
Download the Stratos binary distribution ( and unzip it.apache-stratos-version.zip)
This can be done using any of the following methods:
Method 1 - from and unzip it. Download the Stratos binary distribution Apache Download MirrorsMethods 2 - to obtain the binary distribution and unzip it.Build the Stratos source
Checkout the source from Apache Stratos remote repository to a folder of your choice. git clone <localhttps://git-wip-us.apache.org/repos/asf/stratos.git-folder-name>
For example: git clone myLocahttps://git-wip-us.apache.org/repos/asf/stratos.gitlRepo Build Stratos using Maven.
Navigate to the directory, which is within the directory that you checkedstratos/out the source. cd <local-folder-name>/stratos/
For example: cd myLocalRepo/stratos/ Use Maven to build the source. mvn clean install
Obtain the Stratos binary distribution from the apache-stratos-version.zip <STRATO directoryS_SOURCE_HOME>/products/stratos/modules/distribution/target/
and unzip it.
Setup and start ActiveMQ.
Download and unzip .ActiveMQNavigate to the directory, which is in the unzipped ActiveMQ<ACTIVEMQ-HOME>/bin/distribution.Run the following command to start ActiveMQ.
./activemq start
Setup Puppet Master. is an open source configuration management utility. In Stratos, Puppet has been used as thePuppet
orchestration layer.
Follow the instructions below to configure Puppet Master for Apache Stratos on Debian/Ubuntu 12.04.1LTS based Linux distributions:
Get root access.sudo -iInstall Git. apt-get install gitObtain the Puppet Master installation script. This will create a folder named puppetinstall.git clone https://github.com/thilinapiy/puppetinstallNavigate to the folder using the following command: puppetinstallcd puppetinstallInstall Puppet Master (v3) as follows:
Execute the following command. When you execute this command, your system hostnamewill get modified.
-d Domain name of the environment. This will act as a prefix to all the serversof the domain.For example:
If a server is: server23.dc1.example.com, your domain should be as follows:dc1.example.com
-s IP address of the Puppet master server. This IP address will be added to the file./etc/hosts
For example: ./puppetinstall -m -d test.org If requested, press enter. If you have successfully installed Puppet Master, the followingmessage will appear: “ "Installation completed successfullyExecute the command. This will show that your system hostname has been hostnamemodified. For example:puppet.test.orgVerify your Puppet Master (v3) installation by running the following command in the puppet
folder:installps -ef | grep puppetThe output will be as follows:
Follow below instructions in order to install puppet master in ubuntu 14 instead of following step 1-5 wget https://apt.puppetlabs.com/puppetlabs-release-trusty.debsudo dpkg -i puppetlabs-release-trusty.deb sudo apt-get update sudo apt-get install puppetmasterSet the hostname "127.0.0.1 " to /etc/hostspuppet.test.orgsudo hostname to change the hostname in ubuntu 14puppet.test.orgadd *. in /etc/puppet/autosign.conftest.org add "server= " to /etc/puppet/puppet.confpuppet.test.org/etc/init.d/puppetmaster restart
Obtain the Apache Stratos Puppet scripts as follows:Navigate to the home folder (or a folder of your choice).cdObtain the Apache Stratos Puppet scripts. git clone https://github.com/apache/stratos.git
Navigate to the < directory. stratos>/tools/puppet3/cd stratos/tools/puppet3/Check the list of files.
The output should be as follows: auth.conf autosign.conf fileserver.conf manifests modules puppet.conf
Copy the Stratos Puppet scripts to the Puppet Master configurations directory as follows:Navigate to the folder.puppetcd /etc/puppet/ Check the list of files in the folder:puppetlsThe output will be as follows:auth.conf autosign.conf fileserver.conf manifests modules puppet.conf templatesCopy the content from the directory to /root/stratos/tools/puppet3/manifests/the directory. /etc/puppet/manifests/For example: cp -R /root/stratos/tools/puppet3/manifests/* manifests/
Copy the content from the directory to the /root/stratos/tools/puppet3/modules/ directory. /etc/puppet/modules/
For example: cp -R /root/stratos/tools/puppet3/modules/* modules/Check the list of files in the directory. /etc/puppet/manifests/
ls manifests/The output should be as follows:nodes.pp site.pp nodes Check the list of files in the directory/etc/puppet/manifests/nodes.
Check the list of files in the directory. /etc/puppet/modules/ ls modules/
The output should be as follows:agent java lb mysql nodejs php python_agent ruby tomcat wordpress
Change the and values in the file according to your$mb_url, $cep_port $cep_ip base.ppsetup. vi /etc/puppet/manifests/nodes/base.pp
#following directory is used to store binary packages $local_package_dir = '/mnt/packs' # Stratos message broker IP and port $mb_url = 'tcp://127.0.0.1:1883' $mb_type = 'activemq' # Stratos CEP IP and port $cep_ip = '10.4.128.10' $cep_port = '7611' # Stratos Cartridge Agent’s trust store password $truststore_password = 'wso2carbon'
Enter the domain names that the master should automatically sign.Navigate to the directory./etc/puppet/cd /etc/puppet/
Add the domain names in the file and save the file.autosign.confYou can view the contents of the file as follows:autosign.confcat autosign.conf Based on the example the output will be as follows:*.test.org
Download a Java distribution and define the Java distribution in the /etc/puppet/manifests/ directory.Create the folder in the directory. files /etc/puppet/modules/java/mkdir /etc/puppet/modules/java/filesDownload a Java distribution (e.g., ) and copy it to the jdk-7u51-linux-x64.tar.gz /etc
directory. /puppet/modules/java/files/
Update the the following two values in your /etc/puppet/manifests/nodes/base.pp file
based on your Java distribution. Where is the downloaded Java$java_distribution
distribution name and is the the name of the unzipped Java distribution. $java_name
For example: git clone https://git-wip-us.apache.org/repos/asf/stratos.gitmyLocalRepo Build using Maven
Go to the top level of the directory in which you checked out the source.
cd <local-folder-name>
For example: cd myLocalRepo Use Maven to build the source distribution of the release.
mvn clean install
Copy the Python Cartridge Agent distribution ( apache-stratos-python-cartridge- agent-), which is in the 4.1.x-SNAPSHOT.zip <STRATOS_HOME>/products/python-cartridge-
directory, to the directory.agent/ target/ /etc/puppet/modules/python_agent/files/
To get support for 32 bits, download the Java 32-bit distribution and change the $java_di parameter in the file accordingly.stribution nodes.pp
If Stratos has been built successfully, the deployable cartridge agent ZIP file named apach (e.g., e-stratos-python-cartridge-agent-<VERSION>-SNAPSHOT.zip apache-
) can be found in the stratos-python-cartridge-agent-4.1.x-SNAPSHOT.zip /p directory.roducts/python-cartridge-agent/target/
Copy the Apache Stratos Load Balancer distribution ( apache-stratos-load-balancer- 4.1.), which is in the x-SNAPSHOT.zip <source-home>/products/load-balancer/modules
directory, to the directory./distribution/target/ /etc/puppet/modules/lb/files/
Download any dependency on or any latest stable ActiveMQ TAR file from 5.9.1 https://activemq.. The folder path of this file will be referred to as . Coapache.org/download.html <ActiveMQ_HOME>
py the following ActiveMQ client JARSs from < directory to the ActiveMQ_HOME> /lib/ /etcdirectory. /puppet/modules/lb/files/activemq/
Install Apache Stratos products together with the third-party products used by Apache Stratos in a distributedsetup.
Follow the instructions below to install Apache Stratos products together with the third-party productsused by Apache Stratos in a distributed setup, which has multiple Java virtual machines (JVMs), usingthe Stratos installer ( ), which is available in the setup.sh <STRATOS_SOURCE_HOME>/tools
: directory/stratos-installer
Configure and start the Cloud Controller node.
Configure the common settings.
Follow the instructions below to configure the common settings:
Create the following folders at the same level in a location where you will runApache Stratos.
The zipped binary distribution files of the products that will be used by Apache Stratos
<MyFolder>/stratos_packs/
If you need to run the setup script again on the same node, it is recommended to first clean thesetup as to remove any unnecessary content before running the setup. Use the followingrootcommand to clean the setup:
Copy the contents of the <STRATOS_SOURCE_HOME>/tools/stratos- directory to the folder.installer/ <stratos_installer>
Download the file from apache-stratos-<version>.zip Apache Download, and copy it to directory.Mirrors <stratos_packs>
Download the (tar.gz file) and copy it into the ActiveMQ distribution <stratos- folder.pack>
Download the and copy the JAR file into the MySQL Java Connector <strato folder.s-pack>
Update the following configurations in the <stratos_installer>/conf file. /setup.conf
General configuration
setup_path : Enter the folder path of the <stratos_installer>folder that contains the Stratos installer.stratos_packs : Enter the folder path of the <stratos_packs>folder that contains the Stratos packages and other third-party packs and JARs.stratos_path : Enter the folder path of the folder <stratos>where Stratos will be installed.JAVA_HOME : Enter the path where the Java Development Kit (JDK) is installed.log_path : Enter the folder path to the Stratos logs.host_user : Enter the host user account for the machine that runs the Stratos component(s).stratos_domain: Enter the domain of Stratos. The default value is as follows: stratos.apache.org.host_ip : Enter the machine IP address of the host machine.offset : Enter the port offset of the machine.puppet_ip : Enter the IP address of the machine or node on which Puppet Master will be run.puppet_hostname : Enter the hostname that is given to identify the Puppet Master.puppet_environment : If you wish to use the same Puppet Master with multiple Stratos runtimes, enter the name of the Puppet environment; otherwise, enter a dummy value for this configuration.mb_ip : Enter the IP address of the machine or node on which Message Broker service runs.mb_port : Enter the default port on which the Message Broker service runs.
IaaS configuration
In configuring the Cloud Controller, you need to configure the relevantIaaS provider details. You can enable or disable the IaaS provider bysetting the parameter either to '<IAAS_NAME>_provider_enabled t
or ' .rue' false'
Database configuration
If you wish, you can to obtain this ZIP file. After buildingbuild the sourcethe source, navigate to the <STRATOS_SOURCE_HOME>/products
directory to obtain the /stratos/modules/distribution/target/ file.apache-stratos-<version>.zip
Update the value of the parameter withmysql_connector_jar the relevant JAR file name. The default JAR file name is mysql-connector-java-5.1.25.jar.Provide database configuration details for the userstore of theMySQL server such as userstore_db_hostname,userstore_db_schema, userstore_db_port,
accordingly.userstore_db_user and userstore_db_pass
Install Cloud Controller.
sudo ./setup.sh -p "cc"
For more information, see the .setup.sh usage definitionConfigure and start the Stratos Manager node.
Configure the common settings.
Follow the instructions below to configure the common settings:
Create the following folders at the same level in a location where you will runApache Stratos.
setup_path : Enter the folder path of the <stratos_installer>folder that contains the Stratos installer.stratos_packs : Enter the folder path of the <stratos_packs>folder that contains the Stratos packages and other third-party packs and JARs.stratos_path : Enter the folder path of the folder <stratos>where Stratos will be installed.JAVA_HOME : Enter the path where the Java Development Kit (JDK) is installed.log_path : Enter the folder path to the Stratos logs.host_user : Enter the host user account for the machine that runs the Stratos component(s).stratos_domain: Enter the domain of Stratos. The default value is as follows: stratos.apache.org.host_ip : Enter the machine IP address of the host machine.offset : Enter the port offset of the machine.puppet_ip : Enter the IP address of the machine or node on which Puppet Master will be run.puppet_hostname : Enter the hostname that is given to identify the Puppet Master.puppet_environment : If you wish to use the same Puppet Master with multiple Stratos runtimes, enter the name of the Puppet environment; otherwise, enter a dummy value for this configuration.mb_ip : Enter the IP address of the machine or node on which Message Broker service runs.mb_port : Enter the default port on which the Message Broker service runs.
IaaS configuration
In configuring the Cloud Controller, you need to configure the relevantIaaS provider details. You can enable or disable the IaaS provider bysetting the parameter either to '<IAAS_NAME>_provider_enabled t
or ' .rue' false'
Database configuration
Update the value of the parameter withmysql_connector_jar the relevant JAR file name. The default JAR file name is mysql-connector-java-5.1.25.jar.Provide database configuration details for the userstore of theMySQL server such as userstore_db_hostname,userstore_db_schema, userstore_db_port,
accordingly.userstore_db_user and userstore_db_pass
Install Stratos Manager.
sudo ./setup.sh -p "sm"
For more information, see the .setup.sh usage definitionConfigure and start the Autoscaler node.
Configure the common settings.
Follow the instructions below to configure the common settings:
For more information on the configurationsetup.shdefinitions, see . Configuring setup.conf
Copy the contents of the <STRATOS_SOURCE_HOME>/tools/stratos- directory to the folder.installer/ <stratos_installer>
Download the file from apache-stratos-<version>.zip Apache Download, and copy it to directory.Mirrors <stratos_packs>
Download the (tar.gz file) and copy it into the ActiveMQ distribution <stratos- folder.pack>
Download the and copy the JAR file into the MySQL Java Connector <strato folder.s-pack>
Update the following configurations in the <stratos_installer>/conf file. /setup.conf
General configuration
setup_path : Enter the folder path of the <stratos_installer>folder that contains the Stratos installer.stratos_packs : Enter the folder path of the <stratos_packs>folder that contains the Stratos packages and other third-party packs and JARs.stratos_path : Enter the folder path of the folder <stratos>where Stratos will be installed.JAVA_HOME : Enter the path where the Java Development Kit (JDK) is installed.log_path : Enter the folder path to the Stratos logs.host_user : Enter the host user account for the machine that runs the Stratos component(s).stratos_domain: Enter the domain of Stratos. The default value is as follows: stratos.apache.org.host_ip : Enter the machine IP address of the host machine.offset : Enter the port offset of the machine.puppet_ip : Enter the IP address of the machine or node on which Puppet Master will be run.puppet_hostname : Enter the hostname that is given to identify the Puppet Master.
If you wish, you can to obtain this ZIP file. After buildingbuild the sourcethe source, navigate to the <STRATOS_SOURCE_HOME>/products
directory to obtain the /stratos/modules/distribution/target/ file.apache-stratos-<version>.zip
puppet_environment : If you wish to use the same Puppet Master with multiple Stratos runtimes, enter the name of the Puppet environment; otherwise, enter a dummy value for this configuration.mb_ip : Enter the IP address of the machine or node on which Message Broker service runs.mb_port : Enter the default port on which the Message Broker service runs.
IaaS configuration
In configuring the Cloud Controller, you need to configure the relevantIaaS provider details. You can enable or disable the IaaS provider bysetting the parameter either to '<IAAS_NAME>_provider_enabled t
or ' .rue' false'
Database configuration
Update the value of the parameter withmysql_connector_jar the relevant JAR file name. The default JAR file name is mysql-connector-java-5.1.25.jar.Provide database configuration details for the userstore of theMySQL server such as userstore_db_hostname,userstore_db_schema, userstore_db_port,
accordingly.userstore_db_user and userstore_db_pass
Install Autoscaler.
sudo ./setup.sh -p "as"
For more information, see the .setup.sh usage definitionConfigure and start WSO2 CEP:
Configure WSO2 CEP.
Update the following configuration and artifact files in the Complex Event Processor(CEP):
Download .WSO2 Complex Event processor 3.0.0Update the port offset of the Complex Event Processor in the in the carbon.xmlfile, which is found in the directory as <CEP_HOME>/repository/conf/follows:
<offset>4</offset>The default offset value given to Complex Event Processor in Apache Stratos is 4. The resulting Complex Event Processor Thrift port is 7615.Copy the following file from the stream-manager-config.xml <STRATOS_SOU
directory RCE_HOME>/extensions/cep/artifacts/stream_definitionsto directory. Where <CEP_HOME>/repository/conf <STRATOS_SOURCE_HOM
refers to the Apache Stratos source repository.E>Replace the content in the file, which is in the jndi.properties <CEP_HOME>
directory, with the following configurations. Update the /repository/conf mess and values.age-broker-ip message-broker-port
# register some topics in JNDI using the form# topic.[jndiName]=[physicalName]topic.lb-stats=lb-statstopic.instance-stats=instance-statstopic.summarized-health-stats=summarized-health-statstopic.topology=topologytopic.ping=ping
Add the following content to the file, which is in the siddhi.extension <CEP_H directory.OME>/repository/conf/siddhi
Build the project in the <STRATOS_SOURCE_HOME>/extensions/cep directory. Thereafter, copy the /stratos-cep-extension org.apache.
file that can be found in the stratos.cep.extension-4.1.x.jar <STRATOS dire_SOURCE_HOME>/extensions/cep/stratos-cep-extension/target
ctory, to the directory.<CEP_HOME>/repository/components/lib/Download any dependency on 5.9.1 or any latest stable ActiveMQ TAR file from ht
. The folder path of this file will betps://activemq.apache.org/download.htmlreferred to as . Copy the following ActiveMQ client JARSs<ACTIVEMQ_HOME>from < directory to the ActiveMQ_HOME> /lib <CEP_HOME>/repository
Now, you have successfully started Stratos in a distributed setup on multiple Java Virtual Machines(JVMs). Once the installation is complete, access the Apache Stratos Console using the following URL:
https://<STRATOS-DOMAIN>:<PORT>/console
The default username and password is as follows: admin
setup.sh usage definition
The usage of the script has been described as follows:setup.sh
setup.sh -p "<PROFILE>" [-s] [-o <PORT_OFFSET>]
Short code
Description
-p Apache Stratos product profile to be installed on this node. Enter the name of the profilehere. The available profiles are as follows:
Profile Description
default All the products will be installed.
cc Cloud Controlled will be installed.
as Autoscaler will be installed.
sm Stratos Manager will be installed
-s Silent mode. The user will not be prompted to enter any details and the server will be started after installation. You should not run the installer in silent mode if you have not manually configured the < stratos_installer>/conf/setup.conf file.
-o Port offset. Enables you to specify a port offset for the server to be started.