docker-cassandra容器组成不返回

时间:2019-03-01 17:38:09

标签: docker cassandra

我有一个简单的docker-compose文件

 version: '3'
services:
  cassandra:
    image: "cassandra:3.11.4"
    container_name: leguan_cassandra
    ports:
      - "9042:9042"
    volumes:
      - ./build/cassandra:/var/lib/cassandra

它永远不会返回。能给我一个例子,确保cassandra准备就绪并可用后docker-compose如何返回?

预先感谢 马库斯

1 个答案:

答案 0 :(得分:0)

好的,谢谢您的回答,

使用此docker-compose.yml,现在对我有效:

version: '3'

services:
  cassandra:
    image: "cassandra:3.11.4"
    container_name: leguan_cassandra
    ports:
      - "9042:9042"
    volumes:
      - ./build/cassandra:/var/lib/cassandra
    healthcheck:
      test: ["CMD-SHELL", "[ $$(nodetool statusgossip) = running ]"]
      interval: 10s
      timeout: 5s
      retries: 50