1

I create sucsessfully a swarm, with two nodes. However when I use docker-compose build && docker-compose up in order to start my project it crashes erroring out this:

ERROR: Error response from daemon: datastore for scope "global" is not initialized

It's a very very simple process:

docker run swarm create

swarm hash: 1477bcd7778d083e02a80c352d4f1b87

docker-machine create -d virtualbox --swarm --swarm-master --swarm-discovery token://1477bcd7778d083e02a80c352d4f1b87 myswarmmaster

docker-machine create -d virtualbox --swarm --swarm-discovery token://1477bcd7778d083e02a80c352d4f1b87 myremotenode1

eval $(docker-machine env --swarm myswarmmaster)

docker-compose build && docker-compose up

And then I get the error:

ERROR: Error response from daemon: datastore for scope "global" is not initialized

I'm running docker on Fedora 25.

Matheus Gontijo
  • 1,178
  • 1
  • 12
  • 29

1 Answers1

1

I had the same error when I did docker swarm init on an Ubuntu machine. What I found was that swarm tries to access port 2377 so first open up the port 2377 sudo ufw allow 2377 And now docker swarm init worked and showed a message like this

Swarm initialized: current node (sdf23fsd3f24fr3f2f) is now a manager.

To add a worker to this swarm, run the following command:

docker swarm join \
--token SW3Wwww-1-0dfsdffsdfdsfsdfdsfdfdsfdsf-dsfsdfdsfdsfdsfd \
52.15.91.31:2377

The key is make sure that appropriate ports are available. Hope this helps

Chenna V
  • 10,185
  • 11
  • 77
  • 104