When using WSO2 MB, there are a few main things to be considered regarding deployment.
Every node where WSO2 MB is deployed (including Cassandra and ZooKeeper server nodes) must be time synced. If not, there can be situations where MB may malfunction, so this is highly recommended.
The following administrator permissions are required:
$sudo apt-get install ntpdate; $ntpdate pool.ntp.org
You need to allocate enough memory for the MB server. By default, it is set to 1 GB in the
<MB_HOME>/bin/wso2server.sh
file (for Windows, it is the wso2server.bat file)-Xms256m -Xmx1024m -XX:MaxPermSize=256m
Generally, at least 2 GB memory is recommended for production instances.
If you want to deploy WSO2 MB as a cluster, enable clustering editing in the
<MB_HOME>/repository/conf/advanced/andes-config.xml
file as follows:<clustering> <enabled>true</enabled>
- Even if the Cassandra server is shipped embedded into WSO2 MB, it is always recommended to run a Cassandra profile as a separate server instance and point WSO2 MB to that external instance.
To point WSO2 MB to an externally running Cassandra server, the following configs are used:
Edit the
<MB_HOME>/repository/conf/advanced/andes-config.xml
file as follows:<clustering> <externalCassandraServerRequired>true</externalCassandraServerRequired>
Edit the
<MB_HOME>/repository/conf/advanced/andes-virtualhosts.xml
file. You have to edit the section relevant to the virualhost that you are using. By default, this virtualhost is carbon. So we edit the <store> section under that virtualhost. Use the correct username and password to connect to the Cassandra server.
For example, if your cassandra server is running with an IP of 192.168.10.3 and the user name and password is admin/admin, then the virtual host configuration should be as follows:<store> <class>org.wso2.andes.server.store.CassandraMessageStore</class> <username>admin</username> <password>admin</password> <cluster>ClusterOne</cluster> <idGenerator>org.wso2.andes.server.cluster.coordination.TimeStampBasedMessageIdGenerator</idGenerator> <connectionString>192.168.10.3:9160</connectionString>
- Even if WSO2 MB is packed including the Zookeeper server, if you are deploying the product as a cluster it is recommended to use a Zookeeper profile server. The relevant configurations are as follows:
In the andes-config.xml file
<externalZookeeperServerRequired>true</externalZookeeperServerRequired> <coordination> <!-- Apache Zookeeper Address --> <ZooKeeperConnection>127.0.0.1:2181</ZooKeeperConnection> <!-- Format yyyy-MM-dd HH:mm:ss --> <ReferenceTime>2012-02-29 08:08:08</ReferenceTime> </coordination>
- There are SASL security configurations needed in order to communicate with the server. For more information, see Setting up Zookeeper Server to Accept SASL Connections.