[
https://issues.apache.org/jira/browse/YARN-8619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16612715#comment-16612715
]
Eric Yang commented on YARN-8619:
---------------------------------
A step by step process to create a docker overlay network cross nodes look like
this:
h2. Step 1 Configure a cluster store
Consul is a key/value pair store for docker to store cluster network states. A
simple cluster store can be deploy by running:
{code}
docker run -d -p 8500:8500 -h consul --name consul progrium/consul -server
-bootstrap
{code}
h2. Step 2 Configure docker daemon on all nodes (/etc/docker/daemon.json)
nsert cluster-advertise and cluster-store JSON to daemon.json
Note, br0 is the network interface name that should be listening for cluster
network change.
Where 172.21.195.5 is the IP address of where consul container is running.
{code}
{
"cluster-advertise" : "br0:2375",
"cluster-store" : "consul://172.21.195.5:8500"
}
{code}
h2. Step 3 restart docker daemons on all nodes
{code}
systemctl restart docker
{code}
h2. Step 4 Validate docker is running with new cluster-store
{code}
docker info
{code}
The output will have:
{code}
Cluster Store: consul://172.21.195.5:8500
Cluster Advertise: 172.21.195.6:2375
{code}
This means the docker daemon is running with external kv store.
h2. Step 5 Create a overlay network
On any of the docker node, run:
{code}
docker network create -d overlay --subnet=192.168.3.0/24 hadoop
{code}
New containers can be started using the network alias name hadoop. The
containers should be able to ping each other across hosts.
If a docker container is launched using hadoop network, there is no outbound
traffic by default, and additional network connection might need to be setup
using
{code}
docker network connect bridge [container-id]
{code}
This will provide outbound traffic to container network. Majority of the work
depends on docker daemon configuration settings being correct and external kv
store is deployed. If YARN is aware of the network configuration, it can
potentially run the last command to enable container for outbound access. I am
not quite sure if YARN should venture into configuring docker, and my
impression is that YARN shouldn't be configuring docker daemon. However, the
config might be more seamless if these procedures are automated by Ambari
installation and hand over a knob for YARN to connect overlay network with
physical network. Thoughts?
> Automate docker network configuration through YARN API
> ------------------------------------------------------
>
> Key: YARN-8619
> URL: https://issues.apache.org/jira/browse/YARN-8619
> Project: Hadoop YARN
> Issue Type: Sub-task
> Components: yarn-native-services
> Reporter: Eric Yang
> Priority: Major
> Labels: Docker
>
> Docker supports bridge, host, overlay, macvlan networking. It might be
> useful to automate docker network setup through a set of YARN API to improve
> management of docker networks. Each type of network driver requires
> different type of parameters. For Hadoop use case, it seems more useful to
> focus on macvlan networking for ease of use and configuration. It would be
> great addition to support commands like:
> {code}
> yarn network create -d macvlan \
> --subnet=172.16.86.0/24 \
> --gateway=172.16.86.1 \
> -o parent=eth0 \
> my-macvlan-net
> {code}
> This changes docker configuration to hosts managed by YARN.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]