Permalink
Browse files

RPC Address to Private IP

  • Loading branch information...
joaquincasares committed Sep 22, 2011
1 parent 705e9ba commit 4578a18982efbeaaebf02a0d6550ee49ebcff27f
Showing with 12 additions and 7 deletions.
  1. +1 −1 attributes/default.rb
  2. +3 −3 metadata.json
  3. +2 −2 metadata.rb
  4. +6 −1 recipes/write_configs.rb
View
@@ -16,7 +16,7 @@
default[:cassandra][:token_position] = false
default[:cassandra][:initial_token] = false
default[:cassandra][:seed] = false
-default[:cassandra][:rpc_address] = "0.0.0.0"
+default[:cassandra][:rpc_address] = false
default[:cassandra][:confPath] = "/etc/cassandra/"
default[:internal][:prime] = true
View
@@ -191,13 +191,13 @@
"choice": [
],
- "default": "0.0.0.0",
+ "default": "false",
"type": "string",
"recipes": [
],
"display_name": "Cassandra RPC Address",
- "description": "The address to bind the Thrift RPC service to"
+ "description": "The address to bind the Thrift RPC service to (False sets RPC Address to the private IP)"
},
"cassandra": {
"required": "optional",
@@ -244,4 +244,4 @@
"description": "Install and configure Cassandra in a multi-node environment",
"providing": {
}
-}
+}
View
@@ -76,8 +76,8 @@
attribute "cassandra/rpc_address",
:display_name => "Cassandra RPC Address",
- :description => "The address to bind the Thrift RPC service to",
- :default => "0.0.0.0"
+ :description => "The address to bind the Thrift RPC service to (False sets RPC Address to the private IP)",
+ :default => "false"
attribute "cassandra/confPath",
:display_name => "Cassandra Settings Path",
View
@@ -39,7 +39,12 @@
cassandraYaml = cassandraYaml.gsub(/\/.*\/cassandra\/commitlog/, "#{node[:cassandra][:commitlog_dir]}/cassandra/commitlog")
cassandraYaml = cassandraYaml.gsub(/\/.*\/cassandra\/saved_caches/, "#{node[:cassandra][:data_dir]}/cassandra/saved_caches")
cassandraYaml = cassandraYaml.gsub(/listen_address:.*/, "listen_address: #{node[:cloud][:private_ips].first}")
- cassandraYaml = cassandraYaml.gsub(/rpc_address:.*/, "rpc_address: #{node[:cassandra][:rpc_address]}")
+
+ if node[:cassandra][:rpc_address]
+ cassandraYaml = cassandraYaml.gsub(/rpc_address:.*/, "rpc_address: #{node[:cassandra][:rpc_address]}")
+ else
+ cassandraYaml = cassandraYaml.gsub(/rpc_address:.*/, "rpc_address: #{node[:cloud][:private_ips].first}")
+ end
# Cassandra 0.7.x has a slightly different Yaml
if node[:setup][:deployment] == "07x"

0 comments on commit 4578a18

Please sign in to comment.