Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

RPC Address to Private IP

  • Loading branch information...
commit 4578a18982efbeaaebf02a0d6550ee49ebcff27f 1 parent 705e9ba
@joaquincasares joaquincasares authored
View
2  attributes/default.rb
@@ -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
6 metadata.json
@@ -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
4 metadata.rb
@@ -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
7 recipes/write_configs.rb
@@ -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"
Please sign in to comment.
Something went wrong with that request. Please try again.