Hi Tyler,
No, it was just a typo in the email, I changed names of DC in the email
after copy/paste from output of the tools.
It is quite easy to reproduce (assuming you have a correct configuration
for NetworkTopologyStrategy, with vNodes(default, 256)):
1. launch cqlsh and create the keyspace
create keyspace foo with replication=
{'class':'NetworkTopologyStrategy','DC1':3};
2. exit cqlsh, run
nodetool describering foo
you'll see something like this:
TokenRange(start_token:2318224911779291128,
end_token:2351629206880900296, endpoints:[], rpc_endpoints:[],
endpoint_details:[])
TokenRange(start_token:-8291638263612363845,
end_token:-8224756763869823639, endpoints:[], rpc_endpoints:[],
endpoint_details:[])
3. start cqlsh,
drop keyspace foo;
4. Exit cqlsh, start cassandra-cli
create keyspace foo with placement_strategy = 'NetworkTopologyStrategy'
AND strategy_options={DC1};
if you run nodetool describering foo you'll see:
TokenRange(start_token:2318224911779291128,
end_token:2351629206880900296, endpoints:[10.11.1.200, 10.11.1.109,
10.11.1.108], rpc_endpoints:[10.11.1.200, 10.11.1.109, 10.11.1.108],
endpoint_details:[EndpointDetails(host:10.11.1.200, datacenter:DC1,
rack:RAC3), EndpointDetails(host:10.11.1.109, datacenter:DC1,
rack:RAC2), EndpointDetails(host:10.11.1.108, datacenter:DC1, rack:RAC1)])
TokenRange(start_token:-8291638263612363845,
end_token:-8224756763869823639, endpoints:[10.11.1.200, 10.11.1.109,
10.11.1.108], rpc_endpoints:[10.11.1.200, 10.11.1.109, 10.11.1.108],
endpoint_details:[EndpointDetails(host:10.11.1.200, datacenter:DC1,
rack:RAC3), EndpointDetails(host:10.11.1.109, datacenter:DC1,
rack:RAC2), EndpointDetails(host:10.11.1.108, datacenter:DC1, rack:RAC1)])
Br,
Gabi
On 1/24/13 10:22 PM, Tyler Hobbs wrote:
Gabriel,
It looks like you used "DC1" for the datacenter name in your
replication strategy options, while the actual datacenter name was
"DC-1" (based on the nodetool status output). Perhaps that was
causing the problem?
On Thu, Jan 24, 2013 at 1:57 PM, Gabriel Ciuloaica
<gciuloa...@gmail.com <mailto:gciuloa...@gmail.com>> wrote:
I do not think that it has anything to do with Astyanax, but
after I have recreated the keyspace with cassandra-cli, everything
is working fine.
Also, I have mention below that not even "nodetool describering
foo", did not showed correct information for the tokens,
encoding_details, if the keyspace was created with cqlsh.
Thanks,
Gabi
On 1/24/13 9:21 PM, Ivan Velykorodnyy wrote:
Hi,
Astyanax is not 1.2 compatible yet
https://github.com/Netflix/astyanax/issues/191
Eran planned to make it in 1.57.x
четверг, 24 января 2013 г. пользователь Gabriel Ciuloaica писал:
Hi,
I have spent half of the day today trying to make a new
Cassandra cluster to work. I have setup a single data center
cluster, using NetworkTopologyStrategy, DC1:3.
I'm using latest version of Astyanax client to connect. After
many hours of debug, I found out that the problem may be in
cqlsh utility.
So, after the cluster was up and running:
[me@cassandra-node1 cassandra]$ nodetool status
Datacenter: DC-1
======================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
-- Address Load Tokens Owns (effective)
Host ID Rack
UN 10.11.1.109 59.1 KB 256 0.0%
726689df-edc3-49a0-b680-370953994a8c RAC2
UN 10.11.1.108 67.49 KB 256 0.0%
73cd86a9-4efb-4407-9fe8-9a1b3a277af7 RAC1
UN 10.11.1.200 59.84 KB 64 0.0%
d6d700d4-28aa-4722-b215-a6a7d304b8e7 RAC3
I went to create the keyspace:
1. First I have tried using cqlsh:
create keyspace foo with replication=
{'class':'NetworkTopologyStrategy','DC1':3};
after this, I have checked that the keyspace was properly
created by running
cqlsh> select * from system.schema_keyspaces;
keyspace_name | durable_writes | strategy_class |
strategy_options
---------------+----------------+------------------------------------------------------+----------------------------
system_auth | True |
org.apache.cassandra.locator.SimpleStrategy |
{"replication_factor":"1"}
foo | True |
org.apache.cassandra.locator.NetworkTopologyStrategy
| {"dc1":"3"}
system | True |
org.apache.cassandra.locator.LocalStrategy
| {}
system_traces | True |
org.apache.cassandra.locator.SimpleStrategy |
{"replication_factor":"1"}
but if I run nodetool describering foo, it will not show
anything into endpoint, or endpoint_details fields.
In this situation, Astyanax client will throw exception with
/NoAvailableHostsException/. I have used following configuration:
withAstyanaxConfiguration(new AstyanaxConfigurationImpl()
.setDiscoveryType(NodeDiscoveryType.RING_DESCRIBE)
.setConnectionPoolType(ConnectionPoolType.TOKEN_AWARE)
First option did not worked at all.
2. I've dropped the keyspace crated with cqlsh and re-created
with cassandra-cli. This time, the nodetool describering foo,
shows information into endpoint and endpoint_details columns,
and also the Astyanax client works properly.
Hope it will avoid others to avoid spending time to figure
out how to go around this issue.
Br,
Gabi
--
Tyler Hobbs
DataStax <http://datastax.com/>