Search code examples
dockerdocker-machinedocker-swarm

How can I make an overlay network in docker without using docker-machine commands


Docker documentation explains how to make an overlay network using the command

eval $(docker-machine -swarm master)
docker network create -d overlay test-overlay

The problem is thet I am not using docker-machine to setup my cluster. When I try to create an overlay network I get an error.

Command that is executed on my swarm master (listening on port 4000)

docker -H :4000 network create -d overlay test-overlay

The exception I get when executing the command

Error response from daemon: 500 Internal Server Error: failed to parse pool request for address space "GlobalDefault" pool "" subpool "": cannot find address space GlobalDefault (most likely the backing datastore is not configured)

Solution

  • As the error said, you need a backing datastore.

    • You need to setup at least a key-value store, for example consul or etcd.
    • In case of using consul, you need to run your docker daemon with --cluster-store consul://<your consul ip>:8500 --cluster-advertise eth0:4000. I assume that you use eth0 as the network interface for your docker daemon.