cas1
anlegennetworks:
ncas:
name: ncas
services:
cas1:
container_name: cas1
image: cassandra:latest
ports:
- 9042:9042
environment:
- JVM_OPTS=-Xms1024M -Xmx1024M
- HEAP_NEWSIZE=1024M
- MAX_HEAP_SIZE=1024M
networks:
- ncas
Konsole in Container cas1
öffnen und dort die Cassandra Query Language Shell starten (cqlsh
).
create keyspace test with replication = {
'class': 'SimpleStrategy', 'replication_factor' : 1
};
use test;
create table t (
pk int,
sk int,
v int,
primary key (pk, sk)
);
insert into t(pk, sk, v) values (1, 1, 100);
insert into t(pk, sk, v) values (1, 2, 200);
select * from t where pk=1;
cas2
anlegenWichtig: Container cas1 muss bereits laufen.
networks:
ncas:
name: ncas
services:
cas1:
container_name: cas2
image: cassandra:latest
ports:
- 9043:9042
environment:
- CASSANDRA_SEEDS=cas1
- JVM_OPTS=-Xms1024M -Xmx1024M
- HEAP_NEWSIZE=1024M
- MAX_HEAP_SIZE=1024M
networks:
- ncas
cas3
anlegenWichtig: Container cas1 muss bereits laufen.
networks:
ncas:
name: ncas
services:
cas1:
container_name: cas3
image: cassandra:latest
ports:
- 9044:9042
environment:
- CASSANDRA_SEEDS=cas1
- JVM_OPTS=-Xms1024M -Xmx1024M
- HEAP_NEWSIZE=1024M
- MAX_HEAP_SIZE=1024M
networks:
- ncas