Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connect to cluster with docker-compose #93

Open
xn3cr0nx opened this issue Jul 3, 2020 · 1 comment
Open

Connect to cluster with docker-compose #93

xn3cr0nx opened this issue Jul 3, 2020 · 1 comment

Comments

@xn3cr0nx
Copy link

xn3cr0nx commented Jul 3, 2020

Hi everyone,

maybe I'm not getting the point, but I really cannot deal with connecting with pd deployed with docker-compose. I'm using github.com/pingcap/tidb/kv go lib, and the problem is clearly the host. I read you can set host mode to expose services but I'm on ubuntu and the docs says it's not required.

I'm getting this error you probably already expect.

[2020/07/03 09:50:55.167 +00:00] [WARN] [base_client.go:170] ["[pd] failed to get cluster id"] [url=http://pd0:2379] [error="error:rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing dial tcp: lookup pd.tikv on 127.0.0.11:53: no such host" target:pd.tikv:2379 status:TRANSIENT_FAILURE"] [errorVerbose="error:rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing dial tcp: lookup pd.tikv on 127.0.0.11:53: no such host" target:pd.tikv:2379 status:TRANSIENT_FAILURE\ngithub.com/pingcap/pd/v4/client.(*baseClient).getMembers\n\t/go/pkg/mod/github.com/pingcap/pd/[email protected]/client/base_client.go:208\ngithub.com/pingcap/pd/v4/client.(*baseClient).initClusterID\n\t/go/pkg/mod/github.com/pingcap/pd/[email protected]/client/base_client.go:167\ngithub.com/pingcap/pd/v4/client.(*baseClient).initRetry\n\t/go/pkg/mod/github.com/pingcap/pd/[email protected]/client/base_client.go:103\ngithub.com/pingcap/pd/v4/client.newBaseClient\n\t/go/pkg/mod/github.com/pingcap/pd/[email protected]/client/base_client.go:84\ngithub.com/pingcap/pd/v4/client.NewClientWithContext\n\t/go/pkg/mod/github.com/pingcap/pd/[email protected]/client/client.go:150\ngithub.com/pingcap/pd/v4/client.NewClient\n\t/go/pkg/mod/github.com/pingcap/pd/[email protected]/client/client.go:144\ngithub.com/pingcap/tidb/store/tikv.Driver.Open\n\t/go/pkg/mod/github.com/pingcap/[email protected]/store/tikv/kv.go:86\ngithub.com/xn3cr0nx/bitgodine/pkg/tikv.NewTiKV\n\t/bitgodine/pkg/tikv/tikv.go:39\ngithub.com/xn3cr0nx/bitgodine/pkg/tikv/storage.NewKV\n\t/bitgodine/pkg/tikv/storage/kv.go:34\nmain.start\n\t/bitgodine/cmd/server/serve.go:63\ngithub.com/spf13/cobra.(*Command).execute\n\t/go/pkg/mod/github.com/spf13/[email protected]/command.go:846\ngithub.com/spf13/cobra.(*Command).ExecuteC\n\t/go/pkg/mod/github.com/spf13/[email protected]/command.go:950\ngithub.com/spf13/cobra.(*Command).Execute\n\t/go/pkg/mod/github.com/spf13/[email protected]/command.go:887\nmain.Execute\n\t/bitgodine/cmd/server/root.go:33\nmain.main\n\t/bitgodine/cmd/server/main.go:4\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:203\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1373\ngithub.com/pingcap/pd/v4/client.(*baseClient).getMembers\n\t/go/pkg/mod/github.com/pingcap/pd/[email protected]/client/base_client.go:209\ngithub.com/pingcap/pd/v4/client.(*baseClient).initClusterID\n\t/go/pkg/mod/github.com/pingcap/pd/[email protected]/client/base_client.go:167\ngithub.com/pingcap/pd/v4/client.(*baseClient).initRetry\n\t/go/pkg/mod/github.com/pingcap/pd/[email protected]/client/base_client.go:103\ngithub.com/pingcap/pd/v4/client.newBaseClient\n\t/go/pkg/mod/github.com/pingcap/pd/[email protected]/client/base_client.go:84\ngithub.com/pingcap/pd/v4/client.NewClientWithContext\n\t/go/pkg/mod/github.com/pingcap/pd/[email protected]/client/client.go:150\ngithub.com/pingcap/pd/v4/client.NewClient\n\t/go/pkg/mod/github.com/pingcap/pd/[email protected]/client/client.go:144\ngithub.com/pingcap/tidb/store/tikv.Driver.Open\n\t/go/pkg/mod/github.com/pingcap/[email protected]/store/tikv/kv.go:86\ngithub.com/xn3cr0nx/bitgodine/pkg/tikv.NewTiKV\n\t/bitgodine/pkg/tikv/tikv.go:39\ngithub.com/xn3cr0nx/bitgodine/pkg/tikv/storage.NewKV\n\t/bitgodine/pkg/tikv/storage/kv.go:34\nmain.start\n\t/bitgodine/cmd/server/serve.go:63\ngithub.com/spf13/cobra.(*Command).execute\n\t/go/pkg/mod/github.com/spf13/[email protected]/command.go:846\ngithub.com/spf13/cobra.(*Command).ExecuteC\n\t/go/pkg/mod/github.com/spf13/[email protected]/command.go:950\ngithub.com/spf13/cobra.(*Command).Execute\n\t/go/pkg/mod/github.com/spf13/[email protected]/command.go:887\nmain.Execute\n\t/bitgodine/cmd/server/root.go:33\nmain.main\n\t/bitgodine/cmd/server/main.go:4\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:203\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1373"].

Why is it so hard to bootstrap the infrastructure with docker-compose and simply connect with the client?

@DanielZhangQD
Copy link
Contributor

@xn3cr0nx Yes, it's not easy with docker-compose, would you like to try the deployment with kind? Which is easy to use and you can follow the doc here https://docs.pingcap.com/tidb-in-kubernetes/v1.1/get-started#create-a-kubernetes-cluster-using-kind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants