blob: 28529031d890d1e7d78b6ececa68b61589fd224a [file] [log] [blame]
---
layout: docpage
title: "Documentation"
is_homepage: false
is_sphinx_doc: true
doc-parent: "Configuring Cassandra"
doc-title: "cassandra-rackdc.properties 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-env.sh file" href="cass_env_sh_file.html"/>
<link rel="prev" title="cassandra.yaml file configuration" href="cass_yaml_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 current"><a class="current reference internal" href="#">cassandra-rackdc.properties file</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#gossipingpropertyfilesnitch">GossipingPropertyFileSnitch</a></li>
<li class="toctree-l3"><a class="reference internal" href="#aws-ec2-snitch">AWS EC2 snitch</a></li>
<li class="toctree-l3"><a class="reference internal" href="#either-snitch">Either snitch</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="cass_env_sh_file.html">cassandra-env.sh file</a></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-rackdc-properties-file">
<span id="cassandra-rackdc"></span><h1>cassandra-rackdc.properties file<a class="headerlink" href="#cassandra-rackdc-properties-file" title="Permalink to this headline"></a></h1>
<p>Several <span class="xref std std-term">snitch</span> options use the <code class="docutils literal notranslate"><span class="pre">cassandra-rackdc.properties</span></code> configuration file to determine which <span class="xref std std-term">datacenters</span> and racks cluster nodes belong to. Information about the
network topology allows requests to be routed efficiently and to distribute replicas evenly. The following snitches can be configured here:</p>
<ul class="simple">
<li>GossipingPropertyFileSnitch</li>
<li>AWS EC2 single-region snitch</li>
<li>AWS EC2 multi-region snitch</li>
</ul>
<p>The GossipingPropertyFileSnitch is recommended for production. This snitch uses the datacenter and rack information configured in a local node’s <code class="docutils literal notranslate"><span class="pre">cassandra-rackdc.properties</span></code>
file and propagates the information to other nodes using <span class="xref std std-term">gossip</span>. It is the default snitch and the settings in this properties file are enabled.</p>
<p>The AWS EC2 snitches are configured for clusters in AWS. This snitch uses the <code class="docutils literal notranslate"><span class="pre">cassandra-rackdc.properties</span></code> options to designate one of two AWS EC2 datacenter and rack naming conventions:</p>
<ul>
<li><p class="first">legacy: Datacenter name is the part of the availability zone name preceding the last “-” when the zone ends in -1 and includes the number if not -1. Rack name is the portion of the availability zone name following the last “-“.</p>
<blockquote>
<div><p>Examples: us-west-1a =&gt; dc: us-west, rack: 1a; us-west-2b =&gt; dc: us-west-2, rack: 2b;</p>
</div></blockquote>
</li>
<li><p class="first">standard: Datacenter name is the standard AWS region name, including the number. Rack name is the region plus the availability zone letter.</p>
<blockquote>
<div><p>Examples: us-west-1a =&gt; dc: us-west-1, rack: us-west-1a; us-west-2b =&gt; dc: us-west-2, rack: us-west-2b;</p>
</div></blockquote>
</li>
</ul>
<p>Either snitch can set to use the local or internal IP address when multiple datacenters are not communicating.</p>
<div class="section" id="gossipingpropertyfilesnitch">
<h2>GossipingPropertyFileSnitch<a class="headerlink" href="#gossipingpropertyfilesnitch" title="Permalink to this headline"></a></h2>
<div class="section" id="dc">
<h3><code class="docutils literal notranslate"><span class="pre">dc</span></code><a class="headerlink" href="#dc" title="Permalink to this headline"></a></h3>
<p>Name of the datacenter. The value is case-sensitive.</p>
<p><strong>Default value:</strong> DC1</p>
</div>
<div class="section" id="rack">
<h3><code class="docutils literal notranslate"><span class="pre">rack</span></code><a class="headerlink" href="#rack" title="Permalink to this headline"></a></h3>
<p>Rack designation. The value is case-sensitive.</p>
<p><strong>Default value:</strong> RAC1</p>
</div>
</div>
<div class="section" id="aws-ec2-snitch">
<h2>AWS EC2 snitch<a class="headerlink" href="#aws-ec2-snitch" title="Permalink to this headline"></a></h2>
<div class="section" id="ec2-naming-scheme">
<h3><code class="docutils literal notranslate"><span class="pre">ec2_naming_scheme</span></code><a class="headerlink" href="#ec2-naming-scheme" title="Permalink to this headline"></a></h3>
<p>Datacenter and rack naming convention. Options are <code class="docutils literal notranslate"><span class="pre">legacy</span></code> or <code class="docutils literal notranslate"><span class="pre">standard</span></code> (default). <strong>This option is commented out by default.</strong></p>
<p><strong>Default value:</strong> standard</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">YOU MUST USE THE <code class="docutils literal notranslate"><span class="pre">legacy</span></code> VALUE IF YOU ARE UPGRADING A PRE-4.0 CLUSTER.</p>
</div>
</div>
</div>
<div class="section" id="either-snitch">
<h2>Either snitch<a class="headerlink" href="#either-snitch" title="Permalink to this headline"></a></h2>
<div class="section" id="prefer-local">
<h3><code class="docutils literal notranslate"><span class="pre">prefer_local</span></code><a class="headerlink" href="#prefer-local" title="Permalink to this headline"></a></h3>
<p>Option to use the local or internal IP address when communication is not across different datacenters. <strong>This option is commented out by default.</strong></p>
<p><strong>Default value:</strong> true</p>
</div>
</div>
</div>
<div class="doc-prev-next-links" role="navigation" aria-label="footer navigation">
<a href="cass_env_sh_file.html" class="btn btn-default pull-right " role="button" title="cassandra-env.sh file" accesskey="n">Next <span class="glyphicon glyphicon-circle-arrow-right" aria-hidden="true"></span></a>
<a href="cass_yaml_file.html" class="btn btn-default" role="button" title="cassandra.yaml file configuration" accesskey="p"><span class="glyphicon glyphicon-circle-arrow-left" aria-hidden="true"></span> Previous</a>
</div>
</div>
</div>
</div>
</div>
</div>