Skip to content

Connect to cluster with docker-compose #93

Open
@xn3cr0nx

Description

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/v4@v4.0.0-rc.2.0.20200520083007-2c251bd8f181/client/base_client.go:208\ngithub.com/pingcap/pd/v4/client.(*baseClient).initClusterID\n\t/go/pkg/mod/github.com/pingcap/pd/v4@v4.0.0-rc.2.0.20200520083007-2c251bd8f181/client/base_client.go:167\ngithub.com/pingcap/pd/v4/client.(*baseClient).initRetry\n\t/go/pkg/mod/github.com/pingcap/pd/v4@v4.0.0-rc.2.0.20200520083007-2c251bd8f181/client/base_client.go:103\ngithub.com/pingcap/pd/v4/client.newBaseClient\n\t/go/pkg/mod/github.com/pingcap/pd/v4@v4.0.0-rc.2.0.20200520083007-2c251bd8f181/client/base_client.go:84\ngithub.com/pingcap/pd/v4/client.NewClientWithContext\n\t/go/pkg/mod/github.com/pingcap/pd/v4@v4.0.0-rc.2.0.20200520083007-2c251bd8f181/client/client.go:150\ngithub.com/pingcap/pd/v4/client.NewClient\n\t/go/pkg/mod/github.com/pingcap/pd/v4@v4.0.0-rc.2.0.20200520083007-2c251bd8f181/client/client.go:144\ngithub.com/pingcap/tidb/store/tikv.Driver.Open\n\t/go/pkg/mod/github.com/pingcap/tidb@v1.1.0-beta.0.20200701091151-ceec9d9c63c8/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/cobra@v1.0.0/command.go:846\ngithub.com/spf13/cobra.(*Command).ExecuteC\n\t/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:950\ngithub.com/spf13/cobra.(*Command).Execute\n\t/go/pkg/mod/github.com/spf13/cobra@v1.0.0/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/v4@v4.0.0-rc.2.0.20200520083007-2c251bd8f181/client/base_client.go:209\ngithub.com/pingcap/pd/v4/client.(*baseClient).initClusterID\n\t/go/pkg/mod/github.com/pingcap/pd/v4@v4.0.0-rc.2.0.20200520083007-2c251bd8f181/client/base_client.go:167\ngithub.com/pingcap/pd/v4/client.(*baseClient).initRetry\n\t/go/pkg/mod/github.com/pingcap/pd/v4@v4.0.0-rc.2.0.20200520083007-2c251bd8f181/client/base_client.go:103\ngithub.com/pingcap/pd/v4/client.newBaseClient\n\t/go/pkg/mod/github.com/pingcap/pd/v4@v4.0.0-rc.2.0.20200520083007-2c251bd8f181/client/base_client.go:84\ngithub.com/pingcap/pd/v4/client.NewClientWithContext\n\t/go/pkg/mod/github.com/pingcap/pd/v4@v4.0.0-rc.2.0.20200520083007-2c251bd8f181/client/client.go:150\ngithub.com/pingcap/pd/v4/client.NewClient\n\t/go/pkg/mod/github.com/pingcap/pd/v4@v4.0.0-rc.2.0.20200520083007-2c251bd8f181/client/client.go:144\ngithub.com/pingcap/tidb/store/tikv.Driver.Open\n\t/go/pkg/mod/github.com/pingcap/tidb@v1.1.0-beta.0.20200701091151-ceec9d9c63c8/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/cobra@v1.0.0/command.go:846\ngithub.com/spf13/cobra.(*Command).ExecuteC\n\t/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:950\ngithub.com/spf13/cobra.(*Command).Execute\n\t/go/pkg/mod/github.com/spf13/cobra@v1.0.0/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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions