sivachinnayan / consul-cluster-setup

setup consul cluster setup
MIT License
0 stars 0 forks source link

Route Node Application Via DNS Service #8

Open sivachinnayan opened 8 years ago

sivachinnayan commented 8 years ago

Enable and Disbale Node application running on node 2 - 172.20.20.11

root@node2:/home/vagrant/express# node index.js 
^C
root@node2:/home/vagrant/express# node index.js 
^C
root@node2:/home/vagrant/express# 

Ping from LocalBox

As we can see the ping on webservice-poll switches between consul node based on the availability. That is if the health of the node is active it will return that ip else return rest of ipaddres or nothing.

siva@$ ping webservice-poll.service.consul
PING webservice-poll.service.consul (172.20.20.12) 56(84) bytes of data.
64 bytes from 172.20.20.12: icmp_seq=1 ttl=64 time=0.132 ms
64 bytes from 172.20.20.12: icmp_seq=2 ttl=64 time=0.191 ms
64 bytes from 172.20.20.12: icmp_seq=3 ttl=64 time=0.168 ms
^C
--- webservice-poll.service.consul ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2000ms
rtt min/avg/max/mdev = 0.132/0.163/0.191/0.028 ms
siva@$ ping webservice-poll.service.consul
PING webservice-poll.service.consul (172.20.20.12) 56(84) bytes of data.
64 bytes from 172.20.20.12: icmp_seq=1 ttl=64 time=0.150 ms
64 bytes from 172.20.20.12: icmp_seq=2 ttl=64 time=0.215 ms
^C
--- webservice-poll.service.consul ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1000ms
rtt min/avg/max/mdev = 0.150/0.182/0.215/0.035 ms
siva@$ ping webservice-poll.service.consul
PING webservice-poll.service.consul (172.20.20.11) 56(84) bytes of data.
64 bytes from 172.20.20.11: icmp_seq=1 ttl=64 time=0.172 ms
64 bytes from 172.20.20.11: icmp_seq=2 ttl=64 time=0.154 ms
64 bytes from 172.20.20.11: icmp_seq=3 ttl=64 time=0.212 ms
^C
--- webservice-poll.service.consul ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2000ms
rtt min/avg/max/mdev = 0.154/0.179/0.212/0.026 ms

siva@$ ping webservice-poll.service.consul
PING webservice-poll.service.consul (172.20.20.12) 56(84) bytes of data.
64 bytes from 172.20.20.12: icmp_seq=1 ttl=64 time=0.142 ms
64 bytes from 172.20.20.12: icmp_seq=2 ttl=64 time=0.149 ms
64 bytes from 172.20.20.12: icmp_seq=3 ttl=64 time=0.144 ms
^C
--- webservice-poll.service.consul ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2000ms
rtt min/avg/max/mdev = 0.142/0.145/0.149/0.003 ms
siva@$ 
sivachinnayan commented 8 years ago

screenshot from 2016-08-26 11 39 33 screenshot from 2016-08-26 11 39 42