Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hector HUnavailableException in Cassandra cluster #610

Open
nivance opened this issue Apr 11, 2013 · 4 comments
Open

Hector HUnavailableException in Cassandra cluster #610

nivance opened this issue Apr 11, 2013 · 4 comments

Comments

@nivance
Copy link

nivance commented Apr 11, 2013

The topology is like below in my Cassandra Cluster.
192.168.0.193=DC1:RAC1(seed)
192.168.0.194=DC1:RAC1
192.168.0.188=DC2:RAC1(seed)
192.168.0.197=DC2:RAC1
The keyspace of Cassandra Cluster is :
Strategy Class: org.apache.cassandra.locator.SimpleStrategy
Strategy Options: None
Replication Factor: 1

In my app, I configure CassandraHost in Spring is:
bean id="cassandraHostConfigurator" class="me.prettyprint.cassandra.service.CassandraHostConfigurator"
constructor-arg value="192.168.0.188:9160,192.168.0.193:9160,192.168.0.194:9160,192.168.0.197:9160"

The consistencyLevel of keyspace and column family is default value(QUORUM).

After started my app the exception HUnavailableException occurs:
me.prettyprint.hector.api.exceptions.HUnavailableException: : May not be enough replicas present to handle consistency level.
at me.prettyprint.cassandra.service.ExceptionsTranslatorImpl.translate(ExceptionsTranslatorImpl.java:59) ~[hector-core-1.1-2.jar:na]
at me.prettyprint.cassandra.model.CqlQuery$1.execute(CqlQuery.java:142) ~[hector-core-1.1-2.jar:na]
at me.prettyprint.cassandra.model.CqlQuery$1.execute(CqlQuery.java:106) ~[hector-core-1.1-2.jar:na]
at me.prettyprint.cassandra.service.Operation.executeAndSetResult(Operation.java:104) ~[hector-core-1.1-2.jar:na]
at me.prettyprint.cassandra.connection.HConnectionManager.operateWithFailover(HConnectionManager.java:258) ~[hector-core-1.1-2.jar:na]
at me.prettyprint.cassandra.model.ExecutingKeyspace.doExecuteOperation(ExecutingKeyspace.java:113) ~[hector-core-1.1-2.jar:na]
at me.prettyprint.cassandra.model.CqlQuery.execute(CqlQuery.java:105) ~[hector-core-1.1-2.jar:na]
.....
Caused by: org.apache.cassandra.thrift.UnavailableException: null
at org.apache.cassandra.thrift.Cassandra$execute_cql_query_result.read(Cassandra.java:32755) ~[cassandra-thrift-1.1.0.jar:1.1.0]
at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:78) ~[libthrift-0.7.0.jar:0.7.0]
at org.apache.cassandra.thrift.Cassandra$Client.recv_execute_cql_query(Cassandra.java:1368) ~[cassandra-thrift-1.1.0.jar:1.1.0]
at org.apache.cassandra.thrift.Cassandra$Client.execute_cql_query(Cassandra.java:1354) ~[cassandra-thrift-1.1.0.jar:1.1.0]
at me.prettyprint.cassandra.model.CqlQuery$1.execute(CqlQuery.java:118) ~[hector-core-1.1-2.jar:na]
... 19 common frames omitted

Is it my configuration error or something?

@nivance
Copy link
Author

nivance commented Apr 11, 2013

I change the host config just seeds like below, the app runs ok.

bean id="cassandraHostConfigurator" class="me.prettyprint.cassandra.service.CassandraHostConfigurator"
constructor-arg value="192.168.0.188:9160,192.168.0.193:9160"

I am confused.

@patricioe
Copy link
Collaborator

What was the config before your change? I have to provide the config with
some nodes so it can connect to the cluster and discover the rest of the
ring.
On Apr 11, 2013 1:59 AM, "nivance" [email protected] wrote:

I change the host config just seeds like below, the app runs ok.

bean id="cassandraHostConfigurator"
class="me.prettyprint.cassandra.service.CassandraHostConfigurator"
constructor-arg value="192.168.0.188:9160,192.168.0.193:9160"

I am confused.


Reply to this email directly or view it on GitHubhttps://github.com//issues/610#issuecomment-16223596
.

@nivance
Copy link
Author

nivance commented Apr 13, 2013

The first congif is below, but it can't run.
bean id="cassandraHostConfigurator" class="me.prettyprint.cassandra.service.CassandraHostConfigurator"
constructor-arg value="192.168.0.188:9160,192.168.0.193:9160,192.168.0.194:9160,192.168.0.197:9160"

then I change to below, it runs well.
bean id="cassandraHostConfigurator" class="me.prettyprint.cassandra.service.CassandraHostConfigurator"
constructor-arg value="192.168.0.188:9160,192.168.0.193:9160"

the difference between the two configs is that the first config includes all nodes but the second config just includes the seed nodes.

@patricioe
Copy link
Collaborator

You may want to check the output of nodetool ring

Seems odd the it doesn't run when specifying all the nodes
On Apr 12, 2013 11:23 PM, "nivance" [email protected] wrote:

The first congif is below, but it can't run.
bean id="cassandraHostConfigurator"
class="me.prettyprint.cassandra.service.CassandraHostConfigurator"
constructor-arg value="192.168.0.188:9160,192.168.0.193:9160,
192.168.0.194:9160,192.168.0.197:9160"

then I change to below, it runs well.
bean id="cassandraHostConfigurator"
class="me.prettyprint.cassandra.service.CassandraHostConfigurator"
constructor-arg value="192.168.0.188:9160,192.168.0.193:9160"

the difference between the two configs is that the first config includes
all nodes but the second config just includes the seed nodes.


Reply to this email directly or view it on GitHubhttps://github.com//issues/610#issuecomment-16328365
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants