1

I have installed 3 docker containers with this docker-composer.yml below

version: '3'
services:
nginx:
image: nginx:alpine
volumes:
- ./app:/app
- ./nginx-config/:/etc/nginx/conf.d/
ports:
- 80:80
depends_on:
- php
php:
image: php:7.1-fpm-alpine
volumes:
- ./app:/app

cassandra:
image: 'docker.io/bitnami/cassandra:3-debian-10'
ports:
- '7000:7000'
- '9042:9042'
volumes:
- ./app:/app
environment:
- CASSANDRA_SEEDS=cassandra
- CASSANDRA_PASSWORD_SEEDER=yes
- CASSANDRA_PASSWORD=cassandra

My question is how to put localhost:7000 or even localhost:9042 nothing is working. All containers is working perfectly when i run docker ps

Ahmed SEDDIK
  • 149
  • 12

1 Answers1

1

Both ports that you have tired on the browser is not HTTP port.

- '7000:7000'
- '9042:9042'

By default, Cassandra uses 7000 for cluster communication (7001 if SSL is enabled), 9042 for native protocol clients, and 7199 for JMX. The internode communication and native protocol ports are configurable in the Cassandra Configuration File. The JMX port is configurable in cassandra-env.sh (through JVM options). All ports are TCP.

Cassandra Ports

You can verify cassandra status or connectivity from the inside container or you need to install the client on the host to check connectivity.

run docker ps and copy cassandra container name, then run below command.

docker exec -it container_name bash -c "cqlsh -u cassandra -p cassandra"

You can expect output like

[cqlsh 5.0.1 | Cassandra 3.11.6 | CQL spec 3.4.4 | Native protocol v4]
Use HELP for help.
Adiii
  • 54,482
  • 7
  • 145
  • 148