I have bulk-loaded (offline) data into dgraph and then want to serve the data by pointing an alpha to the out/0
directory. All is fine as the alpha picks up the data and serves them. But the zero has a maxUID
of 0
.
Fetching /state
endpoint returns:
{
"counter": "xxx",
"groups": {
"1": {
"members": {
"1": {
"id": "1",
"groupId": 1,
"addr": "dgraph-alpha-0.dgraph-alpha.default.svc.cluster.local:7080",
"leader": true,
"amDead": false,
"lastUpdate": "1620734135",
"learner": false,
"clusterInfoOnly": false,
"forceGroupId": false
}
},
"tablets": {
"PREDICATE1": {
"groupId": 1,
"predicate": "PREDICATE1",
"force": false,
"onDiskBytes": "0",
"remove": false,
"readOnly": false,
"moveTs": "0",
"uncompressedBytes": "0"
},
"PREDICATE2": {
"groupId": 1,
"predicate": "PREDICATE2",
"force": false,
"onDiskBytes": "0",
"remove": false,
"readOnly": false,
"moveTs": "0",
"uncompressedBytes": "0"
}
},
"snapshotTs": "0",
"checksum": "17033103070337915579",
"checkpointTs": "0"
}
},
"zeros": {
"1": {
"id": "1",
"groupId": 0,
"addr": "dgraph-zero-0.dgraph-zero.default.svc.cluster.local:5080",
"leader": true,
"amDead": false,
"lastUpdate": "0",
"learner": false,
"clusterInfoOnly": false,
"forceGroupId": false
},
"2": {
"id": "2",
"groupId": 0,
"addr": "dgraph-zero-1.dgraph-zero.default.svc.cluster.local:5080",
"leader": false,
"amDead": false,
"lastUpdate": "0",
"learner": false,
"clusterInfoOnly": false,
"forceGroupId": false
},
"3": {
"id": "3",
"groupId": 0,
"addr": "dgraph-zero-2.dgraph-zero.default.svc.cluster.local:5080",
"leader": false,
"amDead": false,
"lastUpdate": "0",
"learner": false,
"clusterInfoOnly": false,
"forceGroupId": false
}
},
"maxUID": "0",
"maxTxnTs": "0",
"maxNsID": "0",
"maxRaftId": "1",
"removed": [],
"cid": "a86ce955-298c-47dc-af22-a3e7884cc023",
"license": {
"user": "",
"maxNodes": "18446744073709551615",
"expiryTs": "1623325664",
"enabled": true
}
}
When I point the zero node to the zw
directory that was created by the bulk-loader, then I get the expected MaxUID
:
I0511 13:49:29.169066 21 assign.go:47] Updated UID: 179410001. Txn Ts: 10001. NsID: 1.
But then, zero nodes ignore the --peer
option and all of them connect to localhost:5080
. So the three zero instances do not form a cluster. And the alpha nodes cannot connect to the zero anymore:
I0511 13:50:27.486524 17 pool.go:162] CONNECTING to dgraph-zero-0.dgraph-zero.default.svc.cluster.local:5080
I0511 13:50:27.497629 17 pool.go:162] CONNECTING to localhost:5080
W0511 13:50:27.498170 17 pool.go:267] Connection lost with localhost:5080. Error: rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing dial tcp 127.0.0.1:5080: connect: connection refused"
E0511 13:50:28.390083 17 groups.go:1177] Error during SubscribeForUpdates for prefix "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x15dgraph.graphql.schema\x00": Unable to find any servers for group: 1. closer err: <nil>
What is the approved way to serve a bulk-loaded dataset with a dgraph-ha.yaml cluster?