Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into Issue83_cassandra_t…
Browse files Browse the repository at this point in the history
…emplate (voxpupuli#83)
  • Loading branch information
dallinb committed Sep 9, 2015
2 parents a3066b0 + d4202a9 commit 9dd3622
Show file tree
Hide file tree
Showing 9 changed files with 74 additions and 14 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Change Log for Puppet Module locp-cassandra

##2015-09-08 - Release 1.3.7
* Made the auto_bootstrap parameter available.

##2015-09-03 - Release 1.3.6
* Fixed a bug, now allowing the user to set the enabled state of the Cassandra
service.
Expand Down
28 changes: 22 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,9 @@ node4 | 110.82.156.4 |
node5 | 110.82.156.5 |

Each node is configured to use the GossipingPropertyFileSnitch and 256 virtual
nodes (vnodes). The name of the cluster is _MyCassandraCluster_.
nodes (vnodes). The name of the cluster is _MyCassandraCluster_. Also,
while building the initial cluster, we are setting the auto_bootstrap
to false.

In this initial example, we are going to expand the example by:

Expand All @@ -205,13 +207,16 @@ node /^node\d+$/ {
endpoint_snitch => 'GossipingPropertyFileSnitch',
listen_address => "${::ipaddress}",
num_tokens => 256,
seeds => '110.82.155.0,110.82.156.3'
seeds => '110.82.155.0,110.82.156.3',
auto_bootstrap => false
}
}
```

The default value for the num_tokens is already 256, but it is
included in the example for clarity.
included in the example for clarity. Do not forget to either
set auto_bootstrap to true or not set the parameter at all
after initializing the cluster.

### Create a Cluster in Multiple Data Centers

Expand All @@ -238,7 +243,8 @@ node /^node[012]$/ {
listen_address => "${::ipaddress}",
num_tokens => 256,
seeds => '10.168.66.41,10.176.170.59',
dc => 'DC1'
dc => 'DC1',
auto_bootstrap => false
}
}
Expand All @@ -249,13 +255,15 @@ node /^node[345]$/ {
listen_address => "${::ipaddress}",
num_tokens => 256,
seeds => '10.168.66.41,10.176.170.59',
dc => 'DC2'
dc => 'DC2',
auto_bootstrap => false
}
}
```

We don't need to specify the rack name (with the rack parameter) as RAC1 is
the default value.
the default value. Again, do not forget to either set auto_bootstrap to
true or not set the parameter at all after initializing the cluster.

### OpsCenter

Expand Down Expand Up @@ -361,6 +369,14 @@ This is passed to the
[cassandra.yaml](http://docs.datastax.com/en/cassandra/2.1/cassandra/configuration/configCassandra_yaml_r.html) file.
Default value: 'AllowAllAuthorizer'

##### `auto_bootstrap`
This is passed to the
[cassandra.yaml](http://docs.datastax.com/en/cassandra/2.1/cassandra/configuration/configCassandra_yaml_r.html) file.
If left at the default value of *undef* then the entry in the configuration
file is absent or commented out. If a value is set, then the parameter
and variable are placed into the configuration file.
Default value: *undef*

##### `auto_snapshot`
This is passed to the
[cassandra.yaml](http://docs.datastax.com/en/cassandra/2.1/cassandra/configuration/configCassandra_yaml_r.html) file.
Expand Down
31 changes: 25 additions & 6 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,9 @@ <h3>
</table>

<p>Each node is configured to use the GossipingPropertyFileSnitch and 256 virtual
nodes (vnodes). The name of the cluster is <em>MyCassandraCluster</em>.</p>
nodes (vnodes). The name of the cluster is <em>MyCassandraCluster</em>. Also,
while building the initial cluster, we are setting the auto_bootstrap
to false.</p>

<p>In this initial example, we are going to expand the example by:</p>

Expand All @@ -326,12 +328,15 @@ <h3>
<span class="pl-c1">endpoint_snitch</span> =&gt; <span class="pl-s"><span class="pl-pds">'</span>GossipingPropertyFileSnitch<span class="pl-pds">'</span></span>,
<span class="pl-c1">listen_address</span> =&gt; <span class="pl-s"><span class="pl-pds">"</span><span class="pl-smi">${::ipaddress}</span><span class="pl-pds">"</span></span>,
<span class="pl-c1">num_tokens</span> =&gt; 256,
<span class="pl-c1">seeds</span> =&gt; <span class="pl-s"><span class="pl-pds">'</span>110.82.155.0,110.82.156.3<span class="pl-pds">'</span></span>
<span class="pl-c1">seeds</span> =&gt; <span class="pl-s"><span class="pl-pds">'</span>110.82.155.0,110.82.156.3<span class="pl-pds">'</span></span>,
<span class="pl-c1">auto_bootstrap</span> =&gt; false
}
}</pre></div>

<p>The default value for the num_tokens is already 256, but it is
included in the example for clarity.</p>
included in the example for clarity. Do not forget to either
set auto_bootstrap to true or not set the parameter at all
after initializing the cluster.</p>

<h3>
<a id="create-a-cluster-in-multiple-data-centers" class="anchor" href="#create-a-cluster-in-multiple-data-centers" aria-hidden="true"><span class="octicon octicon-link"></span></a>Create a Cluster in Multiple Data Centers</h3>
Expand Down Expand Up @@ -398,7 +403,8 @@ <h3>
<span class="pl-c1">listen_address</span> =&gt; <span class="pl-s"><span class="pl-pds">"</span><span class="pl-smi">${::ipaddress}</span><span class="pl-pds">"</span></span>,
<span class="pl-c1">num_tokens</span> =&gt; 256,
<span class="pl-c1">seeds</span> =&gt; <span class="pl-s"><span class="pl-pds">'</span>10.168.66.41,10.176.170.59<span class="pl-pds">'</span></span>,
<span class="pl-c1">dc</span> =&gt; <span class="pl-s"><span class="pl-pds">'</span>DC1<span class="pl-pds">'</span></span>
<span class="pl-c1">dc</span> =&gt; <span class="pl-s"><span class="pl-pds">'</span>DC1<span class="pl-pds">'</span></span>,
<span class="pl-c1">auto_bootstrap</span> =&gt; false
}
}

Expand All @@ -409,12 +415,14 @@ <h3>
<span class="pl-c1">listen_address</span> =&gt; <span class="pl-s"><span class="pl-pds">"</span><span class="pl-smi">${::ipaddress}</span><span class="pl-pds">"</span></span>,
<span class="pl-c1">num_tokens</span> =&gt; 256,
<span class="pl-c1">seeds</span> =&gt; <span class="pl-s"><span class="pl-pds">'</span>10.168.66.41,10.176.170.59<span class="pl-pds">'</span></span>,
<span class="pl-c1">dc</span> =&gt; <span class="pl-s"><span class="pl-pds">'</span>DC2<span class="pl-pds">'</span></span>
<span class="pl-c1">dc</span> =&gt; <span class="pl-s"><span class="pl-pds">'</span>DC2<span class="pl-pds">'</span></span>,
<span class="pl-c1">auto_bootstrap</span> =&gt; false
}
}</pre></div>

<p>We don't need to specify the rack name (with the rack parameter) as RAC1 is
the default value.</p>
the default value. Again, do not forget to either set auto_bootstrap to
true or not set the parameter at all after initializing the cluster.</p>

<h3>
<a id="opscenter" class="anchor" href="#opscenter" aria-hidden="true"><span class="octicon octicon-link"></span></a>OpsCenter</h3>
Expand Down Expand Up @@ -535,6 +543,17 @@ <h5>
<a href="http://docs.datastax.com/en/cassandra/2.1/cassandra/configuration/configCassandra_yaml_r.html">cassandra.yaml</a> file.
Default value: 'AllowAllAuthorizer'</p>

<h5>
<a id="auto_bootstrap" class="anchor" href="#auto_bootstrap" aria-hidden="true"><span class="octicon octicon-link"></span></a><code>auto_bootstrap</code>
</h5>

<p>This is passed to the
<a href="http://docs.datastax.com/en/cassandra/2.1/cassandra/configuration/configCassandra_yaml_r.html">cassandra.yaml</a> file.
If left at the default value of <em>undef</em> then the entry in the configuration
file is absent or commented out. If a value is set, then the parameter
and variable are placed into the configuration file.
Default value: <em>undef</em></p>

<h5>
<a id="auto_snapshot" class="anchor" href="#auto_snapshot" aria-hidden="true"><span class="octicon octicon-link"></span></a><code>auto_snapshot</code>
</h5>
Expand Down
1 change: 1 addition & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
class cassandra (
$authenticator = 'AllowAllAuthenticator',
$authorizer = 'AllowAllAuthorizer',
$auto_bootstrap = undef,
$auto_snapshot = true,
$batch_size_warn_threshold_in_kb = '5',
$cassandra_9822 = false,
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "locp-cassandra",
"version": "1.3.6",
"version": "1.3.7",
"author": "locp",
"summary": "A Puppet module to install and manage Cassandra, DataStax Agent & OpsCenter",
"license": "Apache-2.0",
Expand Down
2 changes: 1 addition & 1 deletion params.json

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions spec/classes/cassandra_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@
it { is_expected.not_to contain_apt__key('datastaxkey') }
it { is_expected.not_to contain_apt__source('datastax') }
it { is_expected.not_to contain_exec('update-cassandra-repos') }
it {
should contain_file('/etc/cassandra/cassandra.yaml').with_content(/#auto_bootstrap: true/)
}
it {
should contain_ini_setting('rackdc.properties.dc').with({
'path' => '/etc/cassandra/cassandra-rackdc.properties',
Expand Down Expand Up @@ -236,6 +239,7 @@
{
:authenticator => 'foo',
:authorizer => 'foo',
:auto_bootstrap => false,
:auto_snapshot => 'foo',
:batch_size_warn_threshold_in_kb => '42',
:client_encryption_enabled => 'foo',
Expand Down Expand Up @@ -277,6 +281,9 @@

it { should contain_file('/etc/cassandra.yaml').with_content(/authenticator: foo/) }
it { should contain_file('/etc/cassandra.yaml').with_content(/authorizer: foo/) }
it {
should contain_file('/etc/cassandra.yaml').with_content(/auto_bootstrap: false/)
}
it { should contain_file('/etc/cassandra.yaml').with_content(/auto_snapshot: foo/) }
it { should contain_file('/etc/cassandra.yaml').with_content(/enabled: foo/) }
it { should contain_file('/etc/cassandra.yaml').with_content(/keystore: foo/) }
Expand Down Expand Up @@ -325,6 +332,7 @@
{
:authenticator => 'foo',
:authorizer => 'foo',
:auto_bootstrap => false,
:auto_snapshot => 'foo',
:cassandra_yaml_tmpl => 'cassandra/cassandra1.yaml.erb',
:client_encryption_enabled => 'foo',
Expand Down Expand Up @@ -363,6 +371,9 @@

it { should contain_file('/etc/cassandra.yaml').with_content(/authenticator: foo/) }
it { should contain_file('/etc/cassandra.yaml').with_content(/authorizer: foo/) }
it {
should contain_file('/etc/cassandra.yaml').with_content(/auto_bootstrap: false/)
}
it { should contain_file('/etc/cassandra.yaml').with_content(/auto_snapshot: foo/) }
it { should contain_file('/etc/cassandra.yaml').with_content(/enabled: foo/) }
it { should contain_file('/etc/cassandra.yaml').with_content(/keystore: foo/) }
Expand Down
5 changes: 5 additions & 0 deletions templates/cassandra.yaml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -793,3 +793,8 @@ internode_compression: <%= @internode_compression %>
# reducing overhead from the TCP protocol itself, at the cost of increasing
# latency if you block for cross-datacenter responses.
inter_dc_tcp_nodelay: false

# This setting has been removed from default configuration. It makes new
# (non-seed) nodes automatically migrate the right data to themselves. When
# initializing a fresh cluster without data, add auto_bootstrap: false.
<% if @auto_bootstrap != nil %>auto_bootstrap: <%= @auto_bootstrap %><% else %>#auto_bootstrap: true<% end %>
5 changes: 5 additions & 0 deletions templates/cassandra1.yaml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -703,3 +703,8 @@ internode_compression: <%= @internode_compression %>
# reducing overhead from the TCP protocol itself, at the cost of increasing
# latency if you block for cross-datacenter responses.
inter_dc_tcp_nodelay: true

# This setting has been removed from default configuration. It makes new
# (non-seed) nodes automatically migrate the right data to themselves. When
# initializing a fresh cluster without data, add auto_bootstrap: false.
<% if @auto_bootstrap != nil %>auto_bootstrap: <%= @auto_bootstrap %><% else %>#auto_bootstrap: true<% end %>

0 comments on commit 9dd3622

Please sign in to comment.