Single data center deployment per workload type

A deployment scenario with a mixed workload cluster has only one data center for each type of workload.

In this scenario, a mixed workload cluster has only one data center for each type of workload. For example, if the cluster has 3 Hadoop nodes, 3 Cassandra nodes, and 2 Solr nodes, the cluster has 3 data centers, one for each type of workload. In contrast, a multiple data-center cluster has more than one data center for each type of workload.

In Cassandra, a data center can be a physical data center or virtual data center. Different workloads should use separate data centers, either physical or virtual. Using separate data centers prevents Cassandra transactions from being impacted by other workloads and keeps requests close to each other for lower latency. Replication is set by data center amd depending on the replication factor, data can be written to multiple data centers. However, data centers should never span physical locations. In a single data center deployment, data is replicated within its data center. For more information about replication:

Prerequisites

Procedure

This configuration example describes installing an 8 node cluster spanning 2 racks in a single data center. The default consistency level is QUORUM.

  1. Suppose the nodes have the following IPs and one node per rack will serve as a seed:
    • node0 110.82.155.0 (Cassandra seed)
    • node1 110.82.155.1 (Cassandra)
    • node2 110.82.155.2 (Cassandra)
    • node3 110.82.155.3 (Analytics seed)
    • node4 110.82.155.4 (Analytics)
    • node5 110.82.155.5 (Analytics)
    • node6 110.82.155.6 (Search - seed nodes are not required for Solr.)
    • node7 110.82.155.7 (Search)
  2. If the nodes are behind a firewall, open the required ports for internal/external communication. See Configuring firewall port access.
  3. If DataStax Enterprise is running, stop the nodes and clear the data:
    • Installer-Services and Package installations:
      $ sudo service dse stop
      $ sudo rm -rf /var/lib/cassandra/* ## Clears the data from the  default directories
    • Installer-No Services and Tarball installations:

      From the install directory:

      $ sudo bin/dse cassandra-stop
      $ sudo rm -rf /var/lib/cassandra/* ## Clears the data from the default directories
      Note: If you are clearing data from an AMI installation for restart, you need to preserve the log files.
  4. Set the properties in the cassandra.yaml file for each node, located in:
    • Installer-Services and Package installations: /etc/dse/cassandra/cassandra.yaml
    • Installer-No Services and Tarball installations: install_location/resources/cassandra/conf/cassandra.yaml
    Important: After making any changes in the cassandra.yaml file, you must restart the node for the changes to take effect.

    Properties to set:

    Note: If the nodes in the cluster are identical in terms of disk layout, shared libraries, and so on, you can use the same copy of the cassandra.yaml file on all of them.
    • num_tokens: 256 for Cassandra nodes
    • num_tokens: 1 for Hadoop and Solr nodes
    • -seeds: internal_IP_address of each seed node
    • listen_address: empty

      If not set, Cassandra asks the system for the local address, the one associated with its host name. In some cases Cassandra doesn't produce the correct address and you must specify the listen_address.

    • auto_bootstrap: false

      Add the bootstrap setting only when initializing a fresh cluster with no data.

    • endpoint_snitch: snitch

      For more information, see endpoint_snitch and About Snitches.

    • If you are using a cassandra.yaml from a previous version, remove the following options, as they are no longer supported by DataStax Enterprise:
      ## Replication strategy to use for the auth keyspace.
      auth_replication_strategy: org.apache.cassandra.locator.SimpleStrategy
      
      auth_replication_options:
          replication_factor: 1

    Example:

    cluster_name: 'MyDemoCluster'
    num_tokens: 256
    seed_provider:
      - class_name: org.apache.cassandra.locator.SimpleSeedProvider
        parameters:
             - seeds: "110.82.155.0,110.82.155.3"
    listen_address:
  5. In the cassandra-topology.properties or cassandra-rackdc.properties file, use your naming convention to assign data center and rack names to the IP addresses of each node, and assign a default data center name and rack name for unknown nodes.
    The location of these files depend on the type of install:
    • Installer-Services and Package installations: /etc/dse/cassandra
    • Installer-No Services and Tarball installations: install_location/resources/cassandra/conf

    Example:

    # Cassandra Node IP=Data Center:Rack
    110.82.155.0=DC_Cassandra:RAC1
    110.82.155.1=DC_Cassandra:RAC1
    110.82.155.2=DC_Cassandra:RAC1
    110.82.155.3=DC_Analytics:RAC1
    110.82.155.4=DC_Analytics:RAC1
    110.82.155.5=DC_Analytics:RAC1
    110.82.155.6=DC_Solr:RAC1
    110.82.155.7=DC_Solr:RAC1
    
    # default for unknown nodes
    default=DC1:RAC1
  6. After you have installed and configured DataStax Enterprise on all nodes, start the seed nodes one at a time, and then start the rest of the nodes:
    Note: If the node has restarted because of automatic restart, you must stop the node and clear the data directories, as described above.
  7. Check that your cluster is up and running:
    • Installer-Services and Package installations: $ nodetool status
    • Installer-No Services and Tarball installations: $ install_location/bin/nodetool status

Results

Datacenter: Cassandra
=======================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
-- Address         Load        Tokens    Owns    Host ID             Rack
UN 110.82.155.0    21.33 KB    256       33.3%   a9fa31c7-f3c0-...   RAC1
UN 110.82.155.1    21.33 KB    256       33.3%   f5bb416c-db51-...   RAC1
UN 110.82.155.2    21.33 KB    256       16.7%   b836748f-c94f-...   RAC1
Datacenter: Analytics
=======================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
-- Address         Load        Owns      Host ID               Tokens         Rack
UN 110.82.155.3    28.44 KB    13.0.%    e2451cdf-f070- ...    -922337....    RAC1
UN 110.82.155.4    44.47 KB    16.7%     f9fa427c-a2c5- ...    30745512...    RAC1 
UN 110.82.155.5    54.33 KB    23.6%     b9fc31c7-3bc0- ..-    45674488...    RAC1
Datacenter: Solr
=======================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
-- Address         Load        Owns      Host ID               Tokens         Rack
UN 110.82.155.6    15.44 KB    50.2.%    e2451cdf-f070- ...    9243578....    RAC1
UN 110.82.155.7    18.78 KB    49.8.%    e2451cdf-f070- ...    10000          RAC1