Follow the instructions below to configure Puppet Master for Apache Stratos on Debian/Ubuntu 12.04.1 LTS based Linux distributions:

  1. Get root access.
    sudo -i
  2. Install Git.
    apt-get install git
  3. Obtain the Puppet Master installation script. This will create a folder named puppetinstall.
    git clone https://github.com/thilinapiy/puppetinstall
  4. Navigate to the puppetinstall folder using the following command:
    cd puppetinstall
  5. Install Puppet Master (v3) as follows:
    1. Execute the following command. When you execute this command, your system hostname will get modified.
      ./puppetinstall -m -d <PUPPETMASTER-DOMAIN> -s <PUPPET-MASTER-IP>
      For example:
      ./puppetinstall -m -d test.org 
      If requested, press enter. If you have successfully installed Puppet Master, the following message will appear:
      Installation completed successfully"
    2. Execute the hostname command. This will show that your system hostname has been modified.
      For example:
      puppet.test.org
    3. Verify your Puppet Master (v3) installation by running the following command in the puppetinstall folder:
      ps -ef | grep puppet
      The output will be as follows:

      puppet 5324 1 0 14:59 ? 00:00:00 /usr/bin/ruby /usr/bin/puppet master --masterport=8140
      root 5332 1071 0 15:05 pts/0 00:00:00 grep --color=auto puppet
  6. Obtain the Apache Stratos Puppet scripts as follows:
    1. Clone the Apache Stratos Git repository to a folder of your choice. The location of the extracted source will be referred to as <STRATOS_SOURCE_HOME>.
      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.git STRATOS_SOURCE_HOME

       Make sure that you have setup Git properly. For more information, go to Getting Started with Git.

    2. Navigate to the <STRATOS_SOURCE_HOME>/ directory.
      cd STRATOS_SOURCE_HOME

    3. Check out Stratos 4.0.0 tag to a folder of your choice:
      git checkout -b <REMOTE_BRANCH/TAG> <LOCAL_BRANCH>
      For example:
      git checkout -b 4.0.0 4.0.0
    4. Navigate to the <stratos>/tools/puppet3/ directory to obtain the Puppet scripts.
      cd stratos/tools/puppet3/
    5. Check the list of files.
      ls  
      The output should be as follows:
      auth.conf  autosign.conf  fileserver.conf manifests modules  puppet.conf
  7. Copy the Stratos Puppet scripts to the Puppet Master configurations directory as follows:
    1. Navigate to the puppet folder.
      cd /etc/puppet/ 
    2. Check the list of files in the puppet folder:
      ls
      The output will be as follows:
      auth.conf  autosign.conf fileserver.conf manifests modules puppet.conf templates
    3. Copy the content from the/root/stratos/tools/puppet3/manifests/ directory to the /etc/puppet/manifests/ directory.
      For example:
      cp -R /root/stratos/tools/puppet3/manifests/* manifests/
    4. Copy the content from the /root/stratos/tools/puppet3/modules/ directory to the /etc/puppet/modules/ directory.
      For example:
      cp -R /root/stratos/tools/puppet3/modules/* modules/

    5. Check the list of files in the /etc/puppet/manifests/ directory.
      ls manifests/
      The output should be as follows:
      nodes.pp  site.pp 
    6. Check the list of files in the /etc/puppet/modules/ directory.
      ls  modules/
      The output should be as follows:
      agent java  lb  mysql nodejs  php  ruby  tomcat  wordpress
  8. Change the variables in the nodes.pp file accordingly.
    vi /etc/puppet/manifests/nodes.pp

      #following directory is used to store binary packages
      $local_package_dir	= '/mnt/packs'
      # Stratos message broker IP and port
      $mb_ip            	= '10.4.128.12'
      $mb_port          	= '61616'
      $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'
  9. Enter the domain names that the master should automatically sign.
    1. Navigate to the /etc/puppet/ directory.
      cd /etc/puppet/ 
    2. Add the domain names in the autosign.conf file and save the file.
    3. You can view the contents of the autosign.conf file as follows:
      cat autosign.conf
      Based on the example the output will be as follows:
      *.test.org 
  10. Download a Java distribution and define the Java distribution in the /etc/puppet/manifests/ directory.

  11. Create the files folder in the /etc/puppet/modules/java/ directory.
    mkdir /etc/puppet/modules/java/files

  12. Download the Java distribution to the /etc/puppet/modules/java/files/ directory. Define the Java distribution name and the unzipped folder name in the  nodes.pp file, which is in the /etc/puppet/manifests/ directory, and save the file.

    $java_distribution	= 'jdk-7u7-linux-x64.tar.gz'
    $java_name        	= 'jdk1.7.0_07'

    To get support for 32 bits, download the Java 32-bit distribution and change the $java_distribution parameter in the nodes.pp file accordingly.

  13. Copy the Cartridge Agent distribution (apache-stratos-cartridge-agent-4.0.0.zip), which is in the <STRATOS_HOME>/products/cartridge-agent/modules/distribution/target/ directory, to the /etc/puppet/modules/agent/files/ directory.

  14. Create a folder named activemq in the /etc/puppet/modules/agent/files/ directory.

    The name of the folder you create in this step depends on the value you entered in step 8 above, for the mb_type parameter.

    Example: If the value you gave for the mb_type parameter is activemq, then you should create the name of this folder as activemq.
    1. Navigate to the /etc/puppet/modules/agent/files/ directory.
      cd /etc/puppet/modules/agent/files/
    2. Check the list of files in the puppet folder:
      ls
      The output will be as follows:
      activemq  apache-stratos-cartridge-agent-4.0.0.zip
  15. 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 /etc/puppet/modules/agent/files/activemq/ 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

     

    1. Navigate to the /etc/puppet/modules/agent/files/activemq/ directory.
      cd /etc/puppet/modules/agent/files/activemq 
    2. Check the list of files in the puppet folder:
      ls
      The 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
  16. Copy the Apache Stratos Load Balancer distribution (apache-stratos-load-balancer-4.0.0.zip), which is in the <source-home>/products/load-balancer/modules/distribution/target/ directory, to the /etc/puppet/modules/lb/files/ directory.

  17. Repeat steps 13 and step 14 to copy the ActiveMQ JAR files to the /etc/puppet/modules/lb/files/ directory.

  • No labels