# Deploying Dgraph to Docker Swarm

**URL:** <https://discuss.dgraph.io/t/deploying-dgraph-to-docker-swarm/2888>\
**Category:** Users\
**Created:** [July 13, 2018, 9:06pm UTC](https://discuss.dgraph.io/t/deploying-dgraph-to-docker-swarm/2888 "2018-07-13T21:06:13Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![margallardo](https://avatars.discourse-cdn.com/v4/letter/m/e36b37/32.png) [@margallardo](https://discuss.dgraph.io/u/margallardo)\
**Post date:** [July 13, 2018, 9:06pm UTC](https://discuss.dgraph.io/t/deploying-dgraph-to-docker-swarm/2888/1 "2018-07-13T21:06:13Z")

</div>

I am deploying a simple configuration to docker swarm and I am having issues. Initially I thought I might have port issues, so I decided to just deploy to a single server and still seems to be a problem with the connections.

I am using dgraph/latest which should now map to 1.0.6

Following is the docker-compose.yml I am using:

version: “3”  
networks:  
dgraph:  
services:  
zero:  
image: dgraph/dgraph:latest  
volumes:  
- /home/docker:/dgraph  
ports:  
- 5080:5080  
- 6080:6080  
networks:  
- dgraph  
deploy:  
placement:  
constraints:  
- node.hostname == ip-172-31-38-132.ec2.internal  
command: dgraph zero --my=zero:5080  
server\_1:  
image: dgraph/dgraph:latest  
hostname: “server\_1”  
volumes:  
- /home/docker:/dgraph  
ports:  
- 8080:8080  
- 9080:9080  
networks:  
- dgraph  
deploy:  
placement:  
constraints:  
- node.hostname == ip-172-31-38-132.ec2.internal  
command: dgraph server --my=server\_1:7080 --lru\_mb=2048 --zero=zero:5080  
ratel:  
image: dgraph/dgraph:latest  
hostname: “ratel”  
ports:  
- 8000:8000  
networks:  
- dgraph  
deploy:  
placement:  
constraints:  
- node.hostname == ip-172-31-38-132.ec2.internal  
command: dgraph-ratel

The errors I am seeing on the logs for zero:

Setting up grpc listener at: 0.0.0.0:5080  
Setting up http listener at: 0.0.0.0:6080  
2018/07/13 20:56:59 node.go:244: Group 0 found 1 entries  
2018/07/13 20:56:59 raft.go:567: INFO: 1 became follower at term 0  
2018/07/13 20:56:59 raft.go:315: INFO: newRaft 1 [peers: , term: 0, commit: 0, applied: 0, lastindex: 0, lastterm: 0]  
2018/07/13 20:56:59 raft.go:567: INFO: 1 became follower at term 1  
Running Dgraph zero…  
2018/07/13 20:56:59 node.go:135: Setting conf state to nodes:1  
2018/07/13 20:56:59 zero.go:333: Got connection request: addr:“server\_1:7080”  
2018/07/13 20:56:59 pool.go:161: Echo error from server\_1:7080. Err: rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = “transport: Error while dialing dial tcp: lookup server\_1 on 127.0.0.11:53: no such host”  
2018/07/13 20:56:59 pool.go:108: == CONNECT ==\> Setting server\_1:7080  
2018/07/13 20:57:02 raft.go:749: INFO: 1 is starting a new election at term 1  
2018/07/13 20:57:02 raft.go:580: INFO: 1 became candidate at term 2  
2018/07/13 20:57:02 raft.go:664: INFO: 1 received MsgVoteResp from 1 at term 2  
2018/07/13 20:57:02 raft.go:621: INFO: 1 became leader at term 2  
2018/07/13 20:57:02 node.go:301: INFO: raft.node: 1 elected leader 1 at term 2  
2018/07/13 20:57:02 zero.go:441: Connected  
2018/07/13 20:57:09 oracle.go:421: No healthy connection found to leader of group 1

Any help will be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![MichelDiz](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/micheldiz/32/11873_2.png) [@MichelDiz](https://discuss.dgraph.io/u/MichelDiz)\
**Post date:** [July 13, 2018, 10:44pm UTC](https://discuss.dgraph.io/t/deploying-dgraph-to-docker-swarm/2888/2 "2018-07-13T22:44:42Z")

</div>

Your yml seems ok to me. Try to clean that folder " /home/docker".  
It can not be a connection problem because Zero can see the Server as your log report.  
This may be a remnant settings of previous attempts. Clean the folder and try again.

Ref: [https://docs.dgraph.io/get-started#docker-compose](https://docs.dgraph.io/get-started#docker-compose)

---

<div class="post-metadata">

**Author:** ![margallardo](https://avatars.discourse-cdn.com/v4/letter/m/e36b37/32.png) [@margallardo](https://discuss.dgraph.io/u/margallardo)\
**Post date:** [July 13, 2018, 11:58pm UTC](https://discuss.dgraph.io/t/deploying-dgraph-to-docker-swarm/2888/3 "2018-07-13T23:58:46Z")

</div>

I cleaned up the /home/docker file and it seems like the zero instance starts ok. However, I am not sure the server is working properly as I can see errors in the log.

Zero log:

Setting up grpc listener at: 0.0.0.0:5080  
Setting up http listener at: 0.0.0.0:6080  
2018/07/13 23:50:45 node.go:244: Group 0 found 1 entries  
2018/07/13 23:50:45 raft.go:567: INFO: 1 became follower at term 0  
2018/07/13 23:50:45 raft.go:315: INFO: newRaft 1 [peers: , term: 0, commit: 0, applied: 0, lastindex: 0, lastterm: 0]  
2018/07/13 23:50:45 raft.go:567: INFO: 1 became follower at term 1  
Running Dgraph zero…  
2018/07/13 23:50:45 node.go:135: Setting conf state to nodes:1  
2018/07/13 23:50:46 zero.go:333: Got connection request: addr:“server\_1:7080”  
2018/07/13 23:50:46 pool.go:108: == CONNECT ==\> Setting server\_1:7080  
2018/07/13 23:50:49 raft.go:749: INFO: 1 is starting a new election at term 1  
2018/07/13 23:50:49 raft.go:580: INFO: 1 became candidate at term 2  
2018/07/13 23:50:49 raft.go:664: INFO: 1 received MsgVoteResp from 1 at term 2  
2018/07/13 23:50:49 raft.go:621: INFO: 1 became leader at term 2  
2018/07/13 23:50:49 node.go:301: INFO: raft.node: 1 elected leader 1 at term 2  
2018/07/13 23:50:49 zero.go:441: Connected

Server logs:

2018/07/13 23:50:45 server.go:116: Setting Badger option: default  
2018/07/13 23:50:45 server.go:131: Setting Badger table load option: mmap  
2018/07/13 23:50:45 server.go:143: Setting Badger value log load option: mmap  
2018/07/13 23:50:45 server.go:153: Opening postings Badger DB with options: {Dir:p ValueDir:p SyncWrites:true TableLoadingMode:2 ValueLogLoadingMode:2 NumVersionsToKeep:2147483647 MaxTableSize:67108864 LevelSizeMultiplier:10 MaxLevels:7 ValueThreshold:32 NumMemtables:5 NumLevelZeroTables:5 NumLevelZeroTablesStall:10 LevelOneSize:268435456 ValueLogFileSize:1073741824 ValueLogMaxEntries:1000000 NumCompactors:3 managedTxns:false DoNotCompact:false maxBatchCount:0 maxBatchSize:0 ReadOnly:false Truncate:false}  
2018/07/13 23:50:45 groups.go:77: Current Raft Id: 0  
2018/07/13 23:50:45 gRPC server started. Listening on port 9080  
2018/07/13 23:50:45 HTTP server started. Listening on port 8080  
2018/07/13 23:50:45 worker.go:89: Worker listening at address: [::]:7080  
2018/07/13 23:50:45 pool.go:161: Echo error from zero:5080. Err: rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = “transport: Error while dialing dial tcp: lookup zero on 127.0.0.11:53: no such host”  
2018/07/13 23:50:45 pool.go:108: == CONNECT ==\> Setting zero:5080  
2018/07/13 23:50:45 groups.go:94: Error while connecting with group zero: rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = “transport: Error while dialing dial tcp: lookup zero on 127.0.0.11:53: no such host”  
2018/07/13 23:50:45 groups.go:94: Error while connecting with group zero: rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = “transport: Error while dialing dial tcp: lookup zero on 127.0.0.11:53: no such host”  
2018/07/13 23:50:45 groups.go:94: Error while connecting with group zero: rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = “transport: Error while dialing dial tcp: lookup zero on 127.0.0.11:53: no such host”  
2018/07/13 23:50:45 groups.go:94: Error while connecting with group zero: rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = “transport: Error while dialing dial tcp: lookup zero on 127.0.0.11:53: no such host”  
2018/07/13 23:50:46 groups.go:94: Error while connecting with group zero: rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = “transport: Error while dialing dial tcp: lookup zero on 127.0.0.11:53: no such host”  
2018/07/13 23:50:49 groups.go:104: Connected to group zero. Assigned group: 1  
2018/07/13 23:50:49 draft.go:150: Node ID: 1 with GroupID: 1  
2018/07/13 23:50:49 node.go:244: Group 1 found 1 entries  
2018/07/13 23:50:49 draft.go:1032: New Node for group: 1  
2018/07/13 23:50:49 raft.go:567: INFO: 1 became follower at term 0  
2018/07/13 23:50:49 raft.go:315: INFO: newRaft 1 [peers: , term: 0, commit: 0, applied: 0, lastindex: 0, lastterm: 0]  
2018/07/13 23:50:49 raft.go:567: INFO: 1 became follower at term 1  
2018/07/13 23:50:49 groups.go:159: Error while proposing initial schema: Tablet isn’t being served by this instance.  
2018/07/13 23:50:49 groups.go:721: WARNING: We don’t have address of any dgraphzero leader.  
2018/07/13 23:50:49 groups.go:490: WARNING: We don’t have address of any Zero server.  
2018/07/13 23:50:49 node.go:135: Setting conf state to nodes:1  
2018/07/13 23:50:49 raft.go:749: INFO: 1 is starting a new election at term 1  
2018/07/13 23:50:49 raft.go:580: INFO: 1 became candidate at term 2  
2018/07/13 23:50:49 raft.go:664: INFO: 1 received MsgVoteResp from 1 at term 2  
2018/07/13 23:50:49 raft.go:621: INFO: 1 became leader at term 2  
2018/07/13 23:50:49 node.go:301: INFO: raft.node: 1 elected leader 1 at term 2  
2018/07/13 23:50:49 groups.go:159: Error while proposing initial schema: Tablet isn’t being served by this instance.  
2018/07/13 23:50:49 groups.go:159: Error while proposing initial schema: Tablet isn’t being served by this instance.  
2018/07/13 23:50:49 groups.go:159: Error while proposing initial schema: Tablet isn’t being served by this instance.  
2018/07/13 23:50:49 groups.go:159: Error while proposing initial schema: Tablet isn’t being served by this instance.  
2018/07/13 23:50:50 groups.go:159: Error while proposing initial schema: Tablet isn’t being served by this instance.  
2018/07/13 23:50:50 groups.go:159: Error while proposing initial schema: Tablet isn’t being served by this instance.  
2018/07/13 23:50:50 groups.go:159: Error while proposing initial schema: Tablet isn’t being served by this instance.  
2018/07/13 23:50:50 groups.go:159: Error while proposing initial schema: Tablet isn’t being served by this instance.  
2018/07/13 23:50:50 groups.go:159: Error while proposing initial schema: Tablet isn’t being served by this instance.  
2018/07/13 23:50:50 groups.go:721: WARNING: We don’t have address of any dgraphzero leader.  
2018/07/13 23:50:50 groups.go:490: WARNING: We don’t have address of any Zero server.  
2018/07/13 23:50:50 groups.go:159: Error while proposing initial schema: Tablet isn’t being served by this instance.  
2018/07/13 23:50:50 groups.go:159: Error while proposing initial schema: Tablet isn’t being served by this instance.  
2018/07/13 23:50:50 groups.go:159: Error while proposing initial schema: Tablet isn’t being served by this instance.  
2018/07/13 23:50:50 groups.go:159: Error while proposing initial schema: Tablet isn’t being served by this instance.  
2018/07/13 23:50:50 groups.go:159: Error while proposing initial schema: Tablet isn’t being served by this instance.  
2018/07/13 23:50:51 groups.go:159: Error while proposing initial schema: Tablet isn’t being served by this instance.  
2018/07/13 23:50:51 groups.go:159: Error while proposing initial schema: Tablet isn’t being served by this instance.  
2018/07/13 23:50:51 groups.go:159: Error while proposing initial schema: Tablet isn’t being served by this instance.  
2018/07/13 23:50:51 groups.go:159: Error while proposing initial schema: Tablet isn’t being served by this instance.  
2018/07/13 23:50:51 groups.go:159: Error while proposing initial schema: Tablet isn’t being served by this instance.  
2018/07/13 23:50:51 groups.go:490: WARNING: We don’t have address of any Zero server.  
2018/07/13 23:50:51 groups.go:721: WARNING: We don’t have address of any dgraphzero leader.  
2018/07/13 23:50:51 groups.go:159: Error while proposing initial schema: Tablet isn’t being served by this instance.  
2018/07/13 23:50:51 groups.go:159: Error while proposing initial schema: Tablet isn’t being served by this instance.  
2018/07/13 23:50:51 groups.go:159: Error while proposing initial schema: Tablet isn’t being served by this instance.  
2018/07/13 23:50:51 groups.go:159: Error while proposing initial schema: Tablet isn’t being served by this instance.  
2018/07/13 23:50:51 groups.go:159: Error while proposing initial schema: Tablet isn’t being served by this instance.  
2018/07/13 23:50:52 groups.go:159: Error while proposing initial schema: Tablet isn’t being served by this instance.  
2018/07/13 23:50:52 groups.go:159: Error while proposing initial schema: Tablet isn’t being served by this instance.  
2018/07/13 23:50:52 groups.go:159: Error while proposing initial schema: Tablet isn’t being served by this instance.  
2018/07/13 23:50:52 groups.go:159: Error while proposing initial schema: Tablet isn’t being served by this instance.  
2018/07/13 23:50:52 groups.go:159: Error while proposing initial schema: Tablet isn’t being served by this instance.  
2018/07/13 23:50:52 groups.go:721: WARNING: We don’t have address of any dgraphzero leader.  
2018/07/13 23:50:52 groups.go:490: WARNING: We don’t have address of any Zero server.  
2018/07/13 23:50:52 groups.go:159: Error while proposing initial schema: Tablet isn’t being served by this instance.  
2018/07/13 23:50:52 groups.go:159: Error while proposing initial schema: Tablet isn’t being served by this instance.  
2018/07/13 23:50:52 groups.go:159: Error while proposing initial schema: Tablet isn’t being served by this instance.  
2018/07/13 23:50:52 groups.go:159: Error while proposing initial schema: Tablet isn’t being served by this instance.  
2018/07/13 23:50:52 groups.go:159: Error while proposing initial schema: Tablet isn’t being served by this instance.  
2018/07/13 23:50:53 groups.go:159: Error while proposing initial schema: Tablet isn’t being served by this instance.  
2018/07/13 23:50:53 groups.go:159: Error while proposing initial schema: Tablet isn’t being served by this instance.  
2018/07/13 23:50:53 groups.go:159: Error while proposing initial schema: Tablet isn’t being served by this instance.  
2018/07/13 23:50:53 groups.go:159: Error while proposing initial schema: Tablet isn’t being served by this instance.  
2018/07/13 23:50:53 groups.go:159: Error while proposing initial schema: Tablet isn’t being served by this instance.  
2018/07/13 23:50:53 groups.go:490: WARNING: We don’t have address of any Zero server.  
2018/07/13 23:50:53 groups.go:721: WARNING: We don’t have address of any dgraphzero leader.  
2018/07/13 23:50:53 groups.go:159: Error while proposing initial schema: Tablet isn’t being served by this instance.  
2018/07/13 23:50:53 groups.go:159: Error while proposing initial schema: Tablet isn’t being served by this instance.  
2018/07/13 23:50:53 groups.go:159: Error while proposing initial schema: Tablet isn’t being served by this instance.  
2018/07/13 23:50:53 groups.go:159: Error while proposing initial schema: Tablet isn’t being served by this instance.  
2018/07/13 23:50:53 groups.go:159: Error while proposing initial schema: Tablet isn’t being served by this instance.  
2018/07/13 23:50:54 groups.go:159: Error while proposing initial schema: Tablet isn’t being served by this instance.  
2018/07/13 23:50:54 groups.go:159: Error while proposing initial schema: Tablet isn’t being served by this instance.  
2018/07/13 23:50:54 groups.go:159: Error while proposing initial schema: Tablet isn’t being served by this instance.  
2018/07/13 23:50:54 groups.go:159: Error while proposing initial schema: Tablet isn’t being served by this instance.  
2018/07/13 23:50:54 groups.go:159: Error while proposing initial schema: Tablet isn’t being served by this instance.  
2018/07/13 23:50:54 groups.go:721: WARNING: We don’t have address of any dgraphzero leader.  
2018/07/13 23:50:54 groups.go:490: WARNING: We don’t have address of any Zero server.  
2018/07/13 23:50:54 groups.go:159: Error while proposing initial schema: Tablet isn’t being served by this instance.  
2018/07/13 23:50:54 groups.go:159: Error while proposing initial schema: Tablet isn’t being served by this instance.  
2018/07/13 23:50:54 groups.go:159: Error while proposing initial schema: Tablet isn’t being served by this instance.  
2018/07/13 23:50:54 groups.go:159: Error while proposing initial schema: Tablet isn’t being served by this instance.  
2018/07/13 23:50:54 groups.go:159: Error while proposing initial schema: Tablet isn’t being served by this instance.  
2018/07/13 23:50:55 groups.go:159: Error while proposing initial schema: Tablet isn’t being served by this instance.  
2018/07/13 23:50:55 groups.go:159: Error while proposing initial schema: Tablet isn’t being served by this instance.  
2018/07/13 23:50:55 groups.go:159: Error while proposing initial schema: Tablet isn’t being served by this instance.  
2018/07/13 23:50:55 groups.go:159: Error while proposing initial schema: Tablet isn’t being served by this instance.  
2018/07/13 23:50:55 groups.go:356: Serving tablet for: _predicate_  
2018/07/13 23:50:55 mutation.go:147: Done schema update predicate:“_predicate_” value\_type:STRING list:true  
2018/07/13 23:50:55 groups.go:494: Got address of a Zero server: zero:5080

Thanks

---

<div class="post-metadata">

**Author:** ![MichelDiz](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/micheldiz/32/11873_2.png) [@MichelDiz](https://discuss.dgraph.io/u/MichelDiz)\
**Post date:** [July 14, 2018, 12:17am UTC](https://discuss.dgraph.io/t/deploying-dgraph-to-docker-swarm/2888/4 "2018-07-14T00:17:51Z")

</div>

I do not know what it can be. Do the following. Enter this site here: [https://labs.play-with-docker.com/](https://labs.play-with-docker.com/)

Create an instance (in this case a set of instances in Swarm - I think that you can do that play.with) Then create a .yml

`touch docker-compose.yml`

Then click the “Editor” button or access via SSH itself. When you click “Editor” will appear the “Root” then click to edit “docker-compose.yml” and paste there your compose template or even the template that I passed the link.

I tested here with the Dgraph compose model and it’s working as I write this.

---

<div class="post-metadata">

**Author:** ![MichelDiz](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/micheldiz/32/11873_2.png) [@MichelDiz](https://discuss.dgraph.io/u/MichelDiz)\
**Post date:** [July 14, 2018, 12:24am UTC](https://discuss.dgraph.io/t/deploying-dgraph-to-docker-swarm/2888/5 "2018-07-14T00:24:25Z")

</div>

Please, if you wanna me to test your compose, share it via [https://gist.github.com/](https://gist.github.com/)  
To keep the syntax intact

But try yourself  
Swarm mode [https://blog.docker.com/2017/07/best-way-learn-docker-free-play-docker-pwd/](https://blog.docker.com/2017/07/best-way-learn-docker-free-play-docker-pwd/)

---

<div class="post-metadata">

**Author:** ![margallardo](https://avatars.discourse-cdn.com/v4/letter/m/e36b37/32.png) [@margallardo](https://discuss.dgraph.io/u/margallardo)\
**Post date:** [July 14, 2018, 2:18am UTC](https://discuss.dgraph.io/t/deploying-dgraph-to-docker-swarm/2888/6 "2018-07-14T02:18:02Z")

</div>

I have tried using v1.0.5 and things are working for me. It seems that the latest version has some issues.

I am going to try now deploying to multiple servers to see if that works too.

Thanks

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex007/uploads/dgraph/original/2X/2/2b38fdece2abe5814f2e51bee69d1e67fc304b0a.png) [@system](https://discuss.dgraph.io/u/system)\
**Post date:** [August 13, 2018, 2:18am UTC](https://discuss.dgraph.io/t/deploying-dgraph-to-docker-swarm/2888/7 "2018-08-13T02:18:12Z")

</div>

Closed on August 13, 2018, 2:18am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
