我有一个socket.io码头服务,我想使用Trafeik进行负载平衡。即使我添加了粘性会话设置,套接字连接也会在10-15秒后失败。有什么想法吗?
这是我的docker-compose.yml;
version: '3'
services:
traefik:
image: traefik:latest
command: --web --docker --docker.domain=app.test --logLevel=DEBUG
ports:
- 80:80
- 8080:8080
networks:
- mystack_default
volumes:
- /var/run/docker.sock:/var/run/docker.sock
labels:
- "traefik.port=8080"
restart: always
deploy:
placement:
constraints:
- node.role == manager
socket:
ports:
- 3000:3000
image: 'socket:latest'
deploy:
labels:
- "traefik.port=3000"
- "traefik.backend=socket"
- "traefik.frontend.rule=Host:app1.test"
- "traefik.backend.loadbalancer.stickiness=true"
- "traefik.backend.loadbalancer.sticky=true"
networks:
mystack_default:
driver: overlay