Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

WSO2 recommends the following on an actual, production deployment:

  • Using anexternal server or cluster such as Cassandra Server or Cassandra clusterZookeeper.
  • Have the Cassandra external server on a separate machine or a dedicated VM instance and point to it from the Message Broker.

This section provides instructions to install, setup and point an external Cassandra server to a standalone WSO2 Message Broker instance.

Installation Prerequisites

Cassandra requires the most stable version of Java 1.6 for Sun JVM. (u19 or higher is recommended). For instructions on installing Java, refer to

Download Cassandra Kit

Edit Configuration Files

Cassandra configuration files can be found in $CARBON_HOME /repository/conf/etc directory of binary and source distributions.  If you have installed Cassandra from RPM packages, configuration files will be placed into /etc/cassandra/conf. Cassandra configurations can be done in the following files.

Edit cassandra.yaml

The default cassandra.yaml contains reasonable settings for single node operation. There are few settings that need to be verified:

  • Ensure that the paths exist for data_file_directoriescommitlog_directory, and saved_caches_directory.   
  • Verify storage_port and rpc_port do not conflict with other services on your computer.  By default, Cassandra uses 7000 for storage_port, and 9160 for rpc_port. The storage_port must be identical between Cassandra nodes in a cluster. Cassandra client applications use rpc_port to connect to Cassandra.   
  • It is recommended to change the default cluster_name to avoid conflicts with existing clusters.
  • initial_token can be left blank, but setting to 0 is recommended if you are configuring your first node.

Edit log4j-server.properties

$CARBON_HOME /repository/conf/log4j.properties file contains a path for the log file as required.

Code Block
# Edit the next line to point to your logs directory
log4j.appender.R.File=/var/log/cassandra/system.log

Edit cassandra-env.sh

By default, Cassandra allocates memory based on the physical memory capacity of your system.    For example, it will allocate 1GB heap on 2GB system, and 2GB heap on 8GB system. To specify Cassandra heap size, remove leading pound sign(#) on the following lines and specify memory size for them.

...

Info
titleNote

It is not recommended to start production services with small heap configurations.

Start Cassandra

Cassandra can be started by invoking bin/cassandra -f from the command line. The -f option enures that the service starts in the foreground and logs gratuitously to standard-out. If there are no messages with "errors", or words such as  "fatal" or that look like a Java stack traces, then you've succeeded. After starting the Cassandra server, it starts listening for thrift clients as follows.

...

Press "Control-C" to stop Cassandra.   If you start up Cassandra without "-f" option, it runs in the background, which requires killing the process to stop.

Instruct WSO2 MB to Use External Cassandra Server

Edit $CARBON_HOME/repository/conf/advanced/qpid-config.xml file to instruct WSO2 server to use external Cassandra Server.

Code Block
languagehtml/xml
<clustering>
    <enabled>false</enabled>       
    <OnceInOrderSupportEnabled>false</OnceInOrderSupportEnabled>
    <!--Are we running an External Cassandra server ? true|false-->
    <externalCassandraServerRequired>true</externalCassandraServerRequired>
    <!--Are we running an External Zookeeper server ? true|false -->
    <!--externalZookeeperServerRequired>false</externalZookeeperServerRequired-->

Point WSO2 MB to Cassandra

Edit $CARBON_HOME/repository/conf/advanced/qpid-virtualhosts.xml file to point to Cassandra server setup.

...