Versions Compared

Key

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

...

A single C-App can consist of artifacts that are deployable in various different products. Therefore, when you deploy a C-App in a particular WSO2 product, all its artifacts might not be deployed in that particular product instance. To sort out which can be deployed in which, the ServerRole property is used.

Adding the ServerRole property

A server role is a parameter that is mentioned in <PRODUCT_HOME>/repository/conf/carbon.xml file of all WSO2 products. When a C-App is being deployed, it reads the ServerRoles property from the carbon.xml and deploys only the resources that match the server-role value in the file. Each product has a different default ServerRoles property as follows:

...

The following methods can be used to set the ServerRole:

Table of Contents
maxLevel4
minLevel4

Using the management console to set the ServerRole property

This is the easiest and the most recommended way to configure your server roles.   Follow the instructions below to add a new server role:

  1. Log in to the management console of your product and  click Server Roles menu under the Configure menu.  

  2. Click Add New Server Role    enter the Role Name and click Add You can add any textual name as a server role without special characters except underscore.
     
     
  3. The newly added server role is displayed in the server roles list. 
     
     You can delete the server role using the Deleteicon associated with it.

    Info

    You cannot undo a deletion once performed. Users can even delete a default server role. Once deleted, the server role manager will not pick up the deleted server role from the carbon.xml file, next time the server starts.

Using carbon.xml file to set the ServerRole property

Find the ServerRoles element in <PRODUCT_HOME>/repository/conf/carbon.xml file. For example,

...

Before setting the above, ensure that the current server has capability to deploy Axis2 services and data services. When you deploy a C-App artifact on this server, all artifacts which have the above two server roles will be deployed on the current instance. Others will be ignored.

Using a system property to set the ServerRole property

You can use the system property ServerRoles to specify the server roles that can be acted by the current product instance. When you start the server, pass the server roles as a comma separated list. For example,

...