Follow the instructions below to install Apache Stratos products together with the third-party products used by Apache Stratos in a distributed setup, which has multiple Java virtual machines (JVMs), using the Stratos installer (setup.sh), which is available in the <STRATOS_SOURCE_HOME>/tools/stratos-installer directory:

If you need to run the setup script again on the same node, it is recommended to first clean the setup as root to remove any unnecessary content before running the setup. Use the following command to clean the setup:

sudo ./clean.sh -u <MySQL_USERNAME> -p <MySQL_PASSWORD>
  1. Configure and start the Cloud Controller node.

    1. Configure the common settings.

      Follow the instructions below to configure the common settings:

      1. Create the following folders at the same level in a location where you will run Apache Stratos.

        Folder NameFolder ContentsExample 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/
      2. Copy the contents of the <STRATOS_SOURCE_HOME>/tools/stratos-installer/ directory to the <stratos_installer> folder.
      3. Download the apache-stratos-<version>.zip file from Apache Download Mirrors, and copy it to <stratos_packs> directory.

        If you wish, you can build the source to obtain this ZIP file. After building the source, navigate to the <STRATOS_SOURCE_HOME>/products/stratos/modules/distribution/target/ directory to obtain the apache-stratos-<version>.zip file.

      4. Download the ActiveMQ distribution (tar.gz file) and copy it into the <stratos-pack> folder.
      5. Download the MySQL Java Connector and copy the JAR file into the <stratos-pack> folder.
      6. Update the following configurations in the <stratos_installer>/conf/setup.conf file. 
        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 <stratos> folder 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 relevant IaaS provider details. You can enable or disable the IaaS provider by setting the <IAAS_NAME>_provider_enabled parameter either to 'true' or  'false'.

        Database configuration
          • Update the value of the parameter mysql_connector_jar with 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 the MySQL server such as userstore_db_hostname, userstore_db_schema, userstore_db_port, userstore_db_user and userstore_db_pass accordingly.

            For more information on the setup.sh configuration definitions, see Configuring setup.conf


    2. Install Cloud Controller.

      sudo ./setup.sh -p "cc"

      For more information, see the setup.sh usage definition.

  2. Configure and start the Stratos Manager node.

    1. Configure the common settings.

      Follow the instructions below to configure the common settings:

      1. Create the following folders at the same level in a location where you will run Apache Stratos.

        Folder NameFolder ContentsExample 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/
      2. Copy the contents of the <STRATOS_SOURCE_HOME>/tools/stratos-installer/ directory to the <stratos_installer> folder.
      3. Download the apache-stratos-<version>.zip file from Apache Download Mirrors, and copy it to <stratos_packs> directory.

        If you wish, you can build the source to obtain this ZIP file. After building the source, navigate to the <STRATOS_SOURCE_HOME>/products/stratos/modules/distribution/target/ directory to obtain the apache-stratos-<version>.zip file.

      4. Download the ActiveMQ distribution (tar.gz file) and copy it into the <stratos-pack> folder.
      5. Download the MySQL Java Connector and copy the JAR file into the <stratos-pack> folder.
      6. Update the following configurations in the <stratos_installer>/conf/setup.conf file. 
        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 <stratos> folder 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 relevant IaaS provider details. You can enable or disable the IaaS provider by setting the <IAAS_NAME>_provider_enabled parameter either to 'true' or  'false'.

        Database configuration
          • Update the value of the parameter mysql_connector_jar with 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 the MySQL server such as userstore_db_hostname, userstore_db_schema, userstore_db_port, userstore_db_user and userstore_db_pass accordingly.

            For more information on the setup.sh configuration definitions, see Configuring setup.conf


    2. Install Stratos Manager.

      sudo ./setup.sh -p "sm"

      For more information, see the setup.sh usage definition.

  3. Configure and start the Autoscaler node.

    1. Configure the common settings.

      Follow the instructions below to configure the common settings:

      1. Create the following folders at the same level in a location where you will run Apache Stratos.

        Folder NameFolder ContentsExample 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/
      2. Copy the contents of the <STRATOS_SOURCE_HOME>/tools/stratos-installer/ directory to the <stratos_installer> folder.
      3. Download the apache-stratos-<version>.zip file from Apache Download Mirrors, and copy it to <stratos_packs> directory.

        If you wish, you can build the source to obtain this ZIP file. After building the source, navigate to the <STRATOS_SOURCE_HOME>/products/stratos/modules/distribution/target/ directory to obtain the apache-stratos-<version>.zip file.

      4. Download the ActiveMQ distribution (tar.gz file) and copy it into the <stratos-pack> folder.
      5. Download the MySQL Java Connector and copy the JAR file into the <stratos-pack> folder.
      6. Update the following configurations in the <stratos_installer>/conf/setup.conf file. 
        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 <stratos> folder 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 relevant IaaS provider details. You can enable or disable the IaaS provider by setting the <IAAS_NAME>_provider_enabled parameter either to 'true' or  'false'.

        Database configuration
          • Update the value of the parameter mysql_connector_jar with 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 the MySQL server such as userstore_db_hostname, userstore_db_schema, userstore_db_port, userstore_db_user and userstore_db_pass accordingly.

            For more information on the setup.sh configuration definitions, see Configuring setup.conf


    2. Install Autoscaler.

      sudo ./setup.sh -p "as"

      For more information, see the setup.sh usage definition.

  4. Configure and start WSO2 CEP:

    1. Configure WSO2 CEP.

      Update the following configuration and artifact files in the Complex Event Processor (CEP):

      1. Download WSO2 Complex Event processor 3.0.0.
      2. Update the port offset of the Complex Event Processor in the in the carbon.xml file, which is found in the <CEP_HOME>/repository/conf/ directory as 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.
      3. Copy the following stream-manager-config.xml file from the <STRATOS_SOURCE_HOME>/extensions/cep/artifacts/stream_definitions directory to <CEP_HOME>/repository/conf directory. Where <STRATOS_SOURCE_HOME> refers to the Apache Stratos source repository.
      4. Replace the content in the jndi.properties file, which is in the <CEP_HOME>/repository/conf directory, with the following configurations. Update the message-broker-ip and message-broker-port values.

        connectionfactoryName=TopicConnectionFactory
        java.naming.provider.url=tcp://[MB_IP]:[MB_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
        topic.topology=topology
        topic.ping=ping
      5. Add the following content to the siddhi.extension file, which is in the <CEP_HOME>/repository/conf/siddhi directory.

        org.apache.stratos.cep.extension.GradientFinderWindowProcessor
        org.apache.stratos.cep.extension.SecondDerivativeFinderWindowProcessor
        org.apache.stratos.cep.extension.FaultHandlingWindowProcessor
        org.apache.stratos.cep.extension.ConcatWindowProcessor
        org.apache.stratos.cep.extension.MemeberRequestHandlingCapabilityWindowProcessor
      6. Build the project in the <STRATOS_SOURCE_HOME>/extensions/cep/stratos-cep-extension directory. Thereafter, copy the org.apache.stratos.cep.extension-4.1.x.jar file that can be found in the <STRATOS_SOURCE_HOME>/extensions/cep/stratos-cep-extension/target  directory, to the <CEP_HOME>/repository/components/lib/ directory.
      7. Download any dependency on 5.9.1 or any latest stable ActiveMQ TAR file from https://activemq.apache.org/download.html. The folder path of this file will be referred to as  <ACTIVEMQ_HOME>. Copy the following ActiveMQ client JARSs from <ActiveMQ_HOME> /lib directory to the <CEP_HOME>/repository/components/lib directory.

        • 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

      8. Copy the following WSO2 MB client libraries to the <CEP_HOME>/repository/components/dropins directory.
        • andes-client-0.13.wso2v8.1.jar 
        • geronimo-jms_1.1_spec-1.1.0.wso2v1.jar
      9. Download the  commons-lang3-3.4.jar files from commons.apache.org and commons-logging-1.2.jar files from commons.apache.org. Copy the downloaded files to the  <CEP_HOME>/repository/components/lib directory.
      10. Copy the following files from the <STRATOS_SOURCE_HOME>/extensions/cep/artifacts/eventbuilders directory to the <CEP_HOME>/repository/deployment/server/eventbuilders directory:
        • HealthStatisticsEventBuilder.xml
        • InstanceStatisticsEventBuilder.xml
        • LoadBalancerStatisticsEventBuilder.xml
      11. Copy the following files from the respective directories to the  <CEP_HOME>/repository/components/lib directory.
        • org.apache.stratos.messaging-4.1.x-SNAPSHOT.jar file in the <STRATOS_SOURCE_HOME>/components/org.apache.stratos.messaging/target directory.
        • org.apache.stratos.common-4.1.x-SNAPSHOT.jar file in the <STRATOS_SOURCE_HOME>/components/org.apache.stratos.common/target directory.

      12. Copy the following file from <STRATOS_SOURCE_HOME>/extensions/cep/artifacts/inputeventadaptors/ directory to the <CEP_HOME>/repository/deployment/server/inputeventadaptors directory:
        • DefaultWSO2EventInputAdaptor.xml
      13. Copy the following files from the <STRATOS_SOURCE_HOME>/extensions/cep/artifacts/outputeventadaptors directory to the <CEP_HOME>/repository/deployment/server/outputeventadaptors directory:
        • DefaultWSO2EventOutputAdaptor.xml
        • JMSOutputAdaptor.xml
      14. Update the MB_HOSTNAME and MB_LISTEN_PORT with relevant values in the JMSOutputAdaptor.xml file that was copied in the above step, as follows:

        property name="java.naming.provider.url">tcp://MB_HOSTNAME:MB_LISTEN_PORT</property>
      15. Copy the following files from the <STRATOS_SOURCE_HOME>/extensions/cep/artifacts/executionplans directory to the <CEP_HOME>/repository/deployment/server/executionplans directory:
        • AverageHeathRequest.xml
        • AverageInFlightRequestsFinder.xml
        • GradientOfHealthRequest.xml
        • GradientOfRequestsInFlightFinder.xml
        • SecondDerivativeOfHealthRequest.xml
        • SecondDerivativeOfRequestsInFlightFinder.xml
      16. Copy the following files from the <STRATOS_SOURCE_HOME>/extensions/cep/artifacts/eventformatters directory to the <CEP_HOME>/repository/deployment/server/eventformatters directory:
        • AverageInFlightRequestsEventFormatter.xml
        • AverageLoadAverageEventFormatter.xml
        • AverageMemoryConsumptionEventFormatter.xml
        • FaultMessageEventFormatter.xml
        • GradientInFlightRequestsEventFormatter.xml
        • GradientLoadAverageEventFormatter.xml
        • GradientMemoryConsumptionEventFormatter.xml
        • MemberAverageLoadAverageEventFormatter.xml
        • MemberAverageMemoryConsumptionEventFormatter.xml
        • MemberGradientLoadAverageEventFormatter.xml
        • MemberGradientMemoryConsumptionEventFormatter.xml
        • MemberSecondDerivativeLoadAverageEventFormatter.xml
        • MemberSecondDerivativeMemoryConsumptionEventFormatter.xml
        • SecondDerivativeInFlightRequestsEventFormatter.xml
        • SecondDerivativeLoadAverageEventFormatter.xml
        • SecondDerivativeMemoryConsumptionEventFormatter.xml

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

    3. Run the following command to start WSO2 CEP:

      ./wso2server.sh start

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 setup.sh script has been described as follows:

setup.sh -p "<PROFILE>" [-s] [-o <PORT_OFFSET>]

Short codeDescription
-p

Apache Stratos product profile to be installed on this node. Enter the name of the profile here. The available profiles are as follows:

ProfileDescription
defaultAll the products will be installed.
ccCloud Controlled will be installed.
asAutoscaler will be installed.
smStratos Manager will be installed
-sSilent 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.
-oPort offset. Enables you to specify a port offset for the server to be started.
  • No labels