vangoleo commented on issue #1441: how to use dubbo in docker
URL: 
https://github.com/apache/incubator-dubbo/issues/1441#issuecomment-375553630
 
 
   @463535160 I have worked with Dubbo, Docker and k8s, and maybe I can give 
you some suggestion.
   As far as I know, Dubbo is just a container engine, with very simple network 
ability. If you just use Docker itself, the only way to implement interaction 
between multiple container on different machines, is to use the Host network 
mode. The container will share the Host's IP and Port. Dubbo will register the 
IP of Host to the registry(e.g. zookeeper). 
   The above solution has a problem, the container share the Host's IP and 
port, so every container must have different ports, which lead to extra 
configuration work. Meanwhile, it is hard to implement auto scaling.
   Docker is not designed to resolve these problems, and here comes the 
container Orchestration tools, for example, Docker swarm, Google 
Kubernetes(k8s).
   In k8s, we can use some network component to setup a virtual network:
   * each container has an unique IP, which is called Pod IP
   * any two container can communicate with each other directly, even they are 
in different hosts.
   I use Flannel to implement above network.
   So if you deploy a containerized dubbo application to k8s cluster, the app 
will register the Pod IP to Zookeeper. When a new container is deployed to k8s, 
k8s will assign a Pod IP to it, and ensure the Pod IP is unique, and it can 
reach to all the other containers directly in the k8s cluster. So when you want 
to scale up, you just need to deploy new container to k8s. In fact, just one 
command in k8s. 
   
   So in k8s cluster:
   * service registration and discovery is implemented by Dubbo(zookeeper) 
itself.
   * the network communication is implemented by k8s(flanneld).
   
   
   You also mentioned the DNS, k8s also have a DNS plugin, out of box. The DNS 
is used to map a k8s service name to a k8s service IP, also known as Cluster 
IP. The Service is in fact a load balancer in the front of several container 
replicas. So you can use a readable service name, for example, zookeeper to 
visit the zookeeper cluster, instead of the Service IP.
    If you are interested in these, you can find more details by your self. Or 
you can have a look at my wiki:
   https://github.com/vangoleo/wiki/tree/master/k8s   
   
   Hope this may help you.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to