Let's consider simple case:
services:
elasticsearch:
image: elasticsearch:alpine
ports:
- "9200:9200"
- "9300:9300"
environment:
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
volumes:
- ./elasticsearch/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml
networks:
- backend
deploy:
replicas: 3
networks:
- backend:
driver:
overlay
We have three replicas, each service got some VirtualIP address. Please note also that these adresses are adresses of overlay network. Moreover, service_names are resolved to VirtualIP. Now, tell me please:
If VirtualIP is loadbalanced? I mean following case:
nc 10.0.0.4 9200
Behind the scene (using loadbalancing) I am redirected to10.0.0.2
(another service). What aboutnc elasticsearch_1 9200
?Is it meaningful I create three replices or three seperated services?