Skip to content
Browse files

Use search to gather seeds from nodes

  • Loading branch information...
1 parent 116ac57 commit 38bd95cd2b015d9762b97e7293cdf2f37b4f69a7 @b committed Mar 10, 2010
Showing with 8 additions and 2 deletions.
  1. +8 −2 cassandra/recipes/autoconf.rb
View
10 cassandra/recipes/autoconf.rb
@@ -30,8 +30,6 @@
# :replication_factor => <factor>,
# :end_point_snitch => <snitch>
# }],
-# :seeds =>
-# [<seed addr>, ...],
# <other per cluster settings>
# }
# }
@@ -45,9 +43,17 @@
# :column_type => "Super", :compare_subcolumns_with => <comparison>}
#
+# Gather the seeds
+#
+# 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")
+
# Load cluster settings from chef-server
cassandra_info = data_bag('cassandra')
node[:cassandra].merge!(cassandra_info['clusters'][node[:cassandra][:cluster_name]])
+node[:cassandra][:seeds] = seeds
# Configure the various addrs for binding
node[:cassandra][:listen_addr] = node[:ipaddress]

0 comments on commit 38bd95c

Please sign in to comment.
Something went wrong with that request. Please try again.