我正在运行一个3节点群集集群,并尝试使用以下命令启动服务
docker 栈部署
下面是我的撰写文件
services:
nginx:
image: nginx:latest
networks:
- til-prod-network
volumes:
- type: bind
source: /tmp/nginx/nginx.conf
target: /etc/nginx/nginx.conf
ports:
- 83:80
depends_on:
- BLUE
deploy:
replicas: 1
update_config:
parallelism: 1
delay: 10s
restart_policy:
condition: on-failure
placement:
constraints:
- node.role == manager
resources:
reservations:
memory: 4096M
limits:
memory: 4096M
BLUE:
image: dtr.xxx.xxx/cmdb:v1.26
sysctls:
net.core.somaxconn: 4096
networks:
- til-prod-network
deploy:
replicas: 2
update_config:
parallelism: 1
delay: 10s
placement:
constraints:
- node.role == worker
resources:
reservations:
memory: 2048M
limits:
memory: 2048M
networks:
til-prod-network:
external: true
但是,当我通过docker stack deploy部署它时,出现了“不受支持的选项sysctls”错误。
Docker文档也是如此。
在集群模式下运行时,我应该实现什么解决方案来修改容器内部的sysctl。
最佳答案
关于docker - 修改docker容器内的sysctl参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51378765/