Initial setup help?

Hi everyone, I’m new to Dgraph and I’m trying to get the system set up. I’m currently trying to set up a non-docker system.

I’ve started the system using these commands from the documentation:
dgraph zero --my=IPADDR:5080
dgraph alpha --lru_mb=8192 --my=IPADDR:7080 --zero=localhost:5080
dgraph-ratel

dgraph zero is showing this repeatedly :
I0804 22:18:01.693687 29601 zero.go:422] Got connection request: cluster_info_only:true
I0804 22:18:01.693787 29601 zero.go:440] Connected: cluster_info_only:true

dgraph alpha is showing this :
I0804 22:15:17.552197 29637 admin.go:594] Error reading GraphQL schema: Please retry again, server is not ready to accept requests.

dgraph-ratel just says it is listening on port 8000.

dgraph-ratel_ss

When I load up IPADDR:8000 (check screenshot), I edited the port number, but I get stuck here. From the little heartbeat (green line), it looks like I am 2/3 of the way there… Can someone please help me with finishing the setup?

Thanks,
Kevin

have you added a schema anywhere yet?

I think the third check is when a schema is being served. I may be wrong on that though.

On the field “Dgraph Server URL” you have to use the HTTP port from Dgraph’s API. So you have to use 8080 - Not 6080.

When I change it to port 8080, it seems the status goes to 0/3?

I’m using the public IP address of the machine, is that correct?
IP_Address:8080

ratel_ss_8080

Have you change the Dgraph’s configs? Share the commands you have used.

Blockquote I’ve started the system using these commands from the documentation:
dgraph zero --my=IPADDR:5080
dgraph alpha --lru_mb=8192 --my=IPADDR:7080 --zero=localhost:5080
dgraph-ratel

These are the only commands I’ve run so far. I have not changed any of Dgraph’s configs.

So your configs are right. Are you running it on docker, k8s or similar? Something behind a firewall?

I am running it on an EC2 instance, non-docker, no firewall. Should I set the EC2 instance access to “everyone, everywhere”?

Yes. You should give access at least to your IP. Or try some proxying approach.

No difference :frowning:

Using the port 6080 leads to the same 2/3 green line.
Using port 8080 leads to the same 0/3 line.

Am I required to log in or something? I haven’t added/created a password for the groot user under ACL Account tab though…

This port is from Zero. You can see the green line there cuz zero also has /state. Ratel looks for that endpoint to get the state of the cluster. But it won’t find anything to query or mutate. Cuz it is on Dgraph’s binary. And it is at :8080/mutate and :8080/query.

Recheck your context. I’m pretty sure that something else is happening at your side.

No, it doesn’t.

Check for the paths

http://localhost:8080/

It should return

Dgraph browser is available for running separately using the dgraph-ratel binary

Check for state:

http://localhost:8080/state

It should return a big JSON response with the state of the cluster

Check for query:

http://localhost:8080/query

It should return

{“errors”:[{“message”:“Invalid method”,“extensions”:{“code”:“ErrorInvalidMethod”}}]}

http://localhost:8080/ returns:
Dgraph browser is available for running separately using the dgraph-ratel binary

http://localhost:8080/state returns:
{"errors":[{"message":"No membership state found","extensions":{"code":"Error"}}]}

http://localhost:8080/query returns:
{"errors":[{"message":"Invalid method","extensions":{"code":"ErrorInvalidMethod"}}]}

So it seems there is an issue with Zero’s state?

Is there a different command I need to run instead of
dgraph zero --my=IPADDR:5080 ?

No, 5080 is an internal gRPC port that the cluster uses to communicate. See https://dgraph.io/docs/deploy/ports-usage/#ports-used-by-different-nodes

Share your logs (both alphas and zeros if so)

Screenshot from my side.
Captura de Tela 2020-08-04 às 21.31.31

Can you please point me to where I could find these? I was not able to find it looking through the docs and looking through the system directories.

Logs from your terminals.

It’s saying the same thing as before - both Zero and Alpha are just repeating those respective lines

Restart both instances (all I mean) and recheck the endpoints again. Also, check if the logs stops.

Restarted all processes.
The endpoints yield the same results. The UI page is still showing the 2/3 state.
The logs do not stop anywhere, they just keep going once the repeating begins. :frowning:

Here are the logs for each process from the start, to the point where they begin repeating.

ZERO:

$ dgraph zero --my=IPADDR:5080
[Decoder]: Using assembly version of decoder
[Sentry] 2020/08/05 00:57:59 Integration installed: ContextifyFrames
[Sentry] 2020/08/05 00:57:59 Integration installed: Environment
[Sentry] 2020/08/05 00:57:59 Integration installed: Modules
[Sentry] 2020/08/05 00:57:59 Integration installed: IgnoreErrors
[Decoder]: Using assembly version of decoder
[Sentry] 2020/08/05 00:58:00 Integration installed: ContextifyFrames
[Sentry] 2020/08/05 00:58:00 Integration installed: Environment
[Sentry] 2020/08/05 00:58:00 Integration installed: Modules
[Sentry] 2020/08/05 00:58:00 Integration installed: IgnoreErrors
I0805 00:58:00.381505   30793 sentry_integration.go:48] This instance of Dgraph will send anonymous reports of panics back to Dgraph Labs via Sentry. No confidential information is sent. These reports help improve Dgraph. To opt-out, restart your instance with the --enable_sentry=false flag. For more info, see https://dgraph.io/docs/howto/#data-handling.
I0805 00:58:00.539770   30793 init.go:102]

Dgraph version   : v20.07.0
Dgraph codename  : shuri
Dgraph SHA-256   : 4cd320fc6eab163ab68602a5122a6c82c8467c2ed5ac93478d5f40d44eec71c4
Commit SHA-1     : d65e20530
Commit timestamp : 2020-07-28 15:31:37 -0700
Branch           : HEAD
Go version       : go1.14.4

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

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


I0805 00:58:00.539810   30793 run.go:108] Setting up grpc listener at: 0.0.0.0:5080
I0805 00:58:00.539942   30793 run.go:108] Setting up http listener at: 0.0.0.0:6080
badger 2020/08/05 00:58:00 INFO: All 1 tables opened in 0s
badger 2020/08/05 00:58:00 INFO: Replaying file id: 0 at offset: 1528
badger 2020/08/05 00:58:00 INFO: Replay took: 54.506µs
I0805 00:58:00.547788   30793 node.go:148] Setting raft.Config to: &{ID:1 peers:[] learners:[] ElectionTick:20 HeartbeatTick:1 Storage:0xc000122980 Applied:0 MaxSizePerMsg:262144 MaxCommittedSizePerReady:67108864 MaxUncommittedEntriesSize:0 MaxInflightMsgs:256 CheckQuorum:false PreVote:true ReadOnlyOption:0 Logger:0x2bcf318 DisableProposalForwarding:false}
I0805 00:58:00.547950   30793 node.go:317] Found hardstate: {Term:14 Vote:1 Commit:14 XXX_unrecognized:[]}
I0805 00:58:00.547982   30793 node.go:326] Group 0 found 14 entries
I0805 00:58:00.547993   30793 raft.go:448] Restarting node for dgraphzero
I0805 00:58:00.548037   30793 log.go:34] 1 became follower at term 14
I0805 00:58:00.548076   30793 log.go:34] newRaft 1 [peers: [], term: 14, commit: 14, applied: 0, lastindex: 14, lastterm: 14]
I0805 00:58:00.548169   30793 run.go:311] Running Dgraph Zero...
I0805 00:58:00.550123   30793 node.go:185] Setting conf state to nodes:1
I0805 00:58:00.550173   30793 raft.go:708] Done applying conf change at 0x1
I0805 00:58:01.548512   30793 log.go:34] 1 no leader at term 14; dropping index reading msg
I0805 00:58:02.548334   30793 log.go:34] 1 is starting a new election at term 14
I0805 00:58:02.548354   30793 log.go:34] 1 became pre-candidate at term 14
I0805 00:58:02.548363   30793 log.go:34] 1 received MsgPreVoteResp from 1 at term 14
I0805 00:58:02.548428   30793 log.go:34] 1 became candidate at term 15
I0805 00:58:02.548440   30793 log.go:34] 1 received MsgVoteResp from 1 at term 15
I0805 00:58:02.548510   30793 log.go:34] 1 became leader at term 15
I0805 00:58:02.548527   30793 log.go:34] raft.node: 1 elected leader 1 at term 15
I0805 00:58:02.548571   30793 raft.go:673] I've become the leader, updating leases.
I0805 00:58:02.548581   30793 assign.go:42] Updated Lease id: 1. Txn Ts: 1
I0805 00:58:03.098630   30793 zero.go:422] Got connection request: cluster_info_only:true
W0805 00:58:03.548638   30793 node.go:674] [0x1] Read index context timed out
I0805 00:58:03.549020   30793 zero.go:440] Connected: cluster_info_only:true
I0805 00:58:03.651766   30793 zero.go:422] Got connection request: cluster_info_only:true
I0805 00:58:03.651899   30793 zero.go:440] Connected: cluster_info_only:true

ALPHA:

$ dgraph alpha --lru_mb=8192 --my=IPADDR:7080 --zero=localhost:5080
[Decoder]: Using assembly version of decoder
[Sentry] 2020/08/05 00:58:02 Integration installed: ContextifyFrames
[Sentry] 2020/08/05 00:58:02 Integration installed: Environment
[Sentry] 2020/08/05 00:58:02 Integration installed: Modules
[Sentry] 2020/08/05 00:58:02 Integration installed: IgnoreErrors
[Decoder]: Using assembly version of decoder
[Sentry] 2020/08/05 00:58:02 Integration installed: ContextifyFrames
[Sentry] 2020/08/05 00:58:02 Integration installed: Environment
[Sentry] 2020/08/05 00:58:02 Integration installed: Modules
[Sentry] 2020/08/05 00:58:02 Integration installed: IgnoreErrors
I0805 00:58:02.814007   30819 sentry_integration.go:48] This instance of Dgraph will send anonymous reports of panics back to Dgraph Labs via Sentry. No confidential information is sent. These reports help improve Dgraph. To opt-out, restart your instance with the --enable_sentry=false flag. For more info, see https://dgraph.io/docs/howto/#data-handling.
I0805 00:58:02.814678   30819 util_ee.go:126] KeyReader instantiated of type <nil>
I0805 00:58:02.973313   30819 init.go:102]

Dgraph version   : v20.07.0
Dgraph codename  : shuri
Dgraph SHA-256   : 4cd320fc6eab163ab68602a5122a6c82c8467c2ed5ac93478d5f40d44eec71c4
Commit SHA-1     : d65e20530
Commit timestamp : 2020-07-28 15:31:37 -0700
Branch           : HEAD
Go version       : go1.14.4

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

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


I0805 00:58:02.973326   30819 run.go:654] x.Config: {PortOffset:0 QueryEdgeLimit:1000000 NormalizeNodeLimit:10000 PollInterval:1s GraphqlExtension:true}
I0805 00:58:02.973361   30819 run.go:655] x.WorkerConfig: {ExportPath:export NumPendingProposals:256 Tracing:0.01 MyAddr:IPADDR:7080 ZeroAddr:[localhost:5080] RaftId:0 WhiteListedIPRanges:[] MaxRetries:-1 StrictMutations:false AclEnabled:false AbortOlderThan:5m0s SnapshotAfter:10000 ProposedGroupId:0 StartTime:2020-08-05 00:58:02.489837768 +0000 UTC m=+0.011058443 LudicrousMode:false EncryptionKey:**** LogRequest:0}
I0805 00:58:02.973388   30819 run.go:656] worker.Config: {PostingDir:p BadgerTables:mmap BadgerVlog:mmap BadgerCompressionLevel:3 WALDir:w MutationsMode:0 AuthToken: AllottedMemory:8192 HmacSecret:**** AccessJwtTtl:0s RefreshJwtTtl:0s AclRefreshInterval:0s}
I0805 00:58:02.973425   30819 server_state.go:78] Setting Badger Compression Level: 3
I0805 00:58:02.973438   30819 server_state.go:87] Setting Badger table load option: mmap
I0805 00:58:02.973446   30819 server_state.go:99] Setting Badger value log load option: mmap
I0805 00:58:02.973460   30819 server_state.go:144] Opening write-ahead log BadgerDB with options: {Dir:w ValueDir:w SyncWrites:false TableLoadingMode:1 ValueLogLoadingMode:2 NumVersionsToKeep:1 ReadOnly:false Truncate:true Logger:0x2bcf318 Compression:2 InMemory:false MaxTableSize:67108864 LevelSizeMultiplier:10 MaxLevels:7 ValueThreshold:1048576 NumMemtables:5 BlockSize:4096 BloomFalsePositive:0.01 KeepL0InMemory:false MaxCacheSize:10485760 MaxBfCacheSize:0 LoadBloomsOnOpen:false NumLevelZeroTables:5 NumLevelZeroTablesStall:10 LevelOneSize:268435456 ValueLogFileSize:1073741823 ValueLogMaxEntries:10000 NumCompactors:2 CompactL0OnClose:true LogRotatesToFlush:2 ZSTDCompressionLevel:3 VerifyValueChecksum:false EncryptionKey:[] EncryptionKeyRotationDuration:240h0m0s BypassLockGuard:false ChecksumVerificationMode:0 DetectConflicts:false KeepBlockIndicesInCache:false KeepBlocksInCache:false managedTxns:false maxBatchCount:0 maxBatchSize:0}
I0805 00:58:02.977136   30819 log.go:34] All 0 tables opened in 0s
I0805 00:58:02.979160   30819 log.go:34] Replaying file id: 0 at offset: 0
I0805 00:58:02.979176   30819 log.go:34] Replay took: 3.672µs
I0805 00:58:02.979247   30819 server_state.go:78] Setting Badger Compression Level: 3
I0805 00:58:02.979261   30819 server_state.go:87] Setting Badger table load option: mmap
I0805 00:58:02.979270   30819 server_state.go:99] Setting Badger value log load option: mmap
I0805 00:58:02.979280   30819 server_state.go:168] Opening postings BadgerDB with options: {Dir:p ValueDir:p SyncWrites:false TableLoadingMode:2 ValueLogLoadingMode:2 NumVersionsToKeep:2147483647 ReadOnly:false Truncate:true Logger:0x2bcf318 Compression:2 InMemory:false MaxTableSize:67108864 LevelSizeMultiplier:10 MaxLevels:7 ValueThreshold:1024 NumMemtables:5 BlockSize:4096 BloomFalsePositive:0.01 KeepL0InMemory:false MaxCacheSize:1073741824 MaxBfCacheSize:524288000 LoadBloomsOnOpen:false NumLevelZeroTables:5 NumLevelZeroTablesStall:10 LevelOneSize:268435456 ValueLogFileSize:1073741823 ValueLogMaxEntries:1000000 NumCompactors:2 CompactL0OnClose:true LogRotatesToFlush:2 ZSTDCompressionLevel:3 VerifyValueChecksum:false EncryptionKey:[] EncryptionKeyRotationDuration:240h0m0s BypassLockGuard:false ChecksumVerificationMode:0 DetectConflicts:false KeepBlockIndicesInCache:true KeepBlocksInCache:true managedTxns:false maxBatchCount:0 maxBatchSize:0}
I0805 00:58:02.994535   30819 log.go:34] All 0 tables opened in 0s
I0805 00:58:02.996086   30819 log.go:34] Replaying file id: 0 at offset: 0
I0805 00:58:02.996103   30819 log.go:34] Replay took: 3.222µs
I0805 00:58:02.996541   30819 groups.go:107] Current Raft Id: 0x0
I0805 00:58:02.996620   30819 worker.go:97] Worker listening at address: [::]:7080
I0805 00:58:02.997595   30819 run.go:524] Bringing up GraphQL HTTP API at 0.0.0.0:8080/graphql
I0805 00:58:02.997608   30819 run.go:525] Bringing up GraphQL HTTP admin API at 0.0.0.0:8080/admin
I0805 00:58:02.997626   30819 run.go:557] gRPC server started.  Listening on port 9080
I0805 00:58:02.997635   30819 run.go:558] HTTP server started.  Listening on port 8080
I0805 00:58:03.097400   30819 pool.go:160] CONNECTING to localhost:5080
I0805 00:58:03.549781   30819 pool.go:160] CONNECTING to IPADDR:5080
W0805 00:58:03.550798   30819 pool.go:254] Connection lost with IPADDR:5080. Error: rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = "transport: Error while dialing dial tcp: lookup IPADDR: Temporary failure in name resolution"
I0805 00:58:07.998354   30819 admin.go:594] Error reading GraphQL schema: Please retry again, server is not ready to accept requests.
I0805 00:58:13.012411   30819 admin.go:594] Error reading GraphQL schema: Please retry again, server is not ready to accept requests.
I0805 00:58:18.013169   30819 admin.go:594] Error reading GraphQL schema: Please retry again, server is not ready to accept requests.
I0805 00:58:23.013344   30819 admin.go:594] Error reading GraphQL schema: Please retry again, server is not ready to accept requests.

Why this is IPADDR? Not sure if you got, but this need to be “localhost” or something.

I copied the command from the documentation page.
I just changed it to “localhost” instead of “IPADDR” but the logs remain the same and the UI still is at 2/3.