docker-compose.yml
version: '3.8'
services:
cassandra-1:
image: cassandra:latest
restart: unless-stopped
ports:
- "7000:7000"
- "9042:9042"
volumes:
# - /opt/module/docker-compose/cassandra.yaml:/opt/cassandra/conf/cassandra.yaml 配置文件
- ./cassandra-1/cassandra:/var/lib/cassandra
environment:
- CASSANDRA_BROADCAST_ADDRESS=cassandra-1
cassandra-2:
image: cassandra:latest
restart: unless-stopped
ports:
- "7001:7000"
- "9043:9042"
depends_on:
- cassandra-1
volumes:
# - /opt/module/docker-compose/cassandra.yaml:/opt/cassandra/conf/cassandra.yaml
- ./cassandra-2/cassandra:/var/lib/cassandra
environment:
- CASSANDRA_BROADCAST_ADDRESS=cassandra-2
- CASSANDRA_SEEDS=cassandra-1
cassandra-3:
image: cassandra:latest
restart: unless-stopped
ports:
- "7002:7000"
- "9044:9042"
depends_on:
- cassandra-2
volumes:
# - /opt/module/docker-compose/cassandra.yaml:/opt/cassandra/conf/cassandra.yaml
- ./cassandra-3/cassandra:/var/lib/cassandra
environment:
- CASSANDRA_BROADCAST_ADDRESS=cassandra-3
- CASSANDRA_SEEDS=cassandra-1
如果win下提示: Maximum number of memory map areas per process (vm.max_map_count) 262144 is too low, recommended value: 1048575, you can change it with sysctl.
: wsl -d docker-desktop sh -c "sysctl -w vm.max_map_count=262144"