Zeros are working but alphas are not

Moved from GitHub charts/12

Posted by ruanwz:

When running helm install, alphas have following invalid address errors:

2020/03/24 13:21:01 dgraph3-dgraph-alpha-2.dgraph3-dgraph-alpha-headless.default.svc.cluster.local.:7080 is not valid address
github.com/dgraph-io/dgraph/x.AssertTruef
	/tmp/go/src/github.com/dgraph-io/dgraph/x/error.go:88
github.com/dgraph-io/dgraph/worker.StartRaftNodes
	/tmp/go/src/github.com/dgraph-io/dgraph/worker/groups.go:84
github.com/dgraph-io/dgraph/dgraph/cmd/alpha.run.func4
	/tmp/go/src/github.com/dgraph-io/dgraph/dgraph/cmd/alpha/run.go:645
runtime.goexit
	/usr/local/go/src/runtime/asm_amd64.s:1357

But everything are fine in zeros. Is that anything wrong when checking --my parameter for alpha?

I0324 12:46:54.069770       1 pool.go:160] CONNECTING to dgraph003-dgraph-zero-1.dgraph003-dgraph-zero-headless.default.svc.cluster.local.:5080

ruanwz commented :

to bypass the --my parameter checking, I changed alpha-statefulset.yaml as below, now the problem is fixed.


<             [[ `hostname` =~ -([0-9]+)$ ]] || exit 1
<             idx=${BASH_REMATCH[1]}
<             dgraph alpha --my={{ template "dgraph.alpha.fullname" . }}-$idx.{{ template "dgraph.alpha.fullname" . }}-headless.${POD_NAMESPACE}.svc.cluster.local:7080 --lru_mb {{ .Values.alpha.lru_mb }} --zero {{ template "dgraph.zero.fullname" . }}-0.{{ template "dgraph.zero.fullname" . }}-headless.${POD_NAMESPACE}.svc.cluster.local:5080
---
>             dgraph alpha --my=$(hostname -f):7080 --lru_mb {{ .Values.alpha.lru_mb }} --zero {{ template "dgraph.zero.fullname" . }}-0.{{ template "dgraph.zero.fullname" . }}-headless.${POD_NAMESPACE}.svc.cluster.local:5080

ruanwz commented :

if it still has problem, replace with ip (hostname -i) should work:

dgraph alpha --my=$(hostname -i):7080 --lru_mb {{ .Values.alpha.lru_mb }} --zero {{ template "dgraph.zero.fullname" . }}-0.{{ template "dgraph.zero.fullname" . }}-headless.${POD_NAMESPACE}.svc.cluster.local:5080