Running on a Virtual Machine
Follow the steps given below to run a WSO2 product as a service on Private PaaS, which runs on a Virtual machine:
Step 1: Deploying Private PaaS on a preferred IaaS
For more information on deploying Private PaaS, see deploying PPaaS on a preferred IaaS.
Step 2: Building the Template Modules
Download the respective product cartridge from the PPaaS product page on the WSO2 website.
Navigate to the Template Module.
cd <TEMPLATE_MODULE_PATH>
Example:
cd <DAS_CARTRIDGE_HOME>/templates-module
Build the Template Module.
mvn clean install
Step 3: Configuring the Puppet Master
Follow the steps giving below to configure Puppet Master for WSO2 cartridges:
To set up Puppet Master, it is not mandatory to configure the modules mentioned below. The following are required only when configuring the servers that are being used by the respective application.
Example: If the ESB cartridge is the only cartridge that is being used in the application, you are only required to set up the modules related to ESB.
Copy the respective product pack in the
.zip
format to thepacks
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.
Download the respective WSO2 product cartridge via the PPaaS product page and unzip it. The unzipped folder will be referred to as
<CARTRIDGE_HOME>
.
For example, to download the ESB cartridge, navigate to the PPaaS product page and click Cartridges > wso2esb-4.8.1-cartridge-4.1.1.Copy the respective template module ZIP file, which is in the
<CARTRIDGE_HOME>/templates-module/target
directory to the/etc/puppet/modules/wso2installer/files/<SERVER_NAME>/packs
directory.Change the file permission value, for content in the
/etc/puppet/modules/wso2installer/files/<SERVER_NAME>/packs
directory, to0755
.chmod 755 <server_pack>.zip chmod 755 <template_module>.zip
Download the Python Cartridge Agent (PCA) plugin, via the PPaaS product page, and copy the downloaded ZIP file to the
/etc/puppet/modules/wso2installer/files/<SERVER_NAME>/plugins
directory.Change the file permission of the content in the
/etc/puppet/modules/wso2installer/files/<SERVER_NAME>/plugins
directory to0755
.chmod 755 wso2esb-481-startup-handler.py chmod 755 wso2esb-481-startup-handler.yapsy-plugin
Update the respective entry in
nodes.pp
file, which is in the/etc/puppet/manifests/nodes/nodes.pp
directory with the following server variables.
Example: If you are updating the ESB server, you can update the file as follows:# ESB cartridge node node /[0-9]{1,12}.*wso2esb-481/ inherits base { class { 'java': } class { 'python_agent':} class { 'configurator': } class {'wso2installer': server_name => 'wso2esb-4.8.1', module_name => 'wso2esb481' } }
Step 4: Creating product specific databases
It is mandatory to create the registry database for all products.
Example:
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 the 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
.
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.
Step 5: Configuring the artifact JSON files
- Cartridge JSON
Configure the following parameters in the cartridge JSON file:
- Ensure that the
imageId
under theiaasProvider
is the same as the Docker image you created, If you are running Private PaaS on Kubernetes. Update the datasource configurations under properties.
Update the datasource configurations for all cartridge JSON files that run on all IaaS, except the Mock IaaS.
- Ensure that the
- Network Partition JSON
Configuring the network partition is optional. Define the load balancer port IPs underproperty
.
Application JSON
If the application is a single tenant application, ensure to define the artifact repository details insubscribableInfo
, under theartifactRepository
section, of the application JSON definition.
Example:"artifactRepository":{ "privateRepo":false, "repoUrl":"https://github.com/lakwarus/single-cartridge.git", "repoUsername":"", "repoPassword":"" }
By subscribing to an application you can deploy custom application artifacts in Private PaaS .
Application Sign Up JSON
Sign up to the application if the application is a multi-tenant application.For more information see, signing up to an application.
Step 6: Deploying WSO2 products on Private PaaS
Navigate to the application directory of the preferred WSO2 product.
cd <CARTRIDGE_HOME>/samples/applications/<SERVER_NAME>-<VERSION>-application/scripts/<IAAS>
Example:
cd <DAS3.0.0_CARTRIDGE_HOME>/samples/applications/wso2das-300-application/scripts/mock
Deploy the application.
./deploy.sh