Skip to end of metadata
Go to start of metadata

WSO2 App Factory uses a collection of products such as WSO2 ELB, WSO2 API Manager, WSO2 Application Server, WSO2 Storage Server, GitBlit, Jenkins etc. To make it easier for you to set up all of these products and configure them to collaborate, we provide a set of puppet scripts. Puppet is an IT automation software that helps system administrators to manage infrastructure throughout its lifecycle.

We configure a Puppet Master, which is a server that collaborates with a set of puppet agents where different products are set up. The number of puppet agents you want in your environment depends on infrastructure.

Be sure to use Puppet Master version 3.7 or above.

The following topics explain how to configure the environment:

Setting up the Puppet Master

The steps below explain how to set up the Puppet Master.

  1. Log in to the server where you intend to set up the Puppet Master as root user.
  2. Get the checkout from this Git repository to /home/<user>/puppetsource/.

  3. Download Puppet Master version 3.7. or above from https://puppetlabs.com. 

  4. Install the Puppet Master packages with command apt-get install puppetmaster. If you want to stop the Puppet Master, the command is /etc/init.d/puppetmaster stop.
  5. Change the following configuration files in Puppet Master installation.

    FileConfiguration
    /etc/default/puppetmaster
    DAEMON_OPTS="--ssl_client_header=HTTP_X_SSL_SUBJECT"
    SERVERTYPE=webrick
    PUPPETMASTERS=1
    PORT=8140
    /etc/puppet/puppet.conf
    [main]
    logdir=/var/log/puppet
    vardir=/var/lib/puppet
    ssldir=/var/lib/puppet/ssl
    rundir=/var/run/puppet
    factpath=$vardir/lib/facter
    templatedir=$confdir/templates
    prerun_command=/etc/puppet/etckeeper-commit-pre
    postrun_command=/etc/puppet/etckeeper-commit-post
    debug=true
    verbose=true
    
    
    [master]
    # These are needed when the puppetmaster is run by passenger
    # and can safely be removed if webrick is used.
    ssl_client_header = SSL_CLIENT_S_DN
    ssl_client_verify_header = SSL_CLIENT_VERIFY
    autosign =true
    
    
    [appfactory]
    environment=appfactory
    modulepath=/home/{user}/puppetsource/appfactory/modules
    templatedir=/home/{user}/puppetsource/appfactory/templates
    manifest=/home/{user}/puppetsource/appfactory/manifests/site.pp
    manifestdir=/home/{user}/puppetsource/appfactory/manifests/

     

  6. Set the server's host name to puppet.wso2.example.com and add the host to /etc/hostname file as follows:
    hostname puppet.appfactory.private.wso2.com
    hostname > /etc/hostname

     

  7. Starting the Puppet Master with the following command:
    /etc/init.d/puppetmaster start

  8. Install apache file server using the following command:
    apt-­get install apache2

    We need this file server to manage the distribution packs of all products involved in an App Factory deployment, such as WSO2 App Factory, API Manager, ELB, application Server etc. 
     
  9. Create a folder named software inside the apache document ­root (/var/www) and download the following distribution packs to the software folder:
    • apache-maven-3.0.5-bin.tar.gz
    • apache-activemq-5.9.1-bin.tar.gz
    • apache-stratos-4.0.0-wso2v1.zip
    • apache-stratos-cartridge-agent-4.0.0-wso2v1-bin.zip
    • apache-stratos-load-balancer-4.0.0-wso2v1.zip
    • gitblit-1.3.1.zip
    • gitblit-1.4.1.zip
    • jdk-7u51-linux-x64.tar.gz
    • mysql-connector-java-5.1.29-bin.jar
    • wso2appfactory-2.1.0.zip
    • wso2as-5.2.0.zip
    • wso2as-5.2.1.zip
    • wso2bam-2.4.1.zip
    • wso2bps-3.2.0.zip
    • wso2elb-2.1.0.zip
    • wso2is-4.5.0.zip
    • wso2mb-2.2.0.zip
    • wso2-private-paas-4.0.0-installer.zip
    • wso2ss-1.1.0.zip
    • wso2ues-1.1.0.zip
     

If you prefer to have the software folder in a different location other than the apache document root, change the <DocumentRoot> element as vi /etc/apache2/sites-enabled/puppet.

You have now completely set up the Puppet Master. Next, let's set up Puppet Agents in separate servers.

Customizing the puppet scripts

Please note that you have to do the following configurations on the nodes.pp file(which is located on <puppet_source>/appfactory/manifests/ directory).

  1. Configure the following in the 'basenode' section.
    1. Configure package repository URL. Puppet will use this repository URL to download all the packs it requires. This location should contain the following packs.

      $package_repo = 'http://puppet.appfactory.private.wso2.com/software'
    2. Local package directory. This is where the packs will be copied in the agent node.

      local_package_dir = '/mnt/packs'
    3. Domain name. This will be the domain name used in the setup.

      $domain = 'appfactory.private.wso2.com'
    4. Host entries. These are the host entries of the servers. Please note that you have to configure them before the setup.

      $hosts_mapping = [
       "192.168.18.161,puppet.${domain}",
       "10.11.12.4,mysql1.${domain}",
       "10.11.12.4,mysql2.${domain}",
       "10.11.12.9,appfactoryelb.${domain}",
       "10.11.12.5,ldap.${domain}",
       "10.11.12.9,identity.${domain}",
       "10.11.12.3,cloudmgt.${domain}",
       "10.11.12.9,issuetracker.${domain}",
       "10.11.12.9,apps.${domain}",
       "10.11.12.11,messaging.${domain}",
       "10.11.12.9,process.${domain}",
       "10.11.12.9,jenkins.${domain}",
       "10.11.12.9,storage.${domain}",
       "10.11.12.13,git.${domain}",
       "10.11.12.14,s2git.${domain}",
       "10.0.0.91,dashboards.${domain}",
       "10.11.12.17,keymanager.api.${domain}",
       "10.11.12.17,gateway.api.${domain}",
       "10.11.12.17,api.${domain}",
       "10.11.12.15,monitor.${domain}",
       "10.11.12.15,receiver1.${domain}",
       "10.11.12.15,node0.cassandra.${domain}",
       "10.11.12.15,hadoop0.${domain}",
       "10.11.12.6,sc.dev.${domain}",
       "10.11.12.8,sc.test.${domain}",
       "10.11.12.10,sc.${domain}",
       "192.168.18.242,appserver.dev.${domain}",
       "192.168.18.244,appserver.test.${domain}",
       "192.168.18.246,appserver.${domain}",
       "10.11.12.13,mysql-dev-01.${domain}",
       "10.11.12.14,mysql-test-01.${domain}",
       "10.11.12.16,mysql-prod-01.${domain}"
       ]
  2. Configure the following in the 'confignode' section.
    1. MySQL connection details. Please note that we have used 2 MySQL server domains for config and governance registry databases. In this deployment, we point both of these to a single MySQL server.

       $mysql_port        = '3306'
       $max_connections   = '100000'
       $max_active        = '200'
       $max_wait          = '360000'
       $mysql_driver_file = 'mysql-connector-java-5.1.28-bin.jar'
       $mysql_server_1    = "mysql1.${domain}"
       $mysql_server_2    = "mysql2.${domain}"
    2. Default user name and password.

       $usrmgt_username = 'admin'
       $usrmgt_password = 'password'
    3. WSO2 Private PaaS configurations. These are the configurations of the cartridge base image and the OpenStack endpoints and credentials. These information will be used when spawning new AppServer instances for artifact deployment.

       $iaas   		       = "os"
       $iaas_region 		   = "RegionOne"
       $iaas_cartridge_image = "e73ef74a-84c9-4bcc-8249-0f2ea45a8fd2"
       
       $os_identity		   = "openstackDemo:admin"
       $os_credentials 	   = "password"
       $os_jclouds_endpoint  = "http://appfactorycloud.private.wso2.com:5000/v2.0"
       $os_keypair_name      = "appfackey"
       $os_security_groups   = "default"
  3. Change the node name regular expressions to match the host name of the servers.  For example change the "/appfactory/" in the following configuration to match the host name of the target server.

    node /appfactory/ inherits confignode {
      include 'wso2base::maven'
      $server_ip= $ipaddress
      class { "appfactory":
        version            => "2.0.0",
        offset             => 0,
        localmember_port   => 4000,
        clustering         => 'true',
        maintenance_mode   => true,
        owner              => "kurumba",
        group              => "kurumba",
        sub_cluster_domain => "mgt",
        config_db          => $af_config_database_name,
        members            => {
          "appfactoryelb.${wso2_env_domain}" => '4010'
        },
        target             => "/mnt/${server_ip}",
        stage              => "deploy",
        file_ignore_filter => "local",
        s2gitblit_server   => "192.168.18.173"
      }
    }

If you are using a different OpenStack environment for Private PaaS cartridges please do these additional configurations

  1. Change the "s2gitblit_server" parameter of the AppFactory node configuration section. Please note that the public IP of the s2gitblit server is passed from this parameter.

    s2gitblit_server   => "192.168.18.173"
  2. Change the "server_ip" parameter of the s2gitblit node configuration section. Please note that the public IP of s2gitblit server is passed from this parameter.

    server_ip => "192.168.18.173"
  • No labels