Unknown macro: {next_previous_link3}
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 13 Next »

Follow the steps given below run a WSO2 product as a service on Private PaaS, on Docker:

 

Step 1: Deploy Private PaaS on a preferred IaaS

For more information on deploying Private PaaS, see Deploying PPaaS on a Preferred IaaS.

 

Step 2: Downloading the Product pack

Copy the respective product pack in the .zip format to the packs folder, which is in the /etc/puppet/modules/wso2installer/files/<SERVER_NAME> directory. 
Example: When configuring ESB navigate to the /etc/puppet/modules/wso2installer/files/wso2esb481/packs directory.

You can download the product pack from the respective products download page.

Example: Download ESB from here.

 

Step 3: Importing the Docker image to the nodes

  1. Navigate to the <PRIVATE-PAAS-CARTRIDGES>/wso2esb/4.8.1/docker directory.

    cd <PRIVATE-PAAS-CARTRIDGES>/wso2esb/4.8.1/docker
  2. Run the build.sh file to build the Docker image.

    This will copy the plugins and the template module to the Docker image.

    ./build.sh
  3. List the Docker images.

    docker images

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

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

    docker save <NEW_IMAGE_NAME> > <LOCATION_OF_OF_TAR_FILE>

    For example:

    docker save myppaasimage > /tmp/myppaasimage.tar
  5. Copy the Docker image to the Kubernetes minion nodes.

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

    Example:

    scp myppaasimage.tar core@172.17.8.102:

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

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

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

    docker load < <LOCATION_OF_OF_TAR_FILE>

    Example:

    docker load < /tmp/myppaasimage.tar

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

 

Step 4: Creating a Database table (optional)

This step is not mandatory for all the applications. To confirm if the product you are running on top of WSO2 Private PaaS requires a database table, refer the README file of the specific product or cartridge folder.

Create the a databases (or more 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.

About 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>;

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

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";

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

 

Step 5: Configuring the cartridge JSON 

Configure the following parameters in the cartridge JSON file:

  1. Ensure that the imageId under the iaasProvider matches the Docker image ID, If you are running Private PaaS on Kubernetes.
  2. Update the datasource configurations, i.e DB URLs, username and password, under properties.

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

     Datasource configurations
    {
      "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:

    {
      "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"
    }

 

Step 6: Running the product as service on Private PaaS

  1. Navigate to the preferred WSO2 products application sample directory.

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

    Example:

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

    ./deploy.sh

 

 

 

  • No labels