0
votes

I'm having trouble setting up a new Cassandra cluster. I've set up a 3 node cluster in EC2 (Zone: eu-west-1b). When I try to insert a record into a new table I receive this error message:

cqlsh:test> insert into mytest (id, value) values(1,100);
Unable to complete request: one or more nodes were unavailable.

I've confirmed that the 3 nodes are up and running:

nodetool status
UN  ***.***.***.***  68.1 KB    256     33.2%  bbf1c5e9-ac68-41a1-81a8-00c7877c4eac  rack1
UN  ***.***.***.***  81.95 KB   256     34.1%  e118e3a7-2486-4c08-8ba1-d337888ff59c  rack1
UN  ***.***.***.***   68.12 KB   256     32.7%  041cb88e-df21-4640-b7ac-7a87fd38dae6  rack1

The commands I used to create the keyspace and table are:

create keyspace test with replication ={'class':'NetworkTopologyStrategy', 'eu-west-1b': 2};
use test;
create table mytest (id int primary key, value int);
insert into mytest (id, value) values(1,100);

Each node can see the keyspace - I used CQLSH and ran descibe keyspace and got this output from each node:

CREATE KEYSPACE test WITH replication = {
  'class': 'NetworkTopologyStrategy',
  'eu-west-1b': '2'
};

USE test;

CREATE TABLE mytest (
  id int PRIMARY KEY,
  value int
) WITH
  bloom_filter_fp_chance=0.010000 AND
  caching='KEYS_ONLY' AND
  comment='' AND
  dclocal_read_repair_chance=0.000000 AND
  gc_grace_seconds=864000 AND
  read_repair_chance=0.100000 AND
  replicate_on_write='true' AND
  populate_io_cache_on_flush='false' AND
  compaction={'class': 'SizeTieredCompactionStrategy'} AND
  compression={'sstable_compression': 'SnappyCompressor'};
2

2 Answers

2
votes

I finally tracked down the problem - I had set the endpoint_snitch to Ec2Snitch, but the default Datastax was set beneath the comments (which I hadn't noticed). I commented out the DS snitch, restarted the dse service on all nodes and ran nodetool repair on each node and the problem went away.

-1
votes

As per Mark's response first check if your cassandra cluster is in aws. if it is then change the configuration in "cassandra.yaml" just change endpoint_snitch to Ec2Snitch again one thing that culd be poossible is your datacenter is actually the "region" of ec2 instance and it should be like "us-east','us-west'. In your case it should be 'eu-west' only.

As per datastax says about it EC2Snitch¶

Use the EC2Snitch for simple cluster deployments on Amazon EC2 where all nodes in the cluster are within a single region. The region is treated as the data center and the availability zones are treated as racks within the data center. For example, if a node is in us-east-1a, us-east is the data center name and 1a is the rack location. Because private IPs are used, this snitch does not work across multiple regions.

When defining your keyspace strategy_options, use the EC2 region name (for example,us-east) as your data center name.

link - http://www.datastax.com/docs/1.0/cluster_architecture/replication http://www.datastax.com/documentation/cql/3.1/cql/cql_using/update_ks_rf_t.html