The cassandra utility

You can start Cassandra 3.0 and 3.1 by adding them to the cassandra-env.sh file (package or tarball installations) or entering them at the command line in tarball installations.

You can run Cassandra 3.0 with start-up parameters by adding them to the cassandra-env.sh file (package or tarball installations). You can also enter parameters at the command line when starting up tarball installations.

The location of the cassandra.yaml file depends on the type of installation:
DataStax Enterprise 5.0 Installer-Services and package installations /etc/dse/cassandra/cassandra.yaml
DataStax Enterprise 5.0 Installer-No Services and tarball installations install_location/resources/cassandra/conf/cassandra.yaml
Cassandra package installations /etc/cassandra/cassandra.yaml
Cassandra tarball installations install_location/resources/cassandra/conf/cassandra.yaml

Usage 

Add a parameter to the cassandra-env.sh file as follows:
JVM_OPTS="$JVM_OPTS -D[PARAMETER]"
The location of the cassandra-env.sh file depends on the type of installation:
DataStax Enterprise 5.0 Installer-Services and package installations /etc/dse/cassandra/cassandra-env.sh
DataStax Enterprise 5.0 Installer-No Services and tarball installations install_location/resources/cassandra/conf/cassandra-env.sh
Cassandra package installations /etc/cassandra/cassandra-env.sh
Cassandra tarball installations install_location/conf/cassandra-env.sh
The location of the jvm.options file depends on the type of installation:
DataStax Enterprise 5.0 Installer-Services and package installations /etc/dse/cassandra/jvm.options
DataStax Enterprise 5.0 Installer-No Services and tarball installations install_location/resources/cassandra/conf/jvm.options
Cassandra package installations /etc/cassandra/jvm.options
Cassandra tarball installations install_location/conf/jvm.options
When starting up a tarball installations, you can add parameters at the command line:
cassandra [PARAMETERS]
Examples:
  • Command line: $ bin/cassandra -Dcassandra.load_ring_state=false
  • cassandra-env.sh: JVM_OPTS="$JVM_OPTS -Dcassandra.load_ring_state=false"

The Example section contains more examples.

Command line only options 

Option Description
-f Start the cassandra process in foreground. The default is to start as background process.
-h Help.
-p filename Log the process ID in the named file. Useful for stopping Cassandra by killing its PID.
-v Print the version and exit.

Start-up parameters 

The -D option specifies start-up parameters at the command line and in the cassandra-env.sh file.
cassandra.auto_bootstrap=false 
Sets auto_bootstrap to false on initial set-up of the cluster. The next time you start the cluster, you do not need to change the cassandra.yaml file on each node to revert to true.
cassandra.available_processors=number_of_processors  
In a multi-instance deployment, each Cassandra instance independently assumes that all CPU processors are available to it. Use this setting to specify a smaller set of processors.
cassandra.boot_without_jna=true 
Configures Cassandra to boot without JNA. If you do not set this parameter to true, and JNA does not initalize, Cassandra does not boot.
cassandra.config=directory  
Sets the directory location of the cassandra.yaml file. The default location depends on the type of installation.
cassandra.expiration_date_overflow_policy=POLICY 
Set the policy for TTL (time to live) timestamps that exceed the maximum value supported by the storage engine, 2038-01-19T03:14:06+00:00. The database storage engine can only encode TTL timestamps through January 19 2038 03:14:07 UTC due to the Year 2038 problem.
  • REJECT: Reject requests that contain an expiration timestamp later than 2038-01-19T03:14:06+00:00.
  • CAP: Allow requests and insert expiration timestamps later than 2038-01-19T03:14:06+00:00 as 2038-01-19T03:14:06+00:00.

Default: REJECT.

cassandra.ignore_dynamic_snitch_severity=true|false (Default: false)  
Setting this property to true causes the dynamic snitch to ignore the severity indicator from gossip when scoring nodes. Severity is a numeric representation of a node based on compaction events occurring on it, which it broadcasts via gossip. This factors into the dynamic snitch's formula, unless overridden.
Future versions will default to true and this setting will be removed. See Failure detection and recoveryand Dynamic snitching in Cassandra: past, present, and future.
cassandra.initial_token=token  
Use when Cassandra is not using virtual nodes (vnodes). Sets the initial partitioner token for a node the first time the node is started. (Default: disabled)
Note: Vnodes automatically select tokens.
cassandra.join_ring=true|false  
When set to false, prevents the Cassandra node from joining a ring on startup. (Default: true) You can add the node to the ring afterwards using nodetool join and a JMX call.
cassandra.load_ring_state=true|false 
When set to false, clears all gossip state for the node on restart. (Default: true)
cassandra.metricsReporterConfigFile=file  
Enables pluggable metrics reporter. See Pluggable metrics reporting in Cassandra 2.0.2.
cassandra.native_transport_startup_delay_second=seconds 
Delays the startup of native transport for the number of seconds. (Default: 0)
cassandra.native_transport_port=port 
Sets the port on which the CQL native transport listens for clients. (Default: 9042)
cassandra.partitioner=partitioner  
Sets the partitioner. (Default: org.apache.cassandra.dht.Murmur3Partitioner)
cassandra.replace_address=listen_address or broadcast_address of dead node 
To replace a node that has died, restart a new node in its place specifying the listen_address or broadcast_address that the new node is assuming. The new node must be in the same state as before bootstrapping, without any data in its data directory.
Note: The broadcast_address defaults to the listen_address except when the ring is using the Ec2MultiRegionSnitch.
cassandra.replayList=table  
Allows restoring specific tables from an archived commit log.
cassandra.ring_delay_ms=ms  
Defines the amount of time a node waits to hear from other nodes before formally joining the ring. (Default: 30000ms)
cassandra.rpc_port=port  
Sets the port for the Thrift RPC service, which is used for client connections. (Default: 9160).
cassandra.ssl_storage_port=port  
Sets the SSL port for encrypted communication. (Default: 7001)
cassandra.start_native_transport=true | false  
Enables or disables the native transport server. See start_native_transport in cassandra.yaml. (Default: true)
cassandra.start_rpc=true | false 
Enables or disables the Thrift RPC server. (Default: true)
cassandra.storage_port=port  
Sets the port for inter-node communication. (Default: 7000)
cassandra.triggers_dir=directory  
Sets the default location for the triggers JARs.
The location of the triggers directory depends on the type of installation:
DataStax Enterprise 5.0 Installer-Services and package installations /etc/dse/cassandra/triggers
DataStax Enterprise 5.0 Installer-No Services and tarball installations install_location/resources/cassandra/conf/triggers
Cassandra package installations /etc/cassandra/triggers
Cassandra tarball installations install_location/conf/triggers
cassandra.write_survey=true 
Enables a tool for testing new compaction and compression strategies to experiment with different strategies and benchmark write performance differences without affecting the production workload. See Testing compaction and compression.
consistent.rangemovement=true 
Set to true, makes bootstrapping behavior effective.

Advanced parameters 

DataStax Enterprise provides the following parameters for DSE Authenticator LDAP connections.
dse.ldap.connection.timeout.ms
The number of milliseconds before the connection timesout.
dse.ldap.pool.min.idle
Finer control over the connection pool for DataStax Enterprise LDAP authentication connector. The min idle settings determines the minimum number of connections allowed in the pool before the evictor thread will create new connections. This setting has no effect if the evictor thread isn't configured to run.
dse.ldap.pool.exhausted.action
Determines what the pool does when it is full. It can be one of:
  • fail - the pool with throw an exception
  • block - the pool will block for max wait ms (default)
  • grow - the pool will just keep growing (not recommended)
dse.ldap.pool.max.wait
When the dse.ldap.pool.exhausted.action is block, sets the number of milliseconds to block the pool before throwing an exception.
dse.ldap.pool.test.borrow
Tests a connection when it is borrowed from the pool.
dse.ldap.pool.test.return
Tests a connection returned to the pool.
dse.ldap.pool.test.idle
Tests any connections in the eviction loop that are not being evicted. Only works if the time between eviction runs is greater than 0ms.
dse.ldap.pool.time.between.evictions
Determines the time in ms (milliseconds) between eviction runs. When run with the dse.ldap.pool.test.idle this becomes a basic keep alive for connections.
dse.ldap.pool.num.tests.per.eviction
Number of connections in the pool that are tested each connection run. If this is set the same as max active (the pool size) then all connections will be tested each eviction run.
dse.ldap.pool.min.evictable.idle.time.ms
Determines the minimum time in ms (milliseconds) that a connection can sit in the pool before it becomes available for eviction.
dse.ldap.pool.soft.min.evictable.idle.time.ms
Determines the minimum time in ms (milliseconds) that a connection can sit the pool before it becomes available for eviction with the proviso that the number of connections doesn't fall below dse.ldap.pool.min.evictable.idle.time.ms.
Tip: You can also add options such as maximum and minimum heap size to the cassandra-env.sh file to pass them to the Java virtual machine at startup, rather than setting them in the environment.

Example

Clearing gossip state when starting a node:
  • Command line: $ bin/cassandra -Dcassandra.load_ring_state=false
  • cassandra-env.sh: JVM_OPTS="$JVM_OPTS -Dcassandra.load_ring_state=false"

Example

Starting a Cassandra node without joining the ring:
  • Command line: bin/dse cassandra -Dcassandra.join_ring=false #Starts DataStax Enterprise
  • cassandra-env.sh: JVM_OPTS="$JVM_OPTS -Dcassandra.join_ring=false"

Example

Replacing a dead node:
  • Command line:
    bin/dse cassandra -Dcassandra.replace_address=10.91.176.160 #Starts DataStax Enterprise
  • cassandra-env.sh: JVM_OPTS="$JVM_OPTS -Dcassandra.replace_address=10.91.176.160"