blob: 023a70f277c1037c02bfee46ca3ae8566c929016 [file] [log] [blame]
---
layout: docpage
title: "Documentation"
is_homepage: false
is_sphinx_doc: true
doc-parent: "Configuring Cassandra"
doc-title: "cassandra-env.sh file"
doc-header-links: '
<link rel="top" title="Apache Cassandra Documentation v4.0-beta4" href="../index.html"/>
<link rel="up" title="Configuring Cassandra" href="index.html"/>
<link rel="next" title="cassandra-topologies.properties file" href="cass_topo_file.html"/>
<link rel="prev" title="cassandra-rackdc.properties file" href="cass_rackdc_file.html"/>
'
doc-search-path: "../search.html"
extra-footer: '
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: "",
VERSION: "",
COLLAPSE_INDEX: false,
FILE_SUFFIX: ".html",
HAS_SOURCE: false,
SOURCELINK_SUFFIX: ".txt"
};
</script>
'
---
<div class="container-fluid">
<div class="row">
<div class="col-md-3">
<div class="doc-navigation">
<div class="doc-menu" role="navigation">
<div class="navbar-header">
<button type="button" class="pull-left navbar-toggle" data-toggle="collapse" data-target=".sidebar-navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="navbar-collapse collapse sidebar-navbar-collapse">
<form id="doc-search-form" class="navbar-form" action="../search.html" method="get" role="search">
<div class="form-group">
<input type="text" size="30" class="form-control input-sm" name="q" placeholder="Search docs">
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</div>
</form>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../getting_started/index.html">Getting Started</a></li>
<li class="toctree-l1"><a class="reference internal" href="../new/index.html">New Features in Apache Cassandra 4.0</a></li>
<li class="toctree-l1"><a class="reference internal" href="../architecture/index.html">Architecture</a></li>
<li class="toctree-l1"><a class="reference internal" href="../cql/index.html">The Cassandra Query Language (CQL)</a></li>
<li class="toctree-l1"><a class="reference internal" href="../data_modeling/index.html">Data Modeling</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="index.html">Configuring Cassandra</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="cass_yaml_file.html">cassandra.yaml file configuration</a></li>
<li class="toctree-l2"><a class="reference internal" href="cass_rackdc_file.html">cassandra-rackdc.properties file</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">cassandra-env.sh file</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#cassandra-auto-bootstrap-false"><code class="docutils literal notranslate"><span class="pre">cassandra.auto_bootstrap=false</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#cassandra-available-processors-number-of-processors"><code class="docutils literal notranslate"><span class="pre">cassandra.available_processors=&lt;number_of_processors&gt;</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#cassandra-boot-without-jna-true"><code class="docutils literal notranslate"><span class="pre">cassandra.boot_without_jna=true</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#cassandra-config-directory"><code class="docutils literal notranslate"><span class="pre">cassandra.config=&lt;directory&gt;</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#cassandra-ignore-dynamic-snitch-severity-true-false"><code class="docutils literal notranslate"><span class="pre">cassandra.ignore_dynamic_snitch_severity=true|false</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#cassandra-initial-token-token"><code class="docutils literal notranslate"><span class="pre">cassandra.initial_token=&lt;token&gt;</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#cassandra-join-ring-true-false"><code class="docutils literal notranslate"><span class="pre">cassandra.join_ring=true|false</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#cassandra-load-ring-state-true-false"><code class="docutils literal notranslate"><span class="pre">cassandra.load_ring_state=true|false</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#cassandra-metricsreporterconfigfile-filename"><code class="docutils literal notranslate"><span class="pre">cassandra.metricsReporterConfigFile=&lt;filename&gt;</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#cassandra-partitioner-partitioner"><code class="docutils literal notranslate"><span class="pre">cassandra.partitioner=&lt;partitioner&gt;</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#cassandra-prepared-statements-cache-size-in-bytes-cache-size"><code class="docutils literal notranslate"><span class="pre">cassandra.prepared_statements_cache_size_in_bytes=&lt;cache_size&gt;</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#cassandra-replace-address-listen-address-of-dead-node-broadcast-address-of-dead-node"><code class="docutils literal notranslate"><span class="pre">cassandra.replace_address=&lt;listen_address</span> <span class="pre">of</span> <span class="pre">dead</span> <span class="pre">node&gt;|&lt;broadcast_address</span> <span class="pre">of</span> <span class="pre">dead</span> <span class="pre">node&gt;</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#cassandra-replaylist-table"><code class="docutils literal notranslate"><span class="pre">cassandra.replayList=&lt;table&gt;</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#cassandra-ring-delay-ms-number-of-ms"><code class="docutils literal notranslate"><span class="pre">cassandra.ring_delay_ms=&lt;number_of_ms&gt;</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#cassandra-native-transport-port-port"><code class="docutils literal notranslate"><span class="pre">cassandra.native_transport_port=&lt;port&gt;</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#cassandra-rpc-port-port"><code class="docutils literal notranslate"><span class="pre">cassandra.rpc_port=&lt;port&gt;</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#cassandra-storage-port-port"><code class="docutils literal notranslate"><span class="pre">cassandra.storage_port=&lt;port&gt;</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#cassandra-ssl-storage-port-port"><code class="docutils literal notranslate"><span class="pre">cassandra.ssl_storage_port=&lt;port&gt;</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#cassandra-start-native-transport-true-false"><code class="docutils literal notranslate"><span class="pre">cassandra.start_native_transport=true|false</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#cassandra-start-rpc-true-false"><code class="docutils literal notranslate"><span class="pre">cassandra.start_rpc=true|false</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#cassandra-triggers-dir-directory"><code class="docutils literal notranslate"><span class="pre">cassandra.triggers_dir=&lt;directory&gt;</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#cassandra-write-survey-true"><code class="docutils literal notranslate"><span class="pre">cassandra.write_survey=true</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="#consistent-rangemovement-true-false"><code class="docutils literal notranslate"><span class="pre">consistent.rangemovement=true|false</span></code></a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="cass_topo_file.html">cassandra-topologies.properties file</a></li>
<li class="toctree-l2"><a class="reference internal" href="cass_cl_archive_file.html">commitlog-archiving.properties file</a></li>
<li class="toctree-l2"><a class="reference internal" href="cass_logback_xml_file.html">logback.xml file</a></li>
<li class="toctree-l2"><a class="reference internal" href="cass_jvm_options_file.html">jvm-* files</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../operating/index.html">Operating Cassandra</a></li>
<li class="toctree-l1"><a class="reference internal" href="../tools/index.html">Cassandra Tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="../troubleshooting/index.html">Troubleshooting</a></li>
<li class="toctree-l1"><a class="reference internal" href="../development/index.html">Contributing to Cassandra</a></li>
<li class="toctree-l1"><a class="reference internal" href="../faq/index.html">Frequently Asked Questions</a></li>
<li class="toctree-l1"><a class="reference internal" href="../plugins/index.html">Third-Party Plugins</a></li>
<li class="toctree-l1"><a class="reference internal" href="../bugs.html">Reporting Bugs</a></li>
<li class="toctree-l1"><a class="reference internal" href="../contactus.html">Contact us</a></li>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
</div>
<div class="col-md-8">
<div class="content doc-content">
<div class="content-container">
<div class="section" id="cassandra-env-sh-file">
<span id="cassandra-envsh"></span><h1>cassandra-env.sh file<a class="headerlink" href="#cassandra-env-sh-file" title="Permalink to this headline"></a></h1>
<p>The <code class="docutils literal notranslate"><span class="pre">cassandra-env.sh</span></code> bash script file can be used to pass additional options to the Java virtual machine (JVM), such as maximum and minimum heap size, rather than setting them in the environment. If the JVM settings are static and do not need to be computed from the node characteristics, the <a class="reference internal" href="cass_jvm_options_file.html#cassandra-jvm-options"><span class="std std-ref">jvm-* files</span></a> files should be used instead. For example, commonly computed values are the heap sizes, using the system values.</p>
<p>For example, add <code class="docutils literal notranslate"><span class="pre">JVM_OPTS=&quot;$JVM_OPTS</span> <span class="pre">-Dcassandra.load_ring_state=false&quot;</span></code> to the <code class="docutils literal notranslate"><span class="pre">cassandra_env.sh</span></code> file
and run the command-line <code class="docutils literal notranslate"><span class="pre">cassandra</span></code> to start. The option is set from the <code class="docutils literal notranslate"><span class="pre">cassandra-env.sh</span></code> file, and is equivalent to starting Cassandra with the command-line option <code class="docutils literal notranslate"><span class="pre">cassandra</span> <span class="pre">-Dcassandra.load_ring_state=false</span></code>.</p>
<p>The <code class="docutils literal notranslate"><span class="pre">-D</span></code> option specifies the start-up parameters in both the command line and <code class="docutils literal notranslate"><span class="pre">cassandra-env.sh</span></code> file. The following options are available:</p>
<div class="section" id="cassandra-auto-bootstrap-false">
<h2><code class="docutils literal notranslate"><span class="pre">cassandra.auto_bootstrap=false</span></code><a class="headerlink" href="#cassandra-auto-bootstrap-false" title="Permalink to this headline"></a></h2>
<p>Facilitates setting 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 <code class="docutils literal notranslate"><span class="pre">cassandra.yaml</span></code> file on each node to revert to true, the default value.</p>
</div>
<div class="section" id="cassandra-available-processors-number-of-processors">
<h2><code class="docutils literal notranslate"><span class="pre">cassandra.available_processors=&lt;number_of_processors&gt;</span></code><a class="headerlink" href="#cassandra-available-processors-number-of-processors" title="Permalink to this headline"></a></h2>
<p>In a multi-instance deployment, multiple Cassandra instances will independently assume that all CPU processors are available to it. This setting allows you to specify a smaller set of processors.</p>
</div>
<div class="section" id="cassandra-boot-without-jna-true">
<h2><code class="docutils literal notranslate"><span class="pre">cassandra.boot_without_jna=true</span></code><a class="headerlink" href="#cassandra-boot-without-jna-true" title="Permalink to this headline"></a></h2>
<p>If JNA fails to initialize, Cassandra fails to boot. Use this command to boot Cassandra without JNA.</p>
</div>
<div class="section" id="cassandra-config-directory">
<h2><code class="docutils literal notranslate"><span class="pre">cassandra.config=&lt;directory&gt;</span></code><a class="headerlink" href="#cassandra-config-directory" title="Permalink to this headline"></a></h2>
<p>The directory location of the <code class="docutils literal notranslate"><span class="pre">cassandra.yaml</span> <span class="pre">file</span></code>. The default location depends on the type of installation.</p>
</div>
<div class="section" id="cassandra-ignore-dynamic-snitch-severity-true-false">
<h2><code class="docutils literal notranslate"><span class="pre">cassandra.ignore_dynamic_snitch_severity=true|false</span></code><a class="headerlink" href="#cassandra-ignore-dynamic-snitch-severity-true-false" title="Permalink to this headline"></a></h2>
<p>Setting this property to true causes the dynamic snitch to ignore the severity indicator from gossip when scoring nodes. Explore failure detection and recovery and dynamic snitching for more information.</p>
<p><strong>Default:</strong> false</p>
</div>
<div class="section" id="cassandra-initial-token-token">
<h2><code class="docutils literal notranslate"><span class="pre">cassandra.initial_token=&lt;token&gt;</span></code><a class="headerlink" href="#cassandra-initial-token-token" title="Permalink to this headline"></a></h2>
<p>Use when virtual nodes (vnodes) are not used. Sets the initial partitioner token for a node the first time the node is started.
Note: Vnodes are highly recommended as they automatically select tokens.</p>
<p><strong>Default:</strong> disabled</p>
</div>
<div class="section" id="cassandra-join-ring-true-false">
<h2><code class="docutils literal notranslate"><span class="pre">cassandra.join_ring=true|false</span></code><a class="headerlink" href="#cassandra-join-ring-true-false" title="Permalink to this headline"></a></h2>
<p>Set to false to start Cassandra on a node but not have the node join the cluster.
You can use <code class="docutils literal notranslate"><span class="pre">nodetool</span> <span class="pre">join</span></code> and a JMX call to join the ring afterwards.</p>
<p><strong>Default:</strong> true</p>
</div>
<div class="section" id="cassandra-load-ring-state-true-false">
<h2><code class="docutils literal notranslate"><span class="pre">cassandra.load_ring_state=true|false</span></code><a class="headerlink" href="#cassandra-load-ring-state-true-false" title="Permalink to this headline"></a></h2>
<p>Set to false to clear all gossip state for the node on restart.</p>
<p><strong>Default:</strong> true</p>
</div>
<div class="section" id="cassandra-metricsreporterconfigfile-filename">
<h2><code class="docutils literal notranslate"><span class="pre">cassandra.metricsReporterConfigFile=&lt;filename&gt;</span></code><a class="headerlink" href="#cassandra-metricsreporterconfigfile-filename" title="Permalink to this headline"></a></h2>
<p>Enable pluggable metrics reporter. Explore pluggable metrics reporting for more information.</p>
</div>
<div class="section" id="cassandra-partitioner-partitioner">
<h2><code class="docutils literal notranslate"><span class="pre">cassandra.partitioner=&lt;partitioner&gt;</span></code><a class="headerlink" href="#cassandra-partitioner-partitioner" title="Permalink to this headline"></a></h2>
<p>Set the partitioner.</p>
<p><strong>Default:</strong> org.apache.cassandra.dht.Murmur3Partitioner</p>
</div>
<div class="section" id="cassandra-prepared-statements-cache-size-in-bytes-cache-size">
<h2><code class="docutils literal notranslate"><span class="pre">cassandra.prepared_statements_cache_size_in_bytes=&lt;cache_size&gt;</span></code><a class="headerlink" href="#cassandra-prepared-statements-cache-size-in-bytes-cache-size" title="Permalink to this headline"></a></h2>
<p>Set the cache size for prepared statements.</p>
</div>
<div class="section" id="cassandra-replace-address-listen-address-of-dead-node-broadcast-address-of-dead-node">
<h2><code class="docutils literal notranslate"><span class="pre">cassandra.replace_address=&lt;listen_address</span> <span class="pre">of</span> <span class="pre">dead</span> <span class="pre">node&gt;|&lt;broadcast_address</span> <span class="pre">of</span> <span class="pre">dead</span> <span class="pre">node&gt;</span></code><a class="headerlink" href="#cassandra-replace-address-listen-address-of-dead-node-broadcast-address-of-dead-node" title="Permalink to this headline"></a></h2>
<p>To replace a node that has died, restart a new node in its place specifying the <code class="docutils literal notranslate"><span class="pre">listen_address</span></code> or <code class="docutils literal notranslate"><span class="pre">broadcast_address</span></code> that the new node is assuming. The new node must not have any data in its data directory, the same state as before bootstrapping.
Note: The <code class="docutils literal notranslate"><span class="pre">broadcast_address</span></code> defaults to the <code class="docutils literal notranslate"><span class="pre">listen_address</span></code> except when using the <code class="docutils literal notranslate"><span class="pre">Ec2MultiRegionSnitch</span></code>.</p>
</div>
<div class="section" id="cassandra-replaylist-table">
<h2><code class="docutils literal notranslate"><span class="pre">cassandra.replayList=&lt;table&gt;</span></code><a class="headerlink" href="#cassandra-replaylist-table" title="Permalink to this headline"></a></h2>
<p>Allow restoring specific tables from an archived commit log.</p>
</div>
<div class="section" id="cassandra-ring-delay-ms-number-of-ms">
<h2><code class="docutils literal notranslate"><span class="pre">cassandra.ring_delay_ms=&lt;number_of_ms&gt;</span></code><a class="headerlink" href="#cassandra-ring-delay-ms-number-of-ms" title="Permalink to this headline"></a></h2>
<p>Defines the amount of time a node waits to hear from other nodes before formally joining the ring.</p>
<p><strong>Default:</strong> 1000ms</p>
</div>
<div class="section" id="cassandra-native-transport-port-port">
<h2><code class="docutils literal notranslate"><span class="pre">cassandra.native_transport_port=&lt;port&gt;</span></code><a class="headerlink" href="#cassandra-native-transport-port-port" title="Permalink to this headline"></a></h2>
<p>Set the port on which the CQL native transport listens for clients.</p>
<p><strong>Default:</strong> 9042</p>
</div>
<div class="section" id="cassandra-rpc-port-port">
<h2><code class="docutils literal notranslate"><span class="pre">cassandra.rpc_port=&lt;port&gt;</span></code><a class="headerlink" href="#cassandra-rpc-port-port" title="Permalink to this headline"></a></h2>
<p>Set the port for the Thrift RPC service, which is used for client connections.</p>
<p><strong>Default:</strong> 9160</p>
</div>
<div class="section" id="cassandra-storage-port-port">
<h2><code class="docutils literal notranslate"><span class="pre">cassandra.storage_port=&lt;port&gt;</span></code><a class="headerlink" href="#cassandra-storage-port-port" title="Permalink to this headline"></a></h2>
<p>Set the port for inter-node communication.</p>
<p><strong>Default:</strong> 7000</p>
</div>
<div class="section" id="cassandra-ssl-storage-port-port">
<h2><code class="docutils literal notranslate"><span class="pre">cassandra.ssl_storage_port=&lt;port&gt;</span></code><a class="headerlink" href="#cassandra-ssl-storage-port-port" title="Permalink to this headline"></a></h2>
<p>Set the SSL port for encrypted communication.</p>
<p><strong>Default:</strong> 7001</p>
</div>
<div class="section" id="cassandra-start-native-transport-true-false">
<h2><code class="docutils literal notranslate"><span class="pre">cassandra.start_native_transport=true|false</span></code><a class="headerlink" href="#cassandra-start-native-transport-true-false" title="Permalink to this headline"></a></h2>
<p>Enable or disable the native transport server. See <code class="docutils literal notranslate"><span class="pre">start_native_transport</span></code> in <code class="docutils literal notranslate"><span class="pre">cassandra.yaml</span></code>.</p>
<p><strong>Default:</strong> true</p>
</div>
<div class="section" id="cassandra-start-rpc-true-false">
<h2><code class="docutils literal notranslate"><span class="pre">cassandra.start_rpc=true|false</span></code><a class="headerlink" href="#cassandra-start-rpc-true-false" title="Permalink to this headline"></a></h2>
<p>Enable or disable the Thrift RPC server.</p>
<p><strong>Default:</strong> true</p>
</div>
<div class="section" id="cassandra-triggers-dir-directory">
<h2><code class="docutils literal notranslate"><span class="pre">cassandra.triggers_dir=&lt;directory&gt;</span></code><a class="headerlink" href="#cassandra-triggers-dir-directory" title="Permalink to this headline"></a></h2>
<p>Set the default location for the trigger JARs.</p>
<p><strong>Default:</strong> conf/triggers</p>
</div>
<div class="section" id="cassandra-write-survey-true">
<h2><code class="docutils literal notranslate"><span class="pre">cassandra.write_survey=true</span></code><a class="headerlink" href="#cassandra-write-survey-true" title="Permalink to this headline"></a></h2>
<p>For testing new compaction and compression strategies. It allows you to experiment with different strategies and benchmark write performance differences without affecting the production workload.</p>
</div>
<div class="section" id="consistent-rangemovement-true-false">
<h2><code class="docutils literal notranslate"><span class="pre">consistent.rangemovement=true|false</span></code><a class="headerlink" href="#consistent-rangemovement-true-false" title="Permalink to this headline"></a></h2>
<p>Set to true makes Cassandra perform bootstrap safely without violating consistency. False disables this.</p>
</div>
</div>
<div class="doc-prev-next-links" role="navigation" aria-label="footer navigation">
<a href="cass_topo_file.html" class="btn btn-default pull-right " role="button" title="cassandra-topologies.properties file" accesskey="n">Next <span class="glyphicon glyphicon-circle-arrow-right" aria-hidden="true"></span></a>
<a href="cass_rackdc_file.html" class="btn btn-default" role="button" title="cassandra-rackdc.properties file" accesskey="p"><span class="glyphicon glyphicon-circle-arrow-left" aria-hidden="true"></span> Previous</a>
</div>
</div>
</div>
</div>
</div>
</div>