Closed dat-trinhtien closed 8 years ago
Did it work before scaling? Are you running it using the script from the tutorial that creates Docker Machines or you run it in your own Swarm cluster?
Can you please run the commands that follow and send me the output?
docker --version
docker node ls
docker service create --name util \
--network proxy --mode global \
alpine sleep 1000000000
ID=$(docker ps -q --filter label=com.docker.swarm.service.name=util)
docker exec -it $ID apk add --update drill
docker exec -it $ID drill proxy
docker exec -it $ID drill tasks.proxy
It's work with stand alone proxy, error occur when i added directive distribute into config. it's my own swarm cluster not use docker-machine, Please wait a bit and i'll send you more info as you requested
Here's your info you need
# docker --version Docker version 1.12.2, build bb80604
# docker node ls
ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS
1pg62dqmc9r3p9bxlnlk54m8y node3 Ready Active
61cy7alv3prnivl96ibavmeju node2 Ready Active
djbb5jpksi67z3o18ozp1w1g8 * node1 Ready Active Leader
root@node1:~# docker service create --name util --network external_swarm_gn --mode global alpine sleep 1000000000 c4st634l6gbzr9eyrt4rt5cqz root@node1:~# ID=$(docker ps -q --filter label=com.docker.swarm.service.name=util) root@node1:~# docker exec -it $ID apk add --update drill fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/main/x86_64/APKINDEX.tar.gz fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/community/x86_64/APKINDEX.tar.gz (1/2) Installing ldns (1.6.17-r3) (2/2) Installing drill (1.6.17-r3) Executing busybox-1.24.2-r11.trigger OK: 5 MiB in 13 packages root@node1:~# docker exec -it $ID drill proxy ;; ->>HEADER<<- opcode: QUERY, rcode: NXDOMAIN, id: 57316 ;; flags: qr rd ra ; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0 ;; QUESTION SECTION: ;; proxy. IN A
;; ANSWER SECTION:
;; AUTHORITY SECTION: . 1768 IN SOA a.root-servers.net. nstld.verisign-grs.com. 2016101301 1800 900 604800 86400
;; ADDITIONAL SECTION:
;; Query time: 69 msec ;; SERVER: 127.0.0.11 ;; WHEN: Fri Oct 14 07:45:27 2016 ;; MSG SIZE rcvd: 98 root@node1:~# docker exec -it $ID drill tasks.proxy ;; ->>HEADER<<- opcode: QUERY, rcode: NXDOMAIN, id: 42181 ;; flags: qr rd ra ; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0 ;; QUESTION SECTION: ;; tasks.proxy. IN A
;; ANSWER SECTION:
;; AUTHORITY SECTION: . 1794 IN SOA a.root-servers.net. nstld.verisign-grs.com. 2016101301 1800 900 604800 86400
;; ADDITIONAL SECTION:
;; Query time: 22 msec ;; SERVER: 127.0.0.11 ;; WHEN: Fri Oct 14 07:45:39 2016 ;; MSG SIZE rcvd: 104 root@node1:~#
The problem is in the external_swarm_gn network. It is not set up correctly. You can see that through the drill command. The answer is in both cases 0 meaning that the util service cannot communicate with the proxy.
How did you setup Swarm? Are the ports required for networking open? Did you register Swarm using the internal or external network?
i setup three vps on the internet with ubuntu 14.04 version.
i created two network overlay
root@node1:~# docker network create --driver overlay internal_swarm_gn bqqvfx246y879c2wjtv7puezm root@node1:~# docker network create --driver overlay external_swarm_gn boytwd6xgkxpzohi0tpcoeaem
and run demo
docker service create --name go-demo-db \ --network internal_swarm_gn \ mongo
docker service create --name go-demo \ -e DB=go-demo-db \ --network external_swarm_gn \ --network internal_swarm_gn \ vfarcic/go-demo
docker service create --name gnproxy \ -p 80:80 \ -p 443:443 \ -p 8080:8080 \ --network external_swarm_gn \ -e MODE=swarm \ --replicas 3 \ -e CONSUL_ADDRESS=can't show ip:8500,CONSUL_ADDRESS=can't show ip:8500,CONSUL_ADDRESS=can't show ip:8500 \ ### i deployed consul at all node. vfarcic/docker-flow-proxy
And then, config proxy
curl "127.0.0.1:8080/v1/docker-flow-proxy/reconfigure?serviceName=go-demo&servicePath=/demo&port=8080&distribute=true"
All port are opened.
The problem is fixed. it's my fault
i used "--name gnproxy" and i am not add "-e SERVICE_NAME=gnproxy"
Thank you for your help.
Great news! I'm really glad it worked out. Sometimes the smallest problems are the hardest to find.
Hi vafarcic,
i have a problems detail bellow
curl "127.0.0.1:8080/v1/docker-flow-proxy/reconfigure?serviceName=go-demo&servicePath=/demo&port=8080&distribute=true"
{"Status":"NOK","Message":"Could not perform DNS tasks.proxy lookup","ServiceName":"go-demo","ServiceColor":"","ServicePath":["/demo"],"ServiceDomain":"","ConsulTemplateFePath":"","ConsulTemplateBePath":"","PathType":"","SkipCheck":false,"Mode":"swarm","Port":"8080","Distribute":true}
i scale proxy follow toturial step by step but it show error config. Please help me.