dockercassandracassandra-3.0

apache-cassandra-4.0.7 Dockerfile Unavailable exception


Trying to create docker image from apache-cassandra-4.0.7-bin.tar.gz but getting following error after configring keyspace

$ docker exec -it pidcss /bin/bash

$ ./cqlsh localhost -u cassandra -p cassandra

Connected to Test Cluster at localhost:9042

[cqlsh 6.0.0 | Cassandra 4.0.7 | CQL spec 3.4.5 | Native protocol v5]

Use HELP for help.

cassandra@cqlsh> CREATE KEYSPACE pid
   ...   WITH REPLICATION = { 
   ...    'class' : 'SimpleStrategy', 
   ...    'replication_factor' : 0 
   ...   };
cassandra@cqlsh> use pid
   ... ;
cassandra@cqlsh:pid> CREATE TABLE if not exists vis (parentid text, type text,  PRIMARY 
KEY (parentid));

cassandra@cqlsh:pid> describe tables;

$ ./cqlsh localhost -u cassandra -p cassandra
Connected to Test Cluster at localhost:9042
[cqlsh 6.0.0 | Cassandra 4.0.7 | CQL spec 3.4.5 | Native protocol v5]
Use HELP for help.
cassandra@cqlsh> CREATE KEYSPACE pid WITH REPLICATION = { 
'class' : 'SimpleStrategy', 
'replication_factor' : 0 
 };
cassandra@cqlsh> use pid
   ... ;
cassandra@cqlsh:pid> CREATE TABLE if not exists vis (parentid text, type text,  PRIMARY KEY (parentid));
cassandra@cqlsh:pid> describe tables;
vismenu

cassandra@cqlsh:pid> select * from vis ; NoHostAvailable: ('Unable to complete the operation against any hosts', {<Host: 127.0.0.1:9042 datacenter1>: Unavailable('Error from server: code=1000 [Unavailable exception] message="Cannot achieve consistency level ONE" info={\'consistency\': \'ONE\', \'required_replicas\': 1, \'alive_replicas\': 0}')}) cassandra@cqlsh:pid>

Any idea on what could help resolve this.

Thanks,


Solution

  • It is unclear if the docker image got pulled successfully & set up correct. At a high level the steps would look like,

    (Optional clean-up activities)

    docker kill cassandra
    docker network rm cassandra
    

    I hope that helps!