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:
- WSO2 Application Server - "ApplicationServer"
- WSO2 Business Activity Monitor - "BusinessActivityMonitor"
- WSO2 Business Process Server - "BusinessProcessServer"
- WSO2 Business Rules Server - "BusinessRulesServer"
- WSO2 Data Services Server - "DataServicesServer"
- WSO2 Enterprise Service Bus - "EnterpriseServiceBus"
- WSO2 Gadget Server - "GadgetServer"
- WSO2 Governance Registry - "GovernanceRegistry"
- WSO2 Identity Server - "IdentityServer"
- WSO2 Mashup Server - "MashupServer"
The following is an example list of C-App resources that map to default server roles.
- ApplicationServer -
foo.aar, jax-wx.war
- EnterpriseServiceBus -
proxy.xml
- BusinessProcessServer -
my_bpel.zip
- JaggeryServer -
jaggery_app.jag
In C-App development time, you can specify a server role for each and every artifact in the C-App. For example, say you are developing an Axis2 service and planning to deploy all your services in a single Application Server instance in the production setup. You can set the server role as appserver1
.
Info | ||
---|---|---|
| ||
Server roles manager is a component to manage the server roles property for WSO2 Carbon based products. Due to the functionality of the server roles manager, users do not have to manually modify the In the server roles manager, the
|
The following methods can be used to set the ServerRole: Table of Contents maxLevel 3 minLevel 3
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:
- Log in to the management console of your product and click Server Roles menu under the Configure menu.
- 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.
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,
Code Block |
---|
<ServerRoles> <Role>DataServicesServer</Role> </ServerRoles> |
You can set multiple role elements here to specify the roles acted by the current server. For example, if you want this server to act as appserver1 and dataservices1 servers, configuration is as follows:
Code Block |
---|
<ServerRoles> <Role>appserver1</Role> <Role>dataservices1</Role> </ServerRoles> |
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,
Code Block |
---|
sh wso2server.sh -DserverRoles=appserver1,dataservices1 |
Info |
---|
Once you use the management console to set server roles, you can't change that configuration using the other two methods. Server roles are stored in the Registry when they are configured through the management console. Values in the Registry are always given priority over others. |