如何跨 Multi DC 创建 Docker Scylla
How to create Docker Scylla acorss Multi DC
我在不同的数据中心有 2 个服务器。
- DC1 中第一台服务器 public IP 10.10.10.1
- DC2 中的第二台服务器 public IP 20.20.20.2
docker-为 DC1 中的第一个服务器编写如下所示:
version: '3'
services:
scylla-n1:
restart: always
image: scylladb/scylla:4.5.2
container_name: scylla-n1
command: --seeds=10.10.10.1, 20.20.20.2, scylla-n1,scylla-n2 --smp 8 --memory 16G --authenticator PasswordAuthenticator --authorizer CassandraAuthorizer
networks:
netscylla:
ipv4_address: 172.16.0.11
ports:
- 21021:9042
- 9142:9142
- 7000:7000
- 7001:7001
- 7199:7199
- 10000:10000
- 9180:9180
- 9100:9100
- 9160:9160
- 10001:10001
- 5609:5609
- 56090:56090
logging:
driver: "json-file"
options:
max-file: "1"
max-size: "1m"
scylla-n2:
restart: always
image: scylladb/scylla:4.5.2
container_name: scylla-n2
command: --seeds=scylla-n1,scylla-n2 --smp 4 --memory 8G --authenticator PasswordAuthenticator --authorizer CassandraAuthorizer
networks:
netscylla:
ipv4_address: 172.16.0.12
ports:
- 21022:9042
logging:
driver: "json-file"
options:
max-file: "1"
max-size: "1m"
networks:
netscylla:
ipam:
config:
- subnet: 172.16.0.10/24
和docker-像这样为第二个服务器编写:
version: '3'
services:
scylla-n1:
restart: always
image: scylladb/scylla:4.5.2
container_name: scylla-n1
command: --seeds=10.10.10.1, 20.20.20.2, scylla-n1,scylla-n2 --smp 8 --memory 16G --authenticator PasswordAuthenticator --authorizer CassandraAuthorizer
networks:
netscylla:
ipv4_address: 172.16.0.11
ports:
- 21021:9042
- 9142:9142
- 7000:7000
- 7001:7001
- 7199:7199
- 10000:10000
- 9180:9180
- 9100:9100
- 9160:9160
- 10001:10001
- 5609:5609
- 56090:56090
logging:
driver: "json-file"
options:
max-file: "1"
max-size: "1m"
scylla-n2:
restart: always
image: scylladb/scylla:4.5.2
container_name: scylla-n2
command: --seeds=scylla-n1,scylla-n2 --smp 4 --memory 8G --authenticator PasswordAuthenticator --authorizer CassandraAuthorizer
networks:
netscylla:
ipv4_address: 172.16.0.12
ports:
- 21022:9042
logging:
driver: "json-file"
options:
max-file: "1"
max-size: "1m"
networks:
netscylla:
ipam:
config:
- subnet: 172.16.0.10/24
是否可以在第一个服务器和第二个服务器中的 docker 中创建多节点,然后连接 scylla 两个服务器。
感谢您的帮助
经过研究并咨询了 Scylla 的产品顾问。我已经解决了问题:
Scylla arsitecture if use node in virtual must be a public cloud
source https://www.scylladb.com/product/technology/
所以docker-compose.yaml我把映射端口改成public这样的ip
version: '3'
services:
scylla-1:
restart: always
image: scylladb/scylla:4.5.2
container_name: scylla-1
command: --seeds=[Public-IP-1],[Public-IP-2] --smp 8 --memory 32G --authenticator PasswordAuthenticator --authorizer CassandraAuthorizer
ports:
- [Public-IP-1]:9042:9042
- [Public-IP-1]:9142:9142
- [Public-IP-1]:7000:7000
- [Public-IP-1]:7001:7001
- [Public-IP-1]:7199:7199
- [Public-IP-1]:10000:10000
- [Public-IP-1]:9180:9180
- [Public-IP-1]:9100:9100
- [Public-IP-1]:9160:9160
- [Public-IP-1]:10001:10001
- [Public-IP-1]:5609:5609
- [Public-IP-1]:56090:56090
logging:
driver: "json-file"
options:
max-file: "1"
max-size: "1m"
scylla-2:
restart: always
image: scylladb/scylla:4.5.2
container_name: scylla-2
command: --seeds=[Public-IP-1],[Public-IP-2] --smp 8 --memory 32G --authenticator PasswordAuthenticator --authorizer CassandraAuthorizer
ports:
- [Public-IP-2]:9042:9042
- [Public-IP-2]:9142:9142
- [Public-IP-2]:7000:7000
- [Public-IP-2]:7001:7001
- [Public-IP-2]:7199:7199
- [Public-IP-2]:10000:10000
- [Public-IP-2]:9180:9180
- [Public-IP-2]:9100:9100
- [Public-IP-2]:9160:9160
- [Public-IP-2]:10001:10001
- [Public-IP-2]:5609:5609
- [Public-IP-2]:56090:56090
logging:
driver: "json-file"
options:
max-file: "1"
max-size: "1m"
我在不同的数据中心有 2 个服务器。
- DC1 中第一台服务器 public IP 10.10.10.1
- DC2 中的第二台服务器 public IP 20.20.20.2
docker-为 DC1 中的第一个服务器编写如下所示:
version: '3'
services:
scylla-n1:
restart: always
image: scylladb/scylla:4.5.2
container_name: scylla-n1
command: --seeds=10.10.10.1, 20.20.20.2, scylla-n1,scylla-n2 --smp 8 --memory 16G --authenticator PasswordAuthenticator --authorizer CassandraAuthorizer
networks:
netscylla:
ipv4_address: 172.16.0.11
ports:
- 21021:9042
- 9142:9142
- 7000:7000
- 7001:7001
- 7199:7199
- 10000:10000
- 9180:9180
- 9100:9100
- 9160:9160
- 10001:10001
- 5609:5609
- 56090:56090
logging:
driver: "json-file"
options:
max-file: "1"
max-size: "1m"
scylla-n2:
restart: always
image: scylladb/scylla:4.5.2
container_name: scylla-n2
command: --seeds=scylla-n1,scylla-n2 --smp 4 --memory 8G --authenticator PasswordAuthenticator --authorizer CassandraAuthorizer
networks:
netscylla:
ipv4_address: 172.16.0.12
ports:
- 21022:9042
logging:
driver: "json-file"
options:
max-file: "1"
max-size: "1m"
networks:
netscylla:
ipam:
config:
- subnet: 172.16.0.10/24
和docker-像这样为第二个服务器编写:
version: '3'
services:
scylla-n1:
restart: always
image: scylladb/scylla:4.5.2
container_name: scylla-n1
command: --seeds=10.10.10.1, 20.20.20.2, scylla-n1,scylla-n2 --smp 8 --memory 16G --authenticator PasswordAuthenticator --authorizer CassandraAuthorizer
networks:
netscylla:
ipv4_address: 172.16.0.11
ports:
- 21021:9042
- 9142:9142
- 7000:7000
- 7001:7001
- 7199:7199
- 10000:10000
- 9180:9180
- 9100:9100
- 9160:9160
- 10001:10001
- 5609:5609
- 56090:56090
logging:
driver: "json-file"
options:
max-file: "1"
max-size: "1m"
scylla-n2:
restart: always
image: scylladb/scylla:4.5.2
container_name: scylla-n2
command: --seeds=scylla-n1,scylla-n2 --smp 4 --memory 8G --authenticator PasswordAuthenticator --authorizer CassandraAuthorizer
networks:
netscylla:
ipv4_address: 172.16.0.12
ports:
- 21022:9042
logging:
driver: "json-file"
options:
max-file: "1"
max-size: "1m"
networks:
netscylla:
ipam:
config:
- subnet: 172.16.0.10/24
是否可以在第一个服务器和第二个服务器中的 docker 中创建多节点,然后连接 scylla 两个服务器。 感谢您的帮助
经过研究并咨询了 Scylla 的产品顾问。我已经解决了问题:
Scylla arsitecture if use node in virtual must be a public cloud source https://www.scylladb.com/product/technology/
所以docker-compose.yaml我把映射端口改成public这样的ip
version: '3'
services:
scylla-1:
restart: always
image: scylladb/scylla:4.5.2
container_name: scylla-1
command: --seeds=[Public-IP-1],[Public-IP-2] --smp 8 --memory 32G --authenticator PasswordAuthenticator --authorizer CassandraAuthorizer
ports:
- [Public-IP-1]:9042:9042
- [Public-IP-1]:9142:9142
- [Public-IP-1]:7000:7000
- [Public-IP-1]:7001:7001
- [Public-IP-1]:7199:7199
- [Public-IP-1]:10000:10000
- [Public-IP-1]:9180:9180
- [Public-IP-1]:9100:9100
- [Public-IP-1]:9160:9160
- [Public-IP-1]:10001:10001
- [Public-IP-1]:5609:5609
- [Public-IP-1]:56090:56090
logging:
driver: "json-file"
options:
max-file: "1"
max-size: "1m"
scylla-2:
restart: always
image: scylladb/scylla:4.5.2
container_name: scylla-2
command: --seeds=[Public-IP-1],[Public-IP-2] --smp 8 --memory 32G --authenticator PasswordAuthenticator --authorizer CassandraAuthorizer
ports:
- [Public-IP-2]:9042:9042
- [Public-IP-2]:9142:9142
- [Public-IP-2]:7000:7000
- [Public-IP-2]:7001:7001
- [Public-IP-2]:7199:7199
- [Public-IP-2]:10000:10000
- [Public-IP-2]:9180:9180
- [Public-IP-2]:9100:9100
- [Public-IP-2]:9160:9160
- [Public-IP-2]:10001:10001
- [Public-IP-2]:5609:5609
- [Public-IP-2]:56090:56090
logging:
driver: "json-file"
options:
max-file: "1"
max-size: "1m"