Connecting to External Cassandra
Follow the below steps to connect WSO2 BAM to an external Cassandra server/cluster.
Do the following changes in the datasources with the type CASSANDRA in the
<BAM_HOME>/repository/conf/datasources/bam_datasources.xml
file to point to the external Cassandra server/cluster. (According to the default configurations, datasources need to be changed areWSO2BAM_CASSANDRA_EVENT_INDEX_SOURCE
,WSO2BAM_CASSANDRA_DATASOURCE
,WSO2BAM_UTIL_DATASOURCE
,WSO2BAM_HIVE_INCREMENTAL_DATASOURCE
)- Set the
externalCassandra
property to true within theconfiguration
element as follows.
<externalCassandra>true</externalCassandra>
- Change the
hosts
,port
,username
, andpassword
 properties  accordingly.
- Set the
In the
<BAM_HOME>/repository/conf/etc/hector-config.xml
file set theexternalCassandra
property to true, and change the Cassandra host name and ports accordingly as shown below.<Nodes externalCassandra="true">host:port</Nodes>
Change the following properties in the
<BAM_HOME>/repository/conf/advanced/hive-site.xml
file.ÂChange the below properties if you are using the incremental data processing and notification task features.
<property> <name>hive.incremental.processing.intermediate.results.cassandra.hosts</name> <value>localhost:9160</value> </property> <property> <name>hive.incremental.processing.intermediate.results.cassandra.userName</name> <value>admin</value> </property> <property> <name>hive.incremental.processing.intermediate.results.cassandra.password</name> <value>admin</value> </property> <!-- Credentials for WSO2BAM_UTILS_KS --> <property> <name>notification.task.receiver.username</name> <value>admin</value> </property> <property> <name>notification.task.receiver.password</name> <value>admin</value> </property>
- To stop running Cassandra, which is bundled with BAM by default, execute the following command (on Linux) when starting the server:Â
sh wso2server.sh -Ddisable.cassandra.server.startup=true