Jump to: navigation, search

Generic Cassandra Configuration

Configure the Java heap size

DevGuide2.png Purpose: To configure the size of the Java heap for Cassandra.

Start

  1. Navigate to your installation directory for the Backend Server and open the launcher.xml file with a text editor.
  2. The default values for the Java heap size are stored in the jvm_option2 and jvm_option3 parameters:
            <parameter name="jvm_option2" displayName="jvm_option1" mandatory="true" hidden="true" readOnly="true">
                <format type="string" default="-Xms512m"/>
    ...
            </parameter>
            <parameter name="jvm_option3" displayName="jvm_option2" mandatory="true" hidden="true" readOnly="true">
                <format type="string" default="-Xmx1024m"/>
                <validation></validation>
    ...
            </parameter>
    ...

    Modify the default value in the format element of these parameters according to your hardware configuration. As a rule, the value should be a maximum of 8GB or half your total RAM, whichever is lower; however; Genesys recommends 3GB or more for a production site. Cassandra's default configuration opens the JVM with a heap size that is based on the total amount of system memory:

    System Memory Heap Size
    Less than 2GB 1/2 of system memory
    2GB to 4GB 1GB
    Greater than 4GB 1/2 system memory, but not more than 4GB

    Genesys recommends you set the default value in the format element for both parameters to the same value. For example:

            <parameter name="jvm_option2" displayName="jvm_option1" mandatory="true" hidden="true" readOnly="true">
                <format type="string" default="-Xms3072m"/>
    ...
            </parameter>
            <parameter name="jvm_option3" displayName="jvm_option2" mandatory="true" hidden="true" readOnly="true">
                <format type="string" default="-Xmx3072m"/>
                <validation></validation>
    ...
            </parameter>
    ...

    Consult the Cassandra documentation at http://www.datastax.com/docs/1.0/index for more information about Cassandra clusters and memory.

End

Next Steps
Resultset next.png Configure Local Properties

Configure Local Properties

DevGuide2.png Purpose: To configure Cassandra for the Backend Server.

Prerequisites

Start

  1. To configure Cassandra, navigate to the Web Engagement installation directory and edit the \apps\<application name>\environment\environment.local.properties file.
    • The values specified in environment.local.properties are inserted into the cassandra.yaml and wmbackend.properties files during the application build step. All configuration parameters for Cassandra in environment.local.properties start with wmdb.cassandra.cluster. The parameters and their default values:
      # WMDB-Cassandra
      # Tokens in cassandra.yaml and wmbackend.properties files will be substituted by these parameter values. 
      wmdb.cassandra.cluster.name=Cluster
      wmdb.cassandra.cluster.keyspaceName=WebMonitoring
      wmdb.cassandra.cluster.defaultStrategy=SimpleStrategy
      wmdb.cassandra.cluster.defaultReplicationFactor=1
      wmdb.cassandra.cluster.listenAddress=localhost
      wmdb.cassandra.cluster.rpcAddress=localhost
      wmdb.cassandra.cluster.rpcPort=19160
      wmdb.cassandra.cluster.sslStoragePort=17001
      wmdb.cassandra.cluster.storagePort=17000
      wmdb.cassandra.cluster.seedNodes=127.0.0.1
      wmdb.cassandra.cluster.dataDirectory=DATA_DIR_PLACEHOLDER
      wmdb.cassandra.cluster.commitLogDirectory=COMMITLOG_DIR_PLACEHOLDER
      wmdb.cassandra.cluster.savedCachesDirectory=SAVED_CACHES_DIR_PLACEHOLDER
    • Read Node and Cluster Configuration (cassandra.yaml) for information on all Cassandra configuration parameters.
      Note: Making changes in the environment.local.properties file will keep the client and server connection parameters synchronized.
  2. Update the Cassandra configuration parameters with values appropriate for your deployment. You will need to modify the following parameters:
    • wmdb.cassandra.cluster.defaultReplicationFactor — The keyspace replication factor. When choosing a replication factor value, take into account that Cassandra uses consistency level QUORUM for both writes and reads. The recommended formula for the replication factor is <number_of_nodes> / 2 + 1. Consider the following examples when determining your replication factor:
      Number of nodes in the cluster Consistency level Replication factor Result
      4 QUORUM 1 1 node will contain unique information.
      4 QUORUM 3 3 nodes will contain the duplicated information; the information is written to all nodes directly.
      4 QUORUM 4 3 nodes will contain the duplicated information; the information is written to all nodes directly. One node will contain information replicas in the background.
    • wmdb.cassandra.cluster.defaultStrategy — The default value is SimpleStrategy, but if you plan to deploy the cluster across multiple data centers, consider using the NetworkTopologyStrategy.
    • wmdb.cassandra.cluster.seedNodes — Choose your seed nodes, keeping in mind that if you plan to deploy the Cassandra cluster across multiple data centers, you should have at least one seed node from each data center. Set the value of wmdb.cassandra.cluster.seedNodes to a comma-separated list of the IPs for your seed nodes. For example, 135.225.54.236, 135.225.54.245.
    • listen_address and rpc_address — These parameters are likely to be different for each Backend Server / Cassandra node in the cluster and must be set directly in the \servers\backend\etc\cassandra.yaml file for each Backend Server. See Configure Cassandra Cluster for details on setting these parameters.
  3. Save your changes.


End

Next Steps
Resultset next.png Enable data compression on the Cassandra cluster

Enable data compression on the Cassandra cluster

DevGuide2.png Purpose: To enable data compression on the Cassandra cluster. After you apply the script in this procedure, Cassandra will use the compression chunk length of 64kb.

Important
Although Cassandra is embedded in Genesys Web Engagement, you must follow the steps in this procedure to download and install a separate instance of Cassandra in order to get the tools needed to enable data compression.

Start

  1. Download Cassandra.
    1. Go to http://cassandra.apache.org/download/, find the correct version of Cassandra, and download the archive. Genesys Web Engagement 8.1.1 uses Cassandra 1.0.6, so you should download apache-cassandra-1.0.6-bin.tar.gz.
    2. Extract the files to a directory; for example, C:\cassandra. This directory will be referred to as %CASSANDRA_HOME% in the steps below.
  2. Save the following script in a text file; for example, compression_script.txt.
    // enable compression
    use WebMonitoring;
    update column family visits with compression_options={sstable_compression:DeflateCompressor,chunk_length_kb:64};
    update column family userAgents with compression_options={sstable_compression:DeflateCompressor,chunk_length_kb:64};
    update column family sessions with compression_options={sstable_compression:DeflateCompressor,chunk_length_kb:64};
    update column family pages with compression_options={sstable_compression:DeflateCompressor,chunk_length_kb:64};
    update column family ixnProfiles with compression_options={sstable_compression:DeflateCompressor,chunk_length_kb:64};
    update column family indexesByString with compression_options={sstable_compression:DeflateCompressor,chunk_length_kb:64};
    update column family identities with compression_options={sstable_compression:DeflateCompressor,chunk_length_kb:64};
    update column family events with compression_options={sstable_compression:DeflateCompressor,chunk_length_kb:64};
    update column family engagementAttempts with compression_options={sstable_compression:DeflateCompressor,chunk_length_kb:64};
  3. Apply the script to the seed_provider_node by running the following command inside the %CASSANDRA_HOME%/bin directory:
    >cassandra-cli.bat -h <seed_provider_node_ip_address> -p 19160 -f <path_to_script_file>

    For example:

    >cassandra-cli.bat -h 135.225.54.236 -p 19160 -f C:\compression_script.txt
  4. The existing SSTables are compressed when the normal Cassandra compaction process occurs. You can force Cassandra to rewrite and compress the existing SSTables with the following:
    nodetool upgradesstables

End

You can disable compression with the following script:

// disable compression
use WebMonitoring;
update column family visits with compression_options=null;
update column family userAgents with compression_options=null;
update column family sessions with compression_options=null;
update column family pages with compression_options=null;
update column family ixnProfiles with compression_options=null;
update column family indexesByString with compression_options=null;
update column family identities with compression_options=null;
update column family events with compression_options=null;
update column family engagementAttempts with compression_options=null;

Next Steps
Resultset next.png Back to Task Table

This page was last edited on July 17, 2020, at 15:48.
Comments or questions about this documentation? Contact us for support!