cassandra creation with docker-compose

Viewed 23

I am very new to cassandra I am trying to bring up cassnadra using docker-compose but it is giving connection error for cqlsh. Can you please let me know what am I missing here and how can I run init.cql script when cassandra up, I tried with volume but not working -

  cassandra:
    image: bitnami/cassandra
    ports:
      - '9042:9042' # native protocol clients
    volumes:
      - 'cassandra_data:/bitnami'
    environment:
      - CASSANDRA_USER=cassandra
      - CASSANDRA_PASS=cassandra
      - CASSANDRA_CQL_PORT_NUMBER=9042

I can see logs in docker -

cassandra 05:12:49.12 
cassandra 05:12:49.12 Welcome to the Bitnami cassandra container
cassandra 05:12:49.13 Subscribe to project updates by watching https://github.com /bitnami/containers
cassandra 05:12:49.13 Submit issues and feature requests at https://github.com/bitnami  /containers/issues
cassandra 05:12:49.14 
cassandra 05:12:49.15 INFO  ==> ** Starting Cassandra setup **
cassandra 05:12:49.19 WARN  ==> CASSANDRA_HOST not set, defaulting to system hostname
cassandra 05:12:49.21 INFO  ==> Validating settings in CASSANDRA_* env vars..
cassandra 05:12:49.22 WARN  ==> You've not provided a password. Default password    "cassandra" will be used. For safety reasons, please provide a secure password in a  production environment.
cassandra 05:12:49.23 WARN  ==> You set the environment variable        CASSANDRA_PASSWORD=cassandra. This is the default value when bootstrapping Cassandra and    should not be used in production environments.
cassandra 05:12:49.40 INFO  ==> Initializing Cassandra database...
cassandra 05:12:50.22 INFO  ==> Deploying Cassandra from scratch
cassandra 05:12:50.22 INFO  ==> Starting Cassandra
cassandra 05:12:50.23 INFO  ==> Checking that it started up correctly
cassandra 05:14:10.63 INFO  ==> Found CQL startup log line
cassandra 05:14:12.41 INFO  ==> Nodetool reported the successful startup of Cassandra
cassandra 05:14:12.41 INFO  ==> Non-seeder node. Waiting for synchronization
cassandra 05:14:12.41 INFO  ==> Trying to access CQL server @ 6b7f5635c6cc
0 Answers
Related