# Cluster not being made in dgraph

**URL:** <https://discuss.dgraph.io/t/cluster-not-being-made-in-dgraph/5802>\
**Category:** Users\
**Created:** [January 10, 2020, 11:57am UTC](https://discuss.dgraph.io/t/cluster-not-being-made-in-dgraph/5802 "2020-01-10T11:57:40Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![rsalwan98](https://avatars.discourse-cdn.com/v4/letter/r/ba8739/32.png) [@rsalwan98](https://discuss.dgraph.io/u/rsalwan98)\
**Post date:** [January 10, 2020, 11:57am UTC](https://discuss.dgraph.io/t/cluster-not-being-made-in-dgraph/5802/1 "2020-01-10T11:57:40Z")

</div>

how to make clusters in dgraph?  
After i read the documentation as given on [https://docs.dgraph.io/deploy/#cluster-setup](https://docs.dgraph.io/deploy/#cluster-setup)  
I ran the zero and it was working very well, But when try to run the server1 using the command

```auto
docker run -it -p 7080:7080 -p 8080:8080 -p 9080:9080 -v ~/server1:/dgraph dgraph/dgraph:latest dgraph alpha --lru_mb=&lt;typically one-third the RAM&gt; --zero=HOSTIPADDR:5080 --my=HOSTIPADDR:7080

```

and i mentioned by host ip address too it says

```auto
[Decoder]: Using assembly version of decoder
I0110 11:56:50.616565 1 init.go:98] 

Dgraph version : v1.1.1
Dgraph SHA-256 : 20a10e9db316b565464e0a04cea09657eebbaea3b91460ab651997ada63243cc
Commit SHA-1 : 8994a5740
Commit timestamp : 2019-12-16 18:24:50 -0800
Branch : HEAD
Go version : go1.13.5

Licensed variously under the Apache Public License 2.0 and Dgraph Community License.
Copyright 2015-2018 Dgraph Labs, Inc.

I0110 11:56:50.617431 1 run.go:511] x.Config: {PortOffset:0 QueryEdgeLimit:1000000 NormalizeNodeLimit:10000}
I0110 11:56:50.617457 1 run.go:512] x.WorkerConfig: {ExportPath:export NumPendingProposals:256 Tracing:1 MyAddr:localhost:7080 ZeroAddr:localhost:5080 RaftId:0 WhiteListedIPRanges:[] MaxRetries:-1 StrictMutations:false AclEnabled:false AbortOlderThan:5m0s SnapshotAfter:10000 ProposedGroupId:0}
I0110 11:56:50.617492 1 run.go:513] worker.Config: {PostingDir:p BadgerTables:mmap BadgerVlog:mmap WALDir:w MutationsMode:0 AuthToken: AllottedMemory:2048.0MB AccessJwtTtl:0s RefreshJwtTtl:0s AclRefreshInterval:0s}
I0110 11:56:50.617657 1 server_state.go:101] Setting Badger table load option: mmap
I0110 11:56:50.617670 1 server_state.go:113] Setting Badger value log load option: mmap
I0110 11:56:50.617687 1 server_state.go:158] Opening write-ahead log BadgerDB with options: {Dir:w ValueDir:w SyncWrites:false TableLoadingMode:1 ValueLogLoadingMode:2 NumVersionsToKeep:1 ReadOnly:false Truncate:true Logger:0x2409218 Compression:2 EventLogging:true InMemory:false MaxTableSize:67108864 LevelSizeMultiplier:10 MaxLevels:7 ValueThreshold:1048576 NumMemtables:5 BlockSize:4096 BloomFalsePositive:0.01 KeepL0InMemory:true MaxCacheSize:10485760 NumLevelZeroTables:5 NumLevelZeroTablesStall:10 LevelOneSize:268435456 ValueLogFileSize:1073741823 ValueLogMaxEntries:10000 NumCompactors:2 CompactL0OnClose:true LogRotatesToFlush:2 ZSTDCompressionLevel:15 VerifyValueChecksum:false EncryptionKey:[] EncryptionKeyRotationDuration:240h0m0s ChecksumVerificationMode:0 managedTxns:false maxBatchCount:0 maxBatchSize:0}
I0110 11:56:50.652416 1 log.go:34] All 0 tables opened in 0s
I0110 11:56:50.665140 1 server_state.go:101] Setting Badger table load option: mmap
I0110 11:56:50.665156 1 server_state.go:113] Setting Badger value log load option: mmap
I0110 11:56:50.665163 1 server_state.go:177] Opening postings BadgerDB with options: {Dir:p ValueDir:p SyncWrites:false TableLoadingMode:2 ValueLogLoadingMode:2 NumVersionsToKeep:2147483647 ReadOnly:false Truncate:true Logger:0x2409218 Compression:2 EventLogging:true InMemory:false MaxTableSize:67108864 LevelSizeMultiplier:10 MaxLevels:7 ValueThreshold:1024 NumMemtables:5 BlockSize:4096 BloomFalsePositive:0.01 KeepL0InMemory:true MaxCacheSize:1073741824 NumLevelZeroTables:5 NumLevelZeroTablesStall:10 LevelOneSize:268435456 ValueLogFileSize:1073741823 ValueLogMaxEntries:1000000 NumCompactors:2 CompactL0OnClose:true LogRotatesToFlush:2 ZSTDCompressionLevel:15 VerifyValueChecksum:false EncryptionKey:[] EncryptionKeyRotationDuration:240h0m0s ChecksumVerificationMode:0 managedTxns:false maxBatchCount:0 maxBatchSize:0}
I0110 11:56:50.699010 1 log.go:34] All 0 tables opened in 0s
I0110 11:56:50.712360 1 groups.go:105] Current Raft Id: 0x0
I0110 11:56:50.712799 1 run.go:422] gRPC server started. Listening on port 9080
I0110 11:56:50.712823 1 run.go:423] HTTP server started. Listening on port 8080
I0110 11:56:50.712853 1 worker.go:81] Worker listening at address: [::]:7080
I0110 11:56:50.813232 1 pool.go:148] CONNECTING to localhost:5080
W0110 11:56:50.815943 1 pool.go:238] Connection lost with localhost:5080. Error: rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = "transport: Error while dialing dial tcp 127.0.0.1:5080: connect: connection refused"

```

what should i do?

---

<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:** [January 10, 2020, 3:44pm UTC](https://discuss.dgraph.io/t/cluster-not-being-made-in-dgraph/5802/2 "2020-01-10T15:44:21Z")

</div>

Have you tried to run Dgraph Alpha several times in the same container?

BTW. Creating a cluster with Docker makes it easier and less error-prone using Docker Compose.

---

<div class="post-metadata">

**Author:** ![rsalwan98](https://avatars.discourse-cdn.com/v4/letter/r/ba8739/32.png) [@rsalwan98](https://discuss.dgraph.io/u/rsalwan98)\
**Post date:** [January 10, 2020, 4:07pm UTC](https://discuss.dgraph.io/t/cluster-not-being-made-in-dgraph/5802/3 "2020-01-10T16:07:20Z")

</div>

First I created the zero and then the alpha server but when I try making the second alpha server it throws an error

---

<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:** [January 10, 2020, 4:16pm UTC](https://discuss.dgraph.io/t/cluster-not-being-made-in-dgraph/5802/4 "2020-01-10T16:16:51Z")

</div>

What was the command you used for the Zero?

---

<div class="post-metadata">

**Author:** ![rsalwan98](https://avatars.discourse-cdn.com/v4/letter/r/ba8739/32.png) [@rsalwan98](https://discuss.dgraph.io/u/rsalwan98)\
**Post date:** [January 10, 2020, 4:26pm UTC](https://discuss.dgraph.io/t/cluster-not-being-made-in-dgraph/5802/5 "2020-01-10T16:26:27Z")

</div>

[https://tour.dgraph.io/intro/2/](https://tour.dgraph.io/intro/2/)  
The command that is given to start the zero server in this link

---

<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:** [January 10, 2020, 5:13pm UTC](https://discuss.dgraph.io/t/cluster-not-being-made-in-dgraph/5802/6 "2020-01-10T17:13:45Z")

</div>

This process used in the Tour means that you gonna use a single container. (Similar to [Docker Hub](https://hub.docker.com/r/dgraph/standalone)). In the commands you posted, you are not referencing the container that Zero started (so you’re using two different docker containers). Which in this case would be `docker exec -it dgraph` (Container name or ID). In the Tour example, it creates a container called “dgraph”. And uses Docker Exec to execute a second command within the same container called “dgraph”.

The second command to start the Alpha instance does not need to add ports, docker image and other Docker settings. Because these were already defined in the creation of the container.

In your case, run the “docker ps” command and see which container is running the Zero instance. Write down the container name or Docker ID and then run the command `docker exec -it {Container name or ID} dgraph alpha --lru_mb 2048 --zero localhost: 5080`.

Cheers.

---

<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:** [January 11, 2020, 5:29am UTC](https://discuss.dgraph.io/t/cluster-not-being-made-in-dgraph/5802/7 "2020-01-11T05:29:31Z")

</div>

I’ve just noticed that you may end up mixing things. The first command you’ve shared is from [https://docs.dgraph.io/deploy/#run-using-docker](https://docs.dgraph.io/deploy/#run-using-docker) which is a different approach from the Tour. If you keep just with one or another and understand it, you should be fine.

Also, you should change “HOSTIPADDR” to “localhost” or the host IP address.

---

<div class="post-metadata">

**Author:** ![rsalwan98](https://avatars.discourse-cdn.com/v4/letter/r/ba8739/32.png) [@rsalwan98](https://discuss.dgraph.io/u/rsalwan98)\
**Post date:** [January 13, 2020, 6:31am UTC](https://discuss.dgraph.io/t/cluster-not-being-made-in-dgraph/5802/8 "2020-01-13T06:31:11Z")

</div>

hi there again, i tried making the cluster using the commands given on [https://docs.dgraph.io/deploy/#run-using-docker](https://docs.dgraph.io/deploy/#run-using-docker)  
the zero server is created successfully, but when i try to create the alpha one  
[Decoder]: Using assembly version of decoder  
I0113 06:30:24.079800 1 init.go:98]

Dgraph version : v1.1.1  
Dgraph SHA-256 : 20a10e9db316b565464e0a04cea09657eebbaea3b91460ab651997ada63243cc  
Commit SHA-1 : 8994a5740  
Commit timestamp : 2019-12-16 18:24:50 -0800  
Branch : HEAD  
Go version : go1.13.5

For Dgraph official documentation, visit [https://docs.dgraph.io](https://docs.dgraph.io).  
For discussions about Dgraph , visit [http://discuss.hypermode.com](http://discuss.hypermode.com).  
To say hi to the community , visit [https://dgraph.slack.com](https://dgraph.slack.com).

Licensed variously under the Apache Public License 2.0 and Dgraph Community License.  
Copyright 2015-2018 Dgraph Labs, Inc.

I0113 06:30:24.080453 1 run.go:511] x.Config: {PortOffset:0 QueryEdgeLimit:1000000 NormalizeNodeLimit:10000}  
I0113 06:30:24.080484 1 run.go:512] x.WorkerConfig: {ExportPath:export NumPendingProposals:256 Tracing:1 MyAddr:localhost:7080 ZeroAddr:localhost:5080 RaftId:0 WhiteListedIPRanges: MaxRetries:-1 StrictMutations:false AclEnabled:false AbortOlderThan:5m0s SnapshotAfter:10000 ProposedGroupId:0}  
I0113 06:30:24.080517 1 run.go:513] worker.Config: {PostingDir:p BadgerTables:mmap BadgerVlog:mmap WALDir:w MutationsMode:0 AuthToken: AllottedMemory:2048.0MB AccessJwtTtl:0s RefreshJwtTtl:0s AclRefreshInterval:0s}  
I0113 06:30:24.080575 1 server\_state.go:101] Setting Badger table load option: mmap  
I0113 06:30:24.080586 1 server\_state.go:113] Setting Badger value log load option: mmap  
I0113 06:30:24.080598 1 server\_state.go:158] Opening write-ahead log BadgerDB with options: {Dir:w ValueDir:w SyncWrites:false TableLoadingMode:1 ValueLogLoadingMode:2 NumVersionsToKeep:1 ReadOnly:false Truncate:true Logger:0x2409218 Compression:2 EventLogging:true InMemory:false MaxTableSize:67108864 LevelSizeMultiplier:10 MaxLevels:7 ValueThreshold:1048576 NumMemtables:5 BlockSize:4096 BloomFalsePositive:0.01 KeepL0InMemory:true MaxCacheSize:10485760 NumLevelZeroTables:5 NumLevelZeroTablesStall:10 LevelOneSize:268435456 ValueLogFileSize:1073741823 ValueLogMaxEntries:10000 NumCompactors:2 CompactL0OnClose:true LogRotatesToFlush:2 ZSTDCompressionLevel:15 VerifyValueChecksum:false EncryptionKey: EncryptionKeyRotationDuration:240h0m0s ChecksumVerificationMode:0 managedTxns:false maxBatchCount:0 maxBatchSize:0}  
I0113 06:30:24.086409 1 log.go:34] All 0 tables opened in 0s  
I0113 06:30:24.093265 1 log.go:34] Replaying file id: 0 at offset: 0  
I0113 06:30:24.093288 1 log.go:34] Replay took: 4.544µs  
I0113 06:30:24.093350 1 server\_state.go:101] Setting Badger table load option: mmap  
I0113 06:30:24.093365 1 server\_state.go:113] Setting Badger value log load option: mmap  
I0113 06:30:24.093387 1 server\_state.go:177] Opening postings BadgerDB with options: {Dir:p ValueDir:p SyncWrites:false TableLoadingMode:2 ValueLogLoadingMode:2 NumVersionsToKeep:2147483647 ReadOnly:false Truncate:true Logger:0x2409218 Compression:2 EventLogging:true InMemory:false MaxTableSize:67108864 LevelSizeMultiplier:10 MaxLevels:7 ValueThreshold:1024 NumMemtables:5 BlockSize:4096 BloomFalsePositive:0.01 KeepL0InMemory:true MaxCacheSize:1073741824 NumLevelZeroTables:5 NumLevelZeroTablesStall:10 LevelOneSize:268435456 ValueLogFileSize:1073741823 ValueLogMaxEntries:1000000 NumCompactors:2 CompactL0OnClose:true LogRotatesToFlush:2 ZSTDCompressionLevel:15 VerifyValueChecksum:false EncryptionKey: EncryptionKeyRotationDuration:240h0m0s ChecksumVerificationMode:0 managedTxns:false maxBatchCount:0 maxBatchSize:0}  
I0113 06:30:24.101973 1 log.go:34] All 0 tables opened in 0s  
I0113 06:30:24.107931 1 log.go:34] Replaying file id: 0 at offset: 0  
I0113 06:30:24.107985 1 log.go:34] Replay took: 8.421µs  
I0113 06:30:24.108678 1 groups.go:105] Current Raft Id: 0x0  
I0113 06:30:24.109299 1 run.go:422] gRPC server started. Listening on port 9080  
I0113 06:30:24.109320 1 run.go:423] HTTP server started. Listening on port 8080  
I0113 06:30:24.109336 1 worker.go:81] Worker listening at address: [::]:7080  
I0113 06:30:24.209329 1 pool.go:148] CONNECTING to localhost:5080  
W0113 06:30:24.212366 1 pool.go:238] Connection lost with localhost:5080. Error: rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = “transport: Error while dialing dial tcp 127.0.0.1:5080: connect: connection refused”

what should i do? and a second query how many zero and alpha servers we need actually?

---

<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:** [January 13, 2020, 4:51pm UTC](https://discuss.dgraph.io/t/cluster-not-being-made-in-dgraph/5802/9 "2020-01-13T16:51:30Z")

</div>

Please read my penultimate comment.

---

<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:** [January 13, 2020, 5:47pm UTC](https://discuss.dgraph.io/t/cluster-not-being-made-in-dgraph/5802/10 "2020-01-13T17:47:35Z")

</div>

I made a video showing the process

But, for the doc’s part [Get started with Dgraph](https://docs.dgraph.io/deploy/#run-using-docker) it Shouldn’t be a problem.

For " [run-using-docker](https://docs.dgraph.io/deploy/#run-using-docker)" you have to put in mind that is different from

> [@rsalwan98](#):
>
> [A Tour of Dgraph](https://tour.dgraph.io/intro/2/)

In “run-using-docker” you need to know the Host IP addr and use it replacing “HOSTIPADDR”. In this approach, you are creating a container for each instance. One for Zero, two others for Alphas and one last for Ratel.

So each container needs to talk with each other.  
In the case of [A Tour of Dgraph](https://tour.dgraph.io/intro/2/), you are running a single Docker container and it can’t be mixed with “run-using-docker” approach. For that you can follow this video

[![](https://canada1.discourse-cdn.com/flex007/uploads/dgraph/original/2X/e/ea1d8eddfa345ead21b326bef0f4c8901e04a85e.jpeg "Test Docker Dgraph") ](https://www.youtube.com/watch?v=JTcL4AFy-9w&t=222)

Note: I did a mistake in the beginning. Because I did not remember that docker via VirtualBox does not allow to use the volume of the machine. Only in Native Docker. You can skip the video for 3:42 minutes (I did better, changed the url time). Also, wait until Youtube makes a better video quality.

---

<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:** [February 12, 2020, 5:47pm UTC](https://discuss.dgraph.io/t/cluster-not-being-made-in-dgraph/5802/11 "2020-02-12T17:47:39Z")

</div>

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