modules/common/cassandra-bundle/src/main/java/org/rhq/cassandra/bundle/EmbeddedDeployer.java
| 5 +++-
modules/common/cassandra-bundle/src/main/resources/cassandra-1.1.5/conf/cassandra.yaml
| 4 +--
modules/common/cassandra-bundle/src/main/resources/deploy.xml
| 12 ++++++++++
3 files changed, 18 insertions(+), 3 deletions(-)
New commits:
commit 0f81831974faf9b9962db7ccb4a8072d5d0665dd
Author: John Sanda <jsanda(a)redhat.com>
Date: Sat Sep 29 12:56:54 2012 -0400
Need to parameterize the listen_address and rpc_address properties in bundle recipe
When I first set up this module I forgot to parameterize the listen_address and
rpc_address properties in cassandra.yaml. In the server plugin prototype
project, I set both of them to the hostname bundle recipe property. This commit
introduces separate listen.address and rpc.address bundle recipe properties
making it possible to bind to different interfaces.
diff --git
a/modules/common/cassandra-bundle/src/main/java/org/rhq/cassandra/bundle/EmbeddedDeployer.java
b/modules/common/cassandra-bundle/src/main/java/org/rhq/cassandra/bundle/EmbeddedDeployer.java
index bd91fac..fd7ac42 100644
---
a/modules/common/cassandra-bundle/src/main/java/org/rhq/cassandra/bundle/EmbeddedDeployer.java
+++
b/modules/common/cassandra-bundle/src/main/java/org/rhq/cassandra/bundle/EmbeddedDeployer.java
@@ -84,6 +84,7 @@ public class EmbeddedDeployer {
for (int i = 0; i < deploymentOptions.getNumNodes(); ++i) {
Set<String> seeds = getSeeds(ipAddresses, i + 1);
int jmxPort = 7200 + i;
+ String address = getLocalIPAddress(i + i);
Properties props = new Properties();
props.put("cluster.name", "rhq");
@@ -93,13 +94,15 @@ public class EmbeddedDeployer {
props.put("commitlog.dir", "commit_log");
props.put("log.dir", "logs");
props.put("saved.caches.dir", "saved_caches");
- props.put("hostname", getLocalIPAddress(i + 1));
+ props.put("hostname", address);
props.put("seeds", collectionToString(seeds));
props.put("jmx.port", Integer.toString(jmxPort));
props.put("initial.token", generateToken(i,
deploymentOptions.getNumNodes()));
props.put("rhq.deploy.dir", new File(clusterDir,
"node" + i).getAbsolutePath());
props.put("rhq.deploy.id", i);
props.put("rhq.deploy.phase", "install");
+ props.put("listen.address", address);
+ props.put("rpc.address", address);
doLocalDeploy(props, bundleDir);
}
diff --git
a/modules/common/cassandra-bundle/src/main/resources/cassandra-1.1.5/conf/cassandra.yaml
b/modules/common/cassandra-bundle/src/main/resources/cassandra-1.1.5/conf/cassandra.yaml
index a12fb90..87a0d95 100644
---
a/modules/common/cassandra-bundle/src/main/resources/cassandra-1.1.5/conf/cassandra.yaml
+++
b/modules/common/cassandra-bundle/src/main/resources/cassandra-1.1.5/conf/cassandra.yaml
@@ -276,7 +276,7 @@ ssl_storage_port: 7001
# address associated with the hostname (it might not be).
#
# Setting this to 0.0.0.0 is always wrong.
-listen_address: localhost
+listen_address: @@listen.address(a)@
# Address to broadcast to other Cassandra nodes
# Leaving this blank will set it to the same value as listen_address
@@ -288,7 +288,7 @@ listen_address: localhost
#
# Leaving this blank has the same effect it does for ListenAddress,
# (i.e. it will be based on the configured hostname of the node).
-rpc_address: localhost
+rpc_address: @@rpc.address(a)@
# port for Thrift to listen for clients on
rpc_port: 9160
diff --git a/modules/common/cassandra-bundle/src/main/resources/deploy.xml
b/modules/common/cassandra-bundle/src/main/resources/deploy.xml
index 3675e25..38bc175 100644
--- a/modules/common/cassandra-bundle/src/main/resources/deploy.xml
+++ b/modules/common/cassandra-bundle/src/main/resources/deploy.xml
@@ -71,6 +71,18 @@
defaultValue="7200"
type="string"/>
+ <rhq:input-property name="listen.address"
+ description="Address used for inter-node communication.
Defaults to value of hostname property."
+ required="true"
+ defaultValue=""
+ type="string"/>
+
+ <rhq:input-property name="rpc.address"
+ description="Address used for Thrift RPC client
communication. Defaults to value of hostname property."
+ required="true"
+ defaultValue=""
+ type="string"/>
+
<!--
The next two properties, install.schema and replication.factor deal with
running a CLI or CQL script to install and configure a keyspace.
Show replies by date