TLDR: WORKER_TYPE=docker MASTER_NODE=x.x.x.x make setup-worker
For the Worker Node with meeting the system requirements, three steps are required:
- Hardware: 4c8g50g
- Docker engine:
- 1.10.0~1.18.6
Let Docker daemon listen on port 2375, and make sure Master can reach Worker Node through this port.
Edit systemd service config file /lib/systemd/system/docker.service, update the ExecStart line under section [Service], as the following:
[Service]
ExecStart=/usr/bin/dockerd -H fd:// -H unix:///var/run/docker.sock -H tcp://0.0.0.0:2375 --default-ulimit=nofile=8192:16384 --default-ulimit=nproc=8192:16384
Edit systemd service config file /lib/systemd/system/docker.service, update the ExecStart line under section [Service], as the following:
[Service]
ExecStart=/usr/bin/dockerd -H fd:// -H unix:///var/run/docker.sock -H tcp://0.0.0.0:2375 --default-ulimit=nofile=8192:16384 --default-ulimit=nproc=8192:16384
Regenerate the docker service script and restart the docker engine:
$ sudo systemctl daemon-reload; sudo systemctl restart docker.serviceThis will run the docker-daemon on port 2375 as long as the system is restarted or docker-daemon is killed.
$ sudo systemctl stop docker.service
$ sudo dockerd -H fd:// -H unix:///var/run/docker.sock -H tcp://0.0.0.0:2375 --default-ulimit=nofile=8192:16384 --default-ulimit=nproc=8192:16384 -D &At last, run the follow test at Master node and get OK response, to make sure it can access the Worker node successfully.
[Master] $ docker -H Worker_Node_IP:2375 infoRun the following cmd to setup the worker node by
- Install necessary software;
- Pull the necessary images;
- Use NFS to mount the storage path at Master.
$ MASTER_NODE=xx.xx.xx.xx make setup-workerIf run in standalone server (master and worker are together), then NFS is not necessary, just run
$ make setup-workerMake sure ip forward is enabled, you can simply run the follow command.
$ sysctl -w net.ipv4.ip_forward=1And check the os iptables config, to make sure host ports are open (e.g., 2375, 7050~10000)
In MacOS, Docker currently provides no support to config the daemon to listen from network.
Users need to use some tools to config Docker daemon to listen at network manually, e.g., to config Docker daemon to listen on 127.0.0.1:2375,
$ docker run -d -v /var/run/docker.sock:/var/run/docker.sock -p 127.0.0.1:2375:2375 bobrik/socat TCP-LISTEN:2375,fork UNIX-CONNECT:/var/run/docker.sock
$ docker -H 127.0.0.1:2375 infoAnd users can use 0.0.0.0 to replace 127.0.0.1 to make sure Master can reach Worker Node through this port, as Ubuntu.
$ docker run -d -v /var/run/docker.sock:/var/run/docker.sock -p 0.0.0.0:2375:2375 bobrik/socat TCP-LISTEN:2375,fork UNIX-CONNECT:/var/run/docker.sock
This work is licensed under a Creative Commons Attribution 4.0 International License.
