Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Follow the steps given below to run a WSO2 product as a service on Private PaaS, which runs on KubernetesDocker:

Table of Contents
maxLevel4
minLevel4

 

Step 1: Deploying Private PaaS on a preferred IaaS

Panel

For more information, see deploying PPaaS on a preferred IaaS.

 

Step 2: Downloading the product pack

Panel
  1. Download the required product pack from the respective product download page.

    Info

    Example: Download ESB from here.

  2. Copy the downloaded .zip file to the packs folder, which is in the /etc/puppet/modules/wso2installer/files/<SERVER_NAME> directory. 
    Example: When configuring ESB, copy the file to the /etc/puppet/modules/wso2installer/files/wso2esb481/packs directory.

 

Step 3: Building and importing Docker images

Panel
  1. Download the Private PaaS cartridges from the product page.

  2. Navigate to the <PRIVATE-PAAS-CARTRIDGES>/wso2esb/4.8.1/<CARTRIDGE_HOME>/docker directory.
    Example: 

    Code Block
    cd <PRIVATE-PAAS-CARTRIDGES>/wso2esb/<ESB_4.8.1_CARTRIDGE_HOME>/docker
  3. Run the build.sh file to build the Docker image.

    Info

    This will copy the plugins and the Template Module to the Docker image.

    Code Block
    ./build.sh
  4. List the Docker images.

    Code Block
    docker images

    Example response format: If you have successfully build the Docker image, you will get the following as the response:

    Code Block
    wso2/das        3.0.0              ac57800e96c2        2 minutes ago         777.6 MB
  5. Save the new image to a .tar file.

    Code Block
    docker save <NEW_IMAGE_NAME> > <LOCATION_OF_OF_TAR_FILE>

    For example:

    Code Block
    docker save myppaasimage > /tmp/myppaasimage.tar
  6. Copy the Docker image to the Kubernetes minion node.

    Code Block
    scp <IMAGE_NAME>.tar core@<NODE_IP>:

    Example:

    Code Block
    scp myppaasimage.tar core@172.17.8.102:
    Info

    Execute the kubectl get nodes command to get the IP address of the Kubernetes nodes.

  7. SSH into the Kubernetes node using one of the following commands:

    Code Block
    ssh core@<NODE_IP> or vagrant ssh node-01
  8. Load the .tar file to the Kubernetes node.

    Code Block
    docker load < <LOCATION_OF_OF_TAR_FILE>

    Example:

    Code Block
    docker load < /tmp/myppaasimage.tar
Info

If more than one Kubernetes node exists, repeat step 4, 5 and 6 for the remaining nodes.

 

Step 4: Creating product specific databases

...

panel
Notepanel

This step is optional. To confirm if the product you are running on top of WSO2 PPaaS requires a database table, refer the README file that is in the specific product or cartridge folder.

It is mandatory to create the registry database for all products.

Example:

Code Block
mysql> create database regdb;
mysql> use regdb;
mysql> source <APIM_HOME>/dbscripts/mysql.sql;
mysql> grant all on regdb.* TO username@localhost identified by "password";

Create a database (or databases depending on the requirement) using the following commands, where <PRODUCT_HOME> is the path to any of the product instances you installed, and specify the username and password.

Info
titleAbout using MySQL in different operating systems

For users of Microsoft Windows, when creating the database in MySQL, it is important to specify the character set as latin1. Failure to do this may result in an error (error code: 1709) when starting your cluster. This error occurs in certain versions of MySQL (5.6.x) and is related to the UTF-8 encoding. MySQL originally used the latin1 character set by default, which stored characters in a 2-byte sequence. However, in recent versions, MySQL defaults to UTF-8 to be friendlier to international users. Hence, you must use latin1 as the character set as indicated below in the database creation commands to avoid this problem. Note that this may result in issues with non-latin characters (like Hebrew, Japanese, etc.). The following is how your database creation command should look.

mysql> create database <DATABASE_NAME> character set latin1;

For users of other operating systems, the standard database creation commands will suffice. For these operating systems, the following is how your database creation command should look.

mysql> create database <DATABASE_NAME>;
Expand
titleClick here to see and an example

You will need to create 3 databases for API Manager as shown below:  

Code Block
mysql> create database apimgtdb;
mysql> use apimgtdb;
mysql> source <APIM_HOME>/dbscripts/apimgt/mysql.sql;
mysql> grant all on apimgtdb.* TO username@localhost identified by "password";
 
 
mysql> create database userdb;
mysql> use userdb;
mysql> source <APIM_HOME>/dbscripts/mysql.sql;
mysql> grant all on userdb.* TO username@localhost identified by "password";
 
 
mysql> create database regdb;
mysql> use regdb;
mysql> source <APIM_HOME>/dbscripts/mysql.sql;
mysql> grant all on regdb.* TO username@localhost identified by "password";
Note

Ensure that MySQL is configured so that all nodes can connect to it.

 

Step 5: Configuring the artifact JSON files

Panel
  • Cartridge JSON
    Configure the following parameters in the cartridge JSON file:
    • Ensure that the imageId under the iaasProvider is the same as the Docker image you created, if you are running Private PaaS on Kubernetes.
    • Update the datasource configurations, i.e DB URLs, username and password, under properties.

      Info

      Update datasource configurations for all cartridge JSON files that run on all IaaS, except the Mock IaaS.

      Expand
      titleDatasource configurations
      Code Block
      {
        "name": "payload_parameter.CONFIG_PARAM_REGISTRY_DB_URL",
        "value": "jdbc:mysql://192.168.30.7:3306/stratos_reg_db?autoReconnect=true"
      },
      {
        "name": "payload_parameter.CONFIG_PARAM_REGISTRY_DB_USER_NAME",
        "value": "<USER_NAME>"
      },
      {
        "name": "payload_parameter.CONFIG_PARAM_REGISTRY_DB_PASSWORD",
        "value": "<PASSWORD>"
      },
      {
        "name": "payload_parameter.CONFIG_PARAM_CONFIG_DB_URL",
        "value": "jdbc:mysql://192.168.30.7:3306/config_db_esb?autoReconnect=true"
      },
      {
        "name": "payload_parameter.CONFIG_PARAM_CONFIG_DB_USER_NAME",
        "value": "<USER_NAME>"
      },
      {
        "name": "payload_parameter.CONFIG_PARAM_CONFIG_DB_PASSWORD",
        "value": "<PASSWORD>"
      },
      {
        "name": "payload_parameter.CONFIG_PARAM_USER_MGT_DB_URL",
        "value": "jdbc:mysql://192.168.30.7:3306/stratos_user_db?autoReconnect=true"
      },
      {
        "name": "payload_parameter.CONFIG_PARAM_USER_MGT_DB_USER_NAME",
        "value": "<USER_NAME>"
      },
      {
        "name": "payload_parameter.CONFIG_PARAM_USER_MGT_DB_PASSWORD",
        "value": "<PASSWORD>"
      }

      Example:

      Code Block
      {
        "name": "payload_parameter.CONFIG_PARAM_REGISTRY_DB_URL",
        "value": "jdbc:mysql://192.168.30.7:3306/stratos_reg_db?autoReconnect=true"
      },
      {
        "name": "payload_parameter.CONFIG_PARAM_REGISTRY_DB_USER_NAME",
        "value": "root"
      },
      {
        "name": "payload_parameter.CONFIG_PARAM_REGISTRY_DB_PASSWORD",
        "value": "root"
      },
      {
        "name": "payload_parameter.CONFIG_PARAM_CONFIG_DB_URL",
        "value": "jdbc:mysql://192.168.30.7:3306/config_db_esb?autoReconnect=true"
      },
      {
        "name": "payload_parameter.CONFIG_PARAM_CONFIG_DB_USER_NAME",
        "value": "root"
      },
      {
        "name": "payload_parameter.CONFIG_PARAM_CONFIG_DB_PASSWORD",
        "value": "root"
      },
      {
        "name": "payload_parameter.CONFIG_PARAM_USER_MGT_DB_URL",
        "value": "jdbc:mysql://192.168.30.7:3306/stratos_user_db?autoReconnect=true"
      },
      {
        "name": "payload_parameter.CONFIG_PARAM_USER_MGT_DB_USER_NAME",
        "value": "root"
      },
      {
        "name": "payload_parameter.CONFIG_PARAM_USER_MGT_DB_PASSWORD",
        "value": "root"
      }
  • Network Partition JSON
    Configuring the network partition is optional. Define the load balancer port IPs under property.
  • Application JSON
    If the application is a single tenant application, ensure to add the artifact repository related details in subscribableInfo, under the artifactRepository section, of the application JSON definition.
    Example:

    Code Block
    "artifactRepository":{  
       "privateRepo":false,
       "repoUrl":"https://github.com/lakwarus/single-cartridge.git",
       "repoUsername":"",
       "repoPassword":""
    }
    Info

    By subscribing to an application you can deploy a custom application artifacts in Private PaaS.

  • Application Sign Up JSON
    Sign up to the application if the application is a multi-tenant application.

    Info

    For more information on application sign up see, signing up to an application.

 

Step 6: Deploying WSO2 products on Private PaaS

Panel
  1. Navigate to the application directory of the preferred WSO2 product.

    Code Block
    cd <PRIVATE_PAAS_CARTRIDGES_HOME>/<SERVER_NAME>/<VERSION>/samples/applications/<SERVER_NAME>-<VERSION>-application/scripts/<IAAS>

    Example:

    Code Block
    cd <PRIVATE_PAAS_CARTRIDGES_HOME>/wso2das/3.0.0/samples/applications/wso2das-300-application/scripts/mock
  2. Deploy the application.

    Code Block
    ./deploy.sh

...

What's next?

Info
iconfalse

After you have configured the respective WSO2 products to run on PPaaS, you can access the application instances deployed in PPaaS.