The error stack is as follows:
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at
org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
Caused by: 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)
at
me.prettyprint.cassandra.service.KeyspaceServiceImpl$7.execute(KeyspaceServiceImpl.java:285)
at
me.prettyprint.cassandra.service.KeyspaceServiceImpl$7.execute(KeyspaceServiceImpl.java:268)
at
me.prettyprint.cassandra.service.Operation.executeAndSetResult(Operation.java:103)
at
me.prettyprint.cassandra.connection.HConnectionManager.operateWithFailover(HConnectionManager.java:258)
at
me.prettyprint.cassandra.service.KeyspaceServiceImpl.operateWithFailover(KeyspaceServiceImpl.java:131)
at
me.prettyprint.cassandra.service.KeyspaceServiceImpl.getSlice(KeyspaceServiceImpl.java:289)
at
me.prettyprint.cassandra.model.thrift.ThriftSliceQuery$1.doInKeyspace(ThriftSliceQuery.java:53)
at
me.prettyprint.cassandra.model.thrift.ThriftSliceQuery$1.doInKeyspace(ThriftSliceQuery.java:49)
at
me.prettyprint.cassandra.model.KeyspaceOperationCallback.doInKeyspaceAndMeasure(KeyspaceOperationCallback.java:20)
at
me.prettyprint.cassandra.model.ExecutingKeyspace.doExecute(ExecutingKeyspace.java:85)
at
me.prettyprint.cassandra.model.thrift.ThriftSliceQuery.execute(ThriftSliceQuery.java:48)
at
me.prettyprint.cassandra.service.ColumnSliceIterator.hasNext(ColumnSliceIterator.java:88)
at
com.musigma.hectortest.HectorUtilTest.getAllColumns(HectorUtil.java:70)
at com.musigma.hectortest.HectorUtil.main(HectorUtil.java:168)
... 5 more
Caused by: UnavailableException()
at
org.apache.cassandra.thrift.Cassandra$get_slice_result.read(Cassandra.java:7204)
at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:78)
at
org.apache.cassandra.thrift.Cassandra$Client.recv_get_slice(Cassandra.java:543)
at
org.apache.cassandra.thrift.Cassandra$Client.get_slice(Cassandra.java:527)
at
me.prettyprint.cassandra.service.KeyspaceServiceImpl$7.execute(KeyspaceServiceImpl.java:273)
... 18 more
The node tool ring from the node I connected to looks like :
Address DC Rack Status State Load
Effective-Owership Token
85070591730234615865843651857942052864
162.192.100.16 datacenter1 rack1 Up Normal 239.82 MB 100.00%
0
162.192.100.9 datacenter1 rack1 Down Normal 239.81 MB 100.00%
85070591730234615865843651857942052864
I did not find any error in the logs generated by Cassandra on the running
machine.
Please help me
Thanks and Regards
Prakrati
From: aaron morton [mailto:[email protected]]
Sent: Tuesday, June 12, 2012 2:42 PM
To: [email protected]
Subject: Re: Hector code not running when replication factor set to 2
What was the exact error stack you got ?
What does node tool ring look look from the node you connected to?
Did you notice any errors in the logs on the machine you connected to ?
Cheers
-----------------
Aaron Morton
Freelance Developer
@aaronmorton
http://www.thelastpickle.com
On 12/06/2012, at 8:41 PM, Prakrati Agrawal wrote:
I am using the consistency level one and replication factor 2
Thanks
Prakrati
From: aaron morton [mailto:[email protected]]
Sent: Tuesday, June 12, 2012 2:12 PM
To: [email protected]<mailto:[email protected]>
Subject: Re: Hector code not running when replication factor set to 2
What consistency level and replication factor were you using ?
UnavailableException is thrown when less the consistency level nodes are UP.
Cheers
-----------------
Aaron Morton
Freelance Developer
@aaronmorton
http://www.thelastpickle.com
On 11/06/2012, at 10:19 PM, Prakrati Agrawal wrote:
Dear all
I had a 2 node cluster with replication factor set to 1. Then I changed the
replication factor to 2 and brought down one node so that only 1 node was up
and running. Then I ran my Hector code on the running node. But it gave me
Unavailable Exception. I also had a Thrift code which ran successfully. I am
confused as to why the Hector code did not run. Did I miss something? Please
help me.
Thanks and Regards
Prakrati
________________________________
This email message may contain proprietary, private and confidential
information. The information transmitted is intended only for the person(s) or
entities to which it is addressed. Any review, retransmission, dissemination or
other use of, or taking of any action in reliance upon, this information by
persons or entities other than the intended recipient is prohibited and may be
illegal. If you received this in error, please contact the sender and delete
the message from your system.
Mu Sigma takes all reasonable steps to ensure that its electronic
communications are free from viruses. However, given Internet accessibility,
the Company cannot accept liability for any virus introduced by this e-mail or
any attachment and you are advised to use up-to-date virus checking software.
________________________________
This email message may contain proprietary, private and confidential
information. The information transmitted is intended only for the person(s) or
entities to which it is addressed. Any review, retransmission, dissemination or
other use of, or taking of any action in reliance upon, this information by
persons or entities other than the intended recipient is prohibited and may be
illegal. If you received this in error, please contact the sender and delete
the message from your system.
Mu Sigma takes all reasonable steps to ensure that its electronic
communications are free from viruses. However, given Internet accessibility,
the Company cannot accept liability for any virus introduced by this e-mail or
any attachment and you are advised to use up-to-date virus checking software.
________________________________
This email message may contain proprietary, private and confidential
information. The information transmitted is intended only for the person(s) or
entities to which it is addressed. Any review, retransmission, dissemination or
other use of, or taking of any action in reliance upon, this information by
persons or entities other than the intended recipient is prohibited and may be
illegal. If you received this in error, please contact the sender and delete
the message from your system.
Mu Sigma takes all reasonable steps to ensure that its electronic
communications are free from viruses. However, given Internet accessibility,
the Company cannot accept liability for any virus introduced by this e-mail or
any attachment and you are advised to use up-to-date virus checking software.