You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Matt Ernst <ma...@loomia.com> on 2010/01/06 23:14:32 UTC

running two cassandra instances on one machine for testing?

I would like to run two instances of Cassandra on one machine, with
ReplicationFactor 2, to verify that data is still written/read properly
even with failure of one instance. This is a matter of validating the
client configuration to be sure that data is still read/written without
incident when one instance goes down. So far I have been able to
successfully run many tests with just a single instance and a
ReplicationFactor of 1.

How might I run two instances on the same machine? I am running
Cassandra 0.4.2 on a desktop machine running Linux with a single gigabit
ethernet adapter, if it makes any difference. I tried to set up one
instance with a ListenerAddress of 127.0.0.1 and set up a second with a
ListenerAddress of 127.0.0.2. I also configured separate on-disk
directories for the second instance. I set up both instances as mutual
seeds in the configuration files and set ReplicationFactor to 2.

When I try to start the second instance I get these errors:
ERROR: transport error 202: bind failed: Address already in use
ERROR: JDWP Transport dt_socket failed to initialize,
TRANSPORT_INIT(510)
JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports
initialized [../../../src/share/back/debugInit.c:690]
FATAL ERROR in native method: JDWP No transports initialized,
jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)
Aborted

It would be great if someone could point me to an existing document
about running 2 instances on one machine, if one exists, or failing that
give some hints about where I need to look to find how to fix my
configuration. I have a suspicion that I have done something dumb by
just choosing 127.0.0.2 in the Cassandra config and not changing my
hosts or network interfaces or something along those lines. I am
unfortunately ignorant enough of networking that I don't know what the
right approach is to get Cassandra running on two different IP addresses
which belong to the same physical machine.

Any hints are much appreciated!
Matt Ernst


Re: running two cassandra instances on one machine for testing?

Posted by Matt Ernst <ma...@loomia.com>.
On Wed, 2010-01-06 at 16:36 -0600, Jonathan Ellis wrote:
> by default, cassandra.in.sh tells the jvm to use ports 8888 and 8080
> for jmx and debugger; it binds to these on all interfaces.  so you'll
> have to make a second cassandra.in.sh for the second instance and
> change those: http://wiki.apache.org/cassandra/RunningCassandra

Thanks, that did the trick.

Matt Ernst


Re: running two cassandra instances on one machine for testing?

Posted by Jonathan Ellis <jb...@gmail.com>.
by default, cassandra.in.sh tells the jvm to use ports 8888 and 8080
for jmx and debugger; it binds to these on all interfaces.  so you'll
have to make a second cassandra.in.sh for the second instance and
change those: http://wiki.apache.org/cassandra/RunningCassandra

On Wed, Jan 6, 2010 at 4:14 PM, Matt Ernst <ma...@loomia.com> wrote:
> I would like to run two instances of Cassandra on one machine, with
> ReplicationFactor 2, to verify that data is still written/read properly
> even with failure of one instance. This is a matter of validating the
> client configuration to be sure that data is still read/written without
> incident when one instance goes down. So far I have been able to
> successfully run many tests with just a single instance and a
> ReplicationFactor of 1.
>
> How might I run two instances on the same machine? I am running
> Cassandra 0.4.2 on a desktop machine running Linux with a single gigabit
> ethernet adapter, if it makes any difference. I tried to set up one
> instance with a ListenerAddress of 127.0.0.1 and set up a second with a
> ListenerAddress of 127.0.0.2. I also configured separate on-disk
> directories for the second instance. I set up both instances as mutual
> seeds in the configuration files and set ReplicationFactor to 2.
>
> When I try to start the second instance I get these errors:
> ERROR: transport error 202: bind failed: Address already in use
> ERROR: JDWP Transport dt_socket failed to initialize,
> TRANSPORT_INIT(510)
> JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports
> initialized [../../../src/share/back/debugInit.c:690]
> FATAL ERROR in native method: JDWP No transports initialized,
> jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)
> Aborted
>
> It would be great if someone could point me to an existing document
> about running 2 instances on one machine, if one exists, or failing that
> give some hints about where I need to look to find how to fix my
> configuration. I have a suspicion that I have done something dumb by
> just choosing 127.0.0.2 in the Cassandra config and not changing my
> hosts or network interfaces or something along those lines. I am
> unfortunately ignorant enough of networking that I don't know what the
> right approach is to get Cassandra running on two different IP addresses
> which belong to the same physical machine.
>
> Any hints are much appreciated!
> Matt Ernst
>
>