Cassandra datasource is used to set up a connection to a Cassandra storage. In WSO2 DAS, you can create a Cassandra data source through the UI as a custom data source. You can create a Cassandra datasource as a custom data source using the DAS management console as follows.
...
Enter the below Cassandra data source configuration for Configuration.
...
language | xml |
---|
...
datasource by specifying the datasource configuration in the <DAS_HOME>/repository/conf/datasources/ analytics-datasources.xml file as follows.
Code Block | ||
---|---|---|
| ||
<datasource> <name>WSO2_ANALYTICS_DS_CASSANDRA</name> <description>The Cassandra datasource used for analytics</description> <definition type="CASSANDRA"> <configuration> |
...
<contactPoints>localhost</contactPoints> |
...
<port>9042</port> <username>admin</username> <password>admin</password> |
...
<clusterName>cluster1</clusterName> <compression>NONE</compression> <poolingOptions> <coreConnectionsPerHost hostDistance="LOCAL">8</coreConnectionsPerHost> <maxSimultaneousRequestsPerHostThreshold hostDistance="LOCAL">1024</maxSimultaneousRequestsPerHostThreshold> </poolingOptions> <queryOptions> <fetchSize>5000</fetchSize> <consistencyLevel>ONE</consistencyLevel> <serialConsistencyLevel>SERIAL</serialConsistencyLevel> |
...
</queryOptions> <socketOptions> |
...
<keepAlive>false</keepAlive> |
...
<sendBufferSize>150000</sendBufferSize> |
...
<connectTimeoutMillis>12000</connectTimeoutMillis> |
...
<readTimeoutMillis>12000</readTimeoutMillis> |
...
Descriptions of the parameters in the above configurations are as follows.
...
The host IP addresses of Cassandra nodes in the clustered mode. Values should be given as comma separated values. For example:
...
Port of the Cassandra instance. In clustered mode, all ports are required to have the same value. For example: 9160
...
keySpace
...
Key space name for Cassandra. The default value is EVENT_KS
.
...
By default, this is set as false in all Cassandra datasources, to point to the Cassandra instance that is shipped with WSO2 DAS. If there is a port offset applied, Cassandra URL of the respective Cassandra data source will be updated accordingly.
...
readConsistencyLevel
...
Number of replicas, on which the write must succeed before returning an acknowledgement to the client application. Default value is QUORUM. For more information on this parameter, go to Apache Cassandra 1.0 Documentation.
...
</socketOptions>
</configuration>
</definition>
</datasource> |
Info |
---|
For information on the above properties, and other properties that you can specify in this datasource configuration, go to Java Driver 2.0 for Apache Cassandra Documentation. |