4.1.x install stratos with openstack in a distributed setup

26
Copyright © 2015 The Apache Software Foundation, Licensed under the Apache License, Version 2.0 1 1. 2. 4.1.x Install Stratos with OpenStack in a Distributed Setup OpenStack is a free and open-source cloud computing software platform, which users primarily deploy as an infrastructure as a service (IaaS) solution. Follow the instructions below to install Stratos with OpenStack, in a distributed setup, which has multiple Java virtual machines (JVMs), in a : production environment Setup your OpenStack environment. For more information, see the documentation. OpenStack Ensure that all the following prerequisites have been met based on your environment and IaaS. Software requirements Application Purpose Version Minimum Requirements Download Links Development/ Testing Environment Production Environment Oracle Java S E Developmen t Kit (JDK) Required by all the products: To launch the product , as each product is a Java applicat ion. To build the product from the source distribut (bot ion h JDK and Apache Maven are require d). 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 Policy files. 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 If you wish to get sup port for 32 bits in Apa che Stra tos, dow nloa d the Jav a 32 bits distr ibuti on.

Upload: others

Post on 22-Apr-2022

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 4.1.x Install Stratos with OpenStack in a Distributed Setup

Copyright © 2015 The Apache Software Foundation, Licensed under the Apache License, Version 2.0 1

1. 2.

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.

Page 2: 4.1.x Install Stratos with OpenStack in a Distributed Setup

Copyright © 2015 The Apache Software Foundation, Licensed under the Apache License, Version 2.0 2

2.

MySQLServer

Required to manage database connections.

5.5.0 or later X http://dev.mysql.com/downloads/

MySQLConnectorfor Java

Requireda s astandardizeddatabasedriver forJ a v aplatformsa n ddevelopment.

1.7.0 or later X http://dev.mysql.com/downloads/connector/

 Git Client Required to check out the source from the Git repository.

2.2.1 or later http://git-scm.com/downloads/

ApacheMaven

Required to build the product from the source distribution.

3.1.1 or later http://maven.apache.org

Ruby Required as a prerequisite for cartridges.

2.1.0 or later X https://www.ruby-lang.org/en/downloads/

Zip Utility Requiredt ocompressand unzipt h epackages.

NOTE:This is notrequiredw h e nusing themanualapproacht oconfigureand startStratos.

Any X Choose a zip utility that is compatible with the OS.

Page 3: 4.1.x Install Stratos with OpenStack in a Distributed Setup

Copyright © 2015 The Apache Software Foundation, Licensed under the Apache License, Version 2.0 3

2.

Cartridge Base Image

Required as a prerequisite for cartridges.

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.

ActiveMQ 5.10.0 https://activemq.apache.org/download.html

Page 4: 4.1.x Install Stratos with OpenStack in a Distributed Setup

Copyright © 2015 The Apache Software Foundation, Licensed under the Apache License, Version 2.0 4

2.

CurrentlyActiveMQ5.10. 0i susedb ydefaul ti nthe ApacheStratosinstallation.However,ApacheStratosalsosupportsotherAMQPmessagebrokerssuchas, WSO 2MessageBrokerand RabbitMQ.

Page 5: 4.1.x Install Stratos with OpenStack in a Distributed Setup

Copyright © 2015 The Apache Software Foundation, Licensed under the Apache License, Version 2.0 5

2.

MQTT Message Broker

Required to communicate with the Cloud Controller and other Apache Stratos profiles.

Any https://activemq.apache.org/download.html

CurrentlyActiveMQ isusedb ydefaul ti nthe ApacheStratosinstallation.

Page 6: 4.1.x Install Stratos with OpenStack in a Distributed Setup

Copyright © 2015 The Apache Software Foundation, Licensed under the Apache License, Version 2.0 6

2.

WSO2 CEP Required to analyze & process events of a cartridge.

3.0.0 http://wso2.com/products/complex-event-processor

Oracle VM VirtualBox Manager

ReNOTE: quired only when working with Kubernetes.

4.3.20 or later X https://www.virtualbox.org/

Youd onotneed todownloadCEPwheninstallingStratosusingthe AutomatedStratosConfiguration sapproach.

Page 7: 4.1.x Install Stratos with OpenStack in a Distributed Setup

Copyright © 2015 The Apache Software Foundation, Licensed under the Apache License, Version 2.0 7

2.

3.

Vagrant NOTE:

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.

Page 8: 4.1.x Install Stratos with OpenStack in a Distributed Setup

Copyright © 2015 The Apache Software Foundation, Licensed under the Apache License, Version 2.0 8

3.

a.

b.

c.

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

Page 9: 4.1.x Install Stratos with OpenStack in a Distributed Setup

Copyright © 2015 The Apache Software Foundation, Licensed under the Apache License, Version 2.0 9

3.

d.

e.

f.

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: 

chmod 0600 <path to the private key>

Page 10: 4.1.x Install Stratos with OpenStack in a Distributed Setup

Copyright © 2015 The Apache Software Foundation, Licensed under the Apache License, Version 2.0 10

3.

g.

h.

i.

a.

In the   section of the   window, enter the configurations for the instance as Details Launch Instancerequired.

In the   section enter the configurations for the instance as required and click Access & Security Cr.eate

Select the created instance in the  window and click  .Instances Launch instance

Step 2 - Configure the cartridge

Follow the instructions to create a cartridge from an existing Debian/Ubuntu based Linux 12.04.1 LTSimage:

Page 11: 4.1.x Install Stratos with OpenStack in a Distributed Setup

Copyright © 2015 The Apache Software Foundation, Licensed under the Apache License, Version 2.0 11

3.

a. Once the instance is spawned, configure a cartridge image for Apache Stratos on Debian/Ubuntubased Linux 12.04.1 LTS distributions as follows:

sudo ­-iapt-get install zip unzipmkdir -p /root/bincd /root/binwget "https://git-wip-us.apache.org/repos/asf?p=stratos.git;a=blob_plain;f=tools/config-scripts/ec2/config.sh;hb=HEAD" -O config.shchmod +x config.shwget "https://git-wip-us.apache.org/repos/asf?p=stratos.git;a=blob_plain;f=tools/init-scripts/ec2/ubuntu/init.sh;hb=HEAD" -O init.shchmod +x init.shmkdir -p /root/bin/puppetinstallwget "https://git-wip-us.apache.org/repos/asf?p=stratos.git;a=blob_plain;f=tools/puppet3-agent/puppetinstall/puppetinstall;hb=HEAD" -O puppetinstall/puppetinstallchmod +x puppetinstall/puppetinstallwget "https://git-wip-us.apache.org/repos/asf?p=stratos.git;a=blob_plain;f=tools/puppet3-agent/stratos_sendinfo.rb;hb=HEAD" -O stratos_sendinfo.rb

Command Description

  sudo ­-i  Navigate into your Ubuntu image using SSH and get root access.

apt-get install zip unzip Install zip.

mkdir -p /root/bin Create a new folder named in the bin root/directory.

cd /root/bin Navigate to the bin/ directory.

wget "https://git-wip-us.apache.org/repos/asf?p=stratos.git;a=blob_plain;f=tools/puppet3-agent/config.sh;hb=HEAD" -O config.sh

Create a  file in the  directoryconfig.sh /root/bin/, copy the configurations from the file, config.shand save the file.

chmod +x config.sh Make the   file executable.config.sh

wget "https://git-wip-us.apache.org/repos/asf?p=stratos.git;a=blob_plain;f=tools/puppet3-agent/init.sh;hb=HEAD" -O init.sh

Create an  file in the  directory,init.sh /root/bin/copy the configurations from the file, and init.shsave the file.

chmod +x init.sh Make the file executable.init.sh

Navigate to the directory and create a /root/bin/

Page 12: 4.1.x Install Stratos with OpenStack in a Distributed Setup

Copyright © 2015 The Apache Software Foundation, Licensed under the Apache License, Version 2.0 12

3.

a.

b.

c.

mkdir -p /root/bin/puppetinstall

new directory named in the puppetinstall /root directory./bin/

wget "https://git-wip-us.apache.org/repos/asf?p=stratos.git;a=blob_plain;f=tools/puppet3-agent/puppetinstall/puppetinstall;hb=HEAD" -O puppetinstall/puppetinstall

Create a file named in the puppetinstall /root directory,  copy the/bin/puppetinstall/

configurations from the file, and puppet installsave the file.

chmod +x puppetinstall/puppetinstall

Make the file executable. puppetinstall

wget "https://git-wip-us.apache.org/repos/asf?p=stratos.git;a=blob_plain;f=tools/puppet3-agent/stratos_sendinfo.rb;hb=HEAD" -O stratos_sendinfo.rb

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

Page 13: 4.1.x Install Stratos with OpenStack in a Distributed Setup

Copyright © 2015 The Apache Software Foundation, Licensed under the Apache License, Version 2.0 13

3.

c.

a. b. c.

d.

e.

Node Id 076227021438.default.php

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.

Page 14: 4.1.x Install Stratos with OpenStack in a Distributed Setup

Copyright © 2015 The Apache Software Foundation, Licensed under the Apache License, Version 2.0 14

3.

4.

a.

b.

i.

ii.

c.

5.

a. b.

c.

6.

a.

b.

c.

d.

e. i.

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.

 -s ./puppetinstall -m -d <PUPPETMASTER-DOMAIN> <PUPPET-MASTER-IP>

Page 15: 4.1.x Install Stratos with OpenStack in a Distributed Setup

Copyright © 2015 The Apache Software Foundation, Licensed under the Apache License, Version 2.0 15

6.

e. i.

ii.

iii.

i. ii. iii. iv. v. vi. vii. viii. ix.

f. i.

ii.

iii.

iv.

Short code

Description

-m Install Puppet Master on the system.

-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:

puppet 5324 1 0 14:59 ? 00:00:00 /usr/bin/ruby /usr/bin/puppet master --masterport=8140root 5332 1071 0 15:05 pts/0 00:00:00 grep --color=auto puppet

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.

ls  

Page 16: 4.1.x Install Stratos with OpenStack in a Distributed Setup

Copyright © 2015 The Apache Software Foundation, Licensed under the Apache License, Version 2.0 16

6.

f.

iv.

g. i.

ii.

iii.

iv.

v.

vi.

vii.

h.

i. i.

ii.

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. 

ls manifests/nodes  

The output should be as follows:

base.pp  default.pp  haproxy.pp  lb.pp  mysql.pp  nodejs.pp  php.pp  ruby.pp   tomcat.pp   wordpress.pp

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/ 

Page 17: 4.1.x Install Stratos with OpenStack in a Distributed Setup

Copyright © 2015 The Apache Software Foundation, Licensed under the Apache License, Version 2.0 17

6.

i.

ii. iii.

j.

k.

l.

m.

n.

i.

ii. 1.

2.

o.

p.

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

$java_distribution = 'jdk-7u51-linux-x64.tar.gz'$java_name = 'jdk1.7.0_51'

Build the Python cartridge agent.

Checkout the Python cartridge agent  source from Apache Stratos remote repository to afolder of your choice.

git clone https://git-wip-us.apache.org/repos/asf/stratos.git <local-folder-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/

Page 18: 4.1.x Install Stratos with OpenStack in a Distributed Setup

Copyright © 2015 The Apache Software Foundation, Licensed under the Apache License, Version 2.0 18

6.

p.

q.

i.

ii.

7.

a.

i.

1.

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/ 

activemq-broker- .jar 5.9.1activemq-client- .jar 5.9.1geronimo-j2ee-management_1.1_spec-1.0.1.jar geronimo-jms_1.1_spec-1.1.1.jar hawtbuf-1.9.jar

 

Navigate to the   directory./etc/puppet/modules/lb/files/ activemq/ cd /etc/puppet/modules/lb/files/activemq

Check the list of files in the   folder:puppetlsThe output will be as follows:

  activemq-broker-5.9.1.jar  activemq-client-5.9.1.jar geronimo-j2ee-management_1.1_spec-1.0.1.jar geronimo-jms_1.1_spec-1.1.1.jar hawtbuf-1.9.jar

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.

Folder Name

Folder Contents Example Folder Location

stratos_installer

Apache Stratos setup <MyFolder>/stratos_installer/

stratos_packs

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:

sudo ./clean.sh -u <MySQL_USERNAME> -p <MySQL_PASSWORD>

Page 19: 4.1.x Install Stratos with OpenStack in a Distributed Setup

Copyright © 2015 The Apache Software Foundation, Licensed under the Apache License, Version 2.0 19

7.

a.

i.

1.

2.

3.

4.

5.

6.

stratos Installed Apache Stratos instance  <MyFolder>/stratos/

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 &ltstratos- folder.pack>

Download the and copy the JAR file into the MySQL Java Connector &ltstrato 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

Page 20: 4.1.x Install Stratos with OpenStack in a Distributed Setup

Copyright © 2015 The Apache Software Foundation, Licensed under the Apache License, Version 2.0 20

7.

a.

i.

6.

ii.

b.

i.

1.

2.

3.

4.

5.

6.

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.

Folder Name

Folder Contents Example Folder Location

stratos_installer

Apache Stratos setup <MyFolder>/stratos_installer/

stratos_packs

The zipped binary distribution files of the products that will be used by Apache Stratos

<MyFolder>/stratos_packs/

stratos Installed Apache Stratos instance  <MyFolder>/stratos/

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 &ltstratos- folder.pack>

Download the and copy the JAR file into the MySQL Java Connector &ltstrato folder.s-pack>

Update the following configurations in the <stratos_installer>/conf file. /setup.conf

For  more information on the    configurationsetup.shdefinitions, see  . Configuring setup.conf

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

Page 21: 4.1.x Install Stratos with OpenStack in a Distributed Setup

Copyright © 2015 The Apache Software Foundation, Licensed under the Apache License, Version 2.0 21

7.

b.

i.

6.

ii.

c.

i.

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

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

Page 22: 4.1.x Install Stratos with OpenStack in a Distributed Setup

Copyright © 2015 The Apache Software Foundation, Licensed under the Apache License, Version 2.0 22

7.

c.

i.

1.

2.

3.

4.

5.

6.

Create the following folders at the same level in a location where you will runApache Stratos.

Folder Name

Folder Contents Example Folder Location

stratos_installer

Apache Stratos setup <MyFolder>/stratos_installer/

stratos_packs

The zipped binary distribution files of the products that will be used by Apache Stratos

<MyFolder>/stratos_packs/

stratos Installed Apache Stratos instance  <MyFolder>/stratos/

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 &ltstratos- folder.pack>

Download the and copy the JAR file into the MySQL Java Connector &ltstrato 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

Page 23: 4.1.x Install Stratos with OpenStack in a Distributed Setup

Copyright © 2015 The Apache Software Foundation, Licensed under the Apache License, Version 2.0 23

7.

c.

i.

6.

ii.

d.

i.

1. 2.

3.

4.

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

connectionfactoryName=TopicConnectionFactoryjava.naming.provider.url=tcp://[MB_IP]:[MB_Port]java.naming.factory.initial=org.apache.activemq.jndi.

For  more information on the    configurationsetup.shdefinitions, see  . Configuring setup.conf

Page 24: 4.1.x Install Stratos with OpenStack in a Distributed Setup

Copyright © 2015 The Apache Software Foundation, Licensed under the Apache License, Version 2.0 24

7.

d.

i.

4.

5.

6.

7.

8.

9.

10.

11.

ActiveMQInitialContextFactory

# 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

org.apache.stratos.cep.extension.GradientFinderWindowProcessororg.apache.stratos.cep.extension.SecondDerivativeFinderWindowProcessororg.apache.stratos.cep.extension.FaultHandlingWindowProcessororg.apache.stratos.cep.extension.ConcatWindowProcessororg.apache.stratos.cep.extension.MemeberRequestHandlingCapabilityWindowProcessor

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

 directory./components/lib

activemq-broker-5.9.1.jar activemq-client-5.9.1.jar geronimo-j2ee-management_1.1_spec-1.0.1.jar geronimo-jms_1.1_spec-1.1.1.jar hawtbuf-1.9.jar

Copy the following WSO2 MB client libraries to the <CEP_HOME>/repository directory./components/dropins

andes-client-0.13.wso2v8.1.jar geronimo-jms_1.1_spec-1.1.0.wso2v1.jar

Download the  files from   and commons-lang3-3.4.jar commons.apache.org cfiles from  . Copy the ommons-logging-1.2.jar commons.apache.org

downloaded files to the   directory.<CEP_HOME>/repository/components/libCopy the following files from the <STRATOS_SOURCE_HOME>/extensions/cep

 directory to the /artifacts/eventbuilders <CEP_HOME>/repository directory:/deployment/server/eventbuilders

HealthStatisticsEventBuilder.xmlInstanceStatisticsEventBuilder.xmlLoadBalancerStatisticsEventBuilder.xml

Copy the following files from the respective directories to the  <CEP_HOME> directory./repository/components/lib

Page 25: 4.1.x Install Stratos with OpenStack in a Distributed Setup

Copyright © 2015 The Apache Software Foundation, Licensed under the Apache License, Version 2.0 25

7.

d.

i.

11.

12.

13.

14.

15.

16.

ii.

iii.

org.apache.stratos.messaging-4.1.x-SNAPSHOT.jar file in the <STRATOS_SOURCE_HOME>/components/org.apache.stratos.

directory.messaging/targetorg.apache.stratos.common-4.1.x-SNAPSHOT.jar file in the <STRATOS_SOURCE_HOME>/components/org.apache.stratos.common

directory./targetCopy the following file from <STRATOS_SOURCE_HOME>/extensions/cep

directory to the /artifacts/inputeventadaptors/ <CEP_HOME>directory:/repository/deployment/server/inputeventadaptors 

DefaultWSO2EventInputAdaptor.xmlCopy the following files from the <STRATOS_SOURCE_HOME>/extensions/cep

 directory to the /artifacts/outputeventadaptors <CEP_HOME> directory:/repository/deployment/server/outputeventadaptors

DefaultWSO2EventOutputAdaptor.xmlJMSOutputAdaptor.xml

Update the   and   with relevant values in the MB_HOSTNAME MB_LISTEN_PORT JMS file that was copied in the above step, as follows:OutputAdaptor.xml

property name="java.naming.provider.url">tcp://MB_HOSTNAME:MB_LISTEN_PORT</property>

Copy the following files from the <STRATOS_SOURCE_HOME>/extensions/cep directory to the /artifacts/executionplans <CEP_HOME>/repository

 directory:/deployment/server/executionplansAverageHeathRequest.xmlAverageInFlightRequestsFinder.xmlGradientOfHealthRequest.xmlGradientOfRequestsInFlightFinder.xmlSecondDerivativeOfHealthRequest.xmlSecondDerivativeOfRequestsInFlightFinder.xml

Copy the following files from the <STRATOS_SOURCE_HOME>/extensions/cep directory to the /artifacts/eventformatters <CEP_HOME>/repository

 directory:/deployment/server/eventformattersAverageInFlightRequestsEventFormatter.xmlAverageLoadAverageEventFormatter.xmlAverageMemoryConsumptionEventFormatter.xmlFaultMessageEventFormatter.xmlGradientInFlightRequestsEventFormatter.xmlGradientLoadAverageEventFormatter.xmlGradientMemoryConsumptionEventFormatter.xmlMemberAverageLoadAverageEventFormatter.xmlMemberAverageMemoryConsumptionEventFormatter.xmlMemberGradientLoadAverageEventFormatter.xmlMemberGradientMemoryConsumptionEventFormatter.xmlMemberSecondDerivativeLoadAverageEventFormatter.xmlMemberSecondDerivativeMemoryConsumptionEventFormatter.xmlSecondDerivativeInFlightRequestsEventFormatter.xmlSecondDerivativeLoadAverageEventFormatter.xmlSecondDerivativeMemoryConsumptionEventFormatter.xml

Navigate to the    directory.<CEP_HOME>/bin/ cd  <CEP_HOME>/bin/

 Run the following command to start WSO2 CEP:

./wso2server.sh start

Page 26: 4.1.x Install Stratos with OpenStack in a Distributed Setup

Copyright © 2015 The Apache Software Foundation, Licensed under the Apache License, Version 2.0 26

7.

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.