Docker Community Forums

Share and learn in the Docker community.

Services are not showing up in "docker-compose ps"

Hi,

Setup details:

RHEL 7.9
Docker version 20.10.6, build 370c289
docker-compose version 1.29.2, build 5becea4c
Cassandra - 3.11.5 (3 Node cluster using docker-compose)

When I am deploying below yml file with docker-compose, out of 4 sevices, i am unable to see 3 services “cas-1, cas-2, cas-3” in “docker-compose ps” output:

yml file :

[root@RHEL7U9-AW io-tool-demo]# cat demo.yml
version: "3.9"

services:

  cas-1:
    image: cassandra:latest
    volumes:
      - ./CAS_1/db:/var/lib/cassandra
      - ./cassandra-init.sh:/cassandra-init.sh
    command: "sh /cassandra-init.sh"
    environment:
      - CASSANDRA_SEEDS=cas-1,cas-2,cas-3
      - CASSANDRA_CLUSTER_NAME=TestCluster
      - CASSANDRA_DC=se1
      - CASSANDRA_PASSWORD_SEEDER=yes
      - CASSANDRA_PASSWORD=password123

  cas-2:
    image: cassandra:latest
    volumes:
      - ./CAS_2/db:/var/lib/cassandra
    environment:
      - CASSANDRA_SEEDS=cas-1,cas-2,cas-3
      - CASSANDRA_CLUSTER_NAME=TestCluster
      - CASSANDRA_DC=se1
      - CASSANDRA_PASSWORD_SEEDER=yes
      - CASSANDRA_PASSWORD=password123

  cas-3:
    image: cassandra:latest
    volumes:
      - ./CAS_3/db:/var/lib/cassandra
    environment:
      - CASSANDRA_SEEDS=cas-1,cas-2,cas-3
      - CASSANDRA_CLUSTER_NAME=TestCluster
      - CASSANDRA_DC=se1
      - CASSANDRA_PASSWORD_SEEDER=yes
      - CASSANDRA_PASSWORD=password123

  sysb:
   image: sysbench_ycsb:1.5
   restart: always
   entrypoint: /bin/bash
   stdin_open: true
   tty: true

volumes:
  CAS_1:
  CAS_2:
  CAS_3:

Starting services with yml deployment:

[root@RHEL7U9-AW io-tool-demo]# docker-compose -f demo.yml up
Creating network "io-tool-demo_default" with the default driver
Creating io-tool-demo_cas-2_1 ... done
Creating io-tool-demo_cas-3_1 ... done
Creating io-tool-demo_cas-1_1 ... done
Creating io-tool-demo_sysb_1  ... done
Attaching to io-tool-demo_cas-2_1, io-tool-demo_cas-3_1, io-tool-demo_sysb_1, io-tool-demo_cas-1_1
.
.
.

Now if you run “docker-compose ps” you will see only one service, but other three services are not visible here:

[root@RHEL7U9-AW io-tool-demo]# docker-compose ps
       Name            Command    State   Ports
-----------------------------------------------
io-tool-demo_sysb_1   /bin/bash   Up

However when i am running “docker ps” i can see all of them:

[root@RHEL7U9-AW io-tool-demo]# docker ps
CONTAINER ID   IMAGE               COMMAND                  CREATED        STATUS        PORTS                                         NAMES
18f9b238a4e1   sysbench_ycsb:1.5   "/bin/bash"              12 hours ago   Up 12 hours                                                 io-tool-demo_sysb_1
03453e1773c0   cassandra:latest    "docker-entrypoint.s…"   12 hours ago   Up 12 hours   7000-7001/tcp, 7199/tcp, 9042/tcp, 9160/tcp   io-tool-demo_cas-3_1
83e218107652   cassandra:latest    "docker-entrypoint.s…"   12 hours ago   Up 12 hours   7000-7001/tcp, 7199/tcp, 9042/tcp, 9160/tcp   io-tool-demo_cas-1_1
f8dc933801e7   cassandra:latest    "docker-entrypoint.s…"   12 hours ago   Up 12 hours   7000-7001/tcp, 7199/tcp, 9042/tcp, 9160/tcp   io-tool-demo_cas-2_1

I am not sure if there is any issue with my yml file or this is issue with docker-compose.

Any help or input is appriciated.

More logs can be found in the uploaded log file:

Thanks.