I'm just starting to play with Cassandra, so this is almost certainly
a conceptual problem on my part, so apologies in advance. I was
testing out how I'd do things like bring up new nodes. I've got a
simple 2-node cluster with my only keyspace having
replication_factor=2. This is on 32-bit Debian Squeeze. Java==Java(TM)
SE Runtime Environment (build 1.6.0_22-b04). This is using the
just-released 0.7.0 binaries. Configuration is pretty minimal besides
using SimpleAuthentication module.

The issue is that whenever I kill a node in the cluster and wipe its
datadir (i.e. rm -rf /var/lib/cassandra/*) and try to bootstrap it
back into the cluster (and this occurs in both the scenario of both
nodes being present during the writing of data as well as only a
single node being up during writing of data), it seems to join the
cluster and chug along till it keels over and dies with this:

 INFO [main] 2011-01-13 13:56:23,385 StorageService.java (line 399)
Bootstrapping
ERROR [main] 2011-01-13 13:56:23,402 AbstractCassandraDaemon.java
(line 234) Exception encountered during startup.
java.lang.IllegalStateException: replication factor (2) exceeds number
of endpoints (1)
        at 
org.apache.cassandra.locator.SimpleStrategy.calculateNaturalEndpoints(SimpleStrategy.java:60)
        at 
org.apache.cassandra.locator.AbstractReplicationStrategy.getRangeAddresses(AbstractReplicationStrategy.java:204)
        at 
org.apache.cassandra.dht.BootStrapper.getRangesWithSources(BootStrapper.java:198)
        at org.apache.cassandra.dht.BootStrapper.bootstrap(BootStrapper.java:83)
        at 
org.apache.cassandra.service.StorageService.bootstrap(StorageService.java:417)
        at 
org.apache.cassandra.service.StorageService.initServer(StorageService.java:361)
        at 
org.apache.cassandra.service.AbstractCassandraDaemon.setup(AbstractCassandraDaemon.java:161)
        at 
org.apache.cassandra.thrift.CassandraDaemon.setup(CassandraDaemon.java:55)
        at 
org.apache.cassandra.service.AbstractCassandraDaemon.activate(AbstractCassandraDaemon.java:217)
        at 
org.apache.cassandra.thrift.CassandraDaemon.main(CassandraDaemon.java:134)
Exception encountered during startup.
java.lang.IllegalStateException: replication factor (2) exceeds number
of endpoints (1)
        at 
org.apache.cassandra.locator.SimpleStrategy.calculateNaturalEndpoints(SimpleStrategy.java:60)
        at 
org.apache.cassandra.locator.AbstractReplicationStrategy.getRangeAddresses(AbstractReplicationStrategy.java:204)
        at 
org.apache.cassandra.dht.BootStrapper.getRangesWithSources(BootStrapper.java:198)
        at org.apache.cassandra.dht.BootStrapper.bootstrap(BootStrapper.java:83)
        at 
org.apache.cassandra.service.StorageService.bootstrap(StorageService.java:417)
        at 
org.apache.cassandra.service.StorageService.initServer(StorageService.java:361)
        at 
org.apache.cassandra.service.AbstractCassandraDaemon.setup(AbstractCassandraDaemon.java:161)
        at 
org.apache.cassandra.thrift.CassandraDaemon.setup(CassandraDaemon.java:55)
        at 
org.apache.cassandra.service.AbstractCassandraDaemon.activate(AbstractCassandraDaemon.java:217)
        at 
org.apache.cassandra.thrift.CassandraDaemon.main(CassandraDaemon.java:134)


Seems like something of a chicken-or-the-egg problem of it not liking
there only being 1 node but not letting node 2 join. Being that I've
been messing with Cassandra for only a couple of days, I'm assuming
I'm doing something wrong, but the only google'ing I can find for the
above error is just a couple of 4+ month-old tickets that all sound
resolved. It's probably worth mentioning that if both nodes are
started when I create the keyspace, the cluster appears to work just
fine and I can start/stop either node and get at any piece of data.

The nodetool ring output looks like this:

> Prior to starting 10.1.58.4 and then for a while after startup
Address         Status State   Load            Owns    Token
10.1.58.3       Up     Normal  524.99 KB       100.00%
74198390702807803312208811144092384306

> 10.1.58.4 seems to be joining
Address         Status State   Load            Owns    Token

74198390702807803312208811144092384306
10.1.58.4       Up     Joining 72.06 KB        56.66%
460947270041113367229815744049079597
10.1.58.3       Up     Normal  524.99 KB       43.34%
74198390702807803312208811144092384306

> Java exception, back to just 10.1.58.3
Address         Status State   Load            Owns    Token
10.1.58.3       Up     Normal  524.99 KB       100.00%
74198390702807803312208811144092384306

Reply via email to