Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix cassandra attribute types and autoconf

  • Loading branch information...
commit afef9ef9da397031a816751a1030b07d50c3077a 1 parent b9af198
@b authored
Showing with 21 additions and 22 deletions.
  1. +18 −18 cassandra/metadata.rb
  2. +3 −4 cassandra/recipes/autoconf.rb
View
36 cassandra/metadata.rb
@@ -22,7 +22,7 @@
attribute "cassandra/auto_bootstrap",
:display_name => "Cassandra automatic boostrap boolean",
:description => "Boolean indicating whether a node should automatically boostrap on startup.",
- :default => false
+ :default => "false"
attribute "cassandra/keyspaces",
:display_name => "Cassandra keyspaces",
@@ -72,12 +72,12 @@
attribute "cassandra/rpc_timeout",
:display_name => "",
:description => "",
- :default => 5000
+ :default => "5000"
attribute "cassandra/commit_log_rotation_threshold",
:display_name => "",
:description => "",
- :default => 128
+ :default => "128"
attribute "cassandra/listen_addr",
:display_name => "",
@@ -87,7 +87,7 @@
attribute "cassandra/storage_port",
:display_name => "",
:description => "",
- :default => 7000
+ :default => "7000"
attribute "cassandra/thrift_addr",
:display_name => "",
@@ -97,12 +97,12 @@
attribute "cassandra/thrift_port",
:display_name => "",
:description => "",
- :default => 9160
+ :default => "9160"
attribute "cassandra/thrift_framed_transport",
:display_name => "",
:description => "",
- :default => false
+ :default => "false"
attribute "cassandra/disk_access_mode",
:display_name => "",
@@ -112,52 +112,52 @@
attribute "cassandra/sliced_buffer_size",
:display_name => "",
:description => "",
- :default => 64
+ :default => "64"
attribute "cassandra/flush_data_buffer_size",
:display_name => "",
:description => "",
- :default => 32
+ :default => "32"
attribute "cassandra/flush_index_buffer_size",
:display_name => "",
:description => "",
- :default => 8
+ :default => "8"
attribute "cassandra/column_index_size",
:display_name => "",
:description => "",
- :default => 64
+ :default => "64"
attribute "cassandra/memtable_throughput",
:display_name => "",
:description => "",
- :default => 64
+ :default => "64"
attribute "cassandra/binary_memtable_throughput",
:display_name => "",
:description => "",
- :default => 256
+ :default => "256"
attribute "cassandra/memtable_ops",
:display_name => "",
:description => "",
- :default => 0.3
+ :default => "0.3"
attribute "cassandra/memtable_flush_after",
:display_name => "",
:description => "",
- :default => 60
+ :default => "60"
attribute "cassandra/concurrent_reads",
:display_name => "",
:description => "",
- :default => 8
+ :default => "8"
attribute "cassandra/concurrent_writes",
:display_name => "",
:description => "",
- :default => 32
+ :default => "32"
attribute "cassandra/commit_log_sync",
:display_name => "",
@@ -167,9 +167,9 @@
attribute "cassandra/commit_log_sync_period",
:display_name => "",
:description => "",
- :default => 10000
+ :default => "10000"
attribute "cassandra/gc_grace",
:display_name => "",
:description => "",
- :default => 864000
+ :default => "864000"
View
7 cassandra/recipes/autoconf.rb
@@ -48,11 +48,10 @@
# Nodes are expected to be tagged with [:cassandra][:cluster_name] to indicate the cluster to which
# they belong (nodes are in exactly 1 cluster in this version of the cookbook), and may optionally be
# tagged with [:cassandra][:seed] set to true if a node is to act as a seed.
-seeds = search(:node, "cassandra_cluster_name:#{node[:cassandra][:cluster_name]} AND cassandra_seed:true", "ipaddress")
+clusters = data_bag_item('cassandra', 'clusters')
+node[:cassandra] = Chef::Mixin::DeepMerge.deep_merge!(node[:cassandra], clusters[node[:cassandra][:cluster_name]])
-# Load cluster settings from chef-server
-cassandra_info = data_bag('cassandra')
-node[:cassandra].merge!(cassandra_info['clusters'][node[:cassandra][:cluster_name]])
+seeds = search(:node, "cassandra_cluster_name:#{node[:cassandra][:cluster_name]} AND cassandra_seed:true").map {|n| n['ipaddress']}
node[:cassandra][:seeds] = seeds
# Configure the various addrs for binding
Please sign in to comment.
Something went wrong with that request. Please try again.