benchkv 如何测试tidb-docker-compose单机版?

通过https://github.com/pingcap/tidb-docker-compose.git 建立的集群,mysql登录没问题, docker ps -a

700ea5b3d197        pingcap/pd:latest            "/pd-server --name=p…"   4 hours ago         Up 4 hours          2380/tcp, 0.0.0.0:32771->2379/tcp                   tidb-docker-compose_pd0_1

于是我用benchkv -pd localhost:32771, 但是报错:

[2020/02/02 22:51:53.722 +08:00] [ERROR] [client.go:406] ["[pd] create tso stream error"] [error="rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = \"transport: Error while dialing dial tcp: lookup pd0 on 10.40.30.5:53: no such host\""] 
[stack="github.com/pingcap/log.Error\n\t/mnt/nvme/golang/go/pkg/mod/github.com/pingcap/log@v0.0.0-20191012051959-b742a5d432e9/global.go:42\ngithub.com/pingcap/pd/client.(*client).tsLoop\n\t/mnt/nvme/golang/go/pkg/mod/github.com/pingcap/pd@v1.1.0-beta.0.20191219054547-4d65bbefbc6d/client/client.go:406"]
[2020/02/02 22:51:53.722 +08:00] [FATAL] [terror.go:345] ["unexpected error"] [error="rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = \"transport: Error while dialing dial tcp: lookup pd0 on 10.40.30.5:53: no such host\""] [errorVerbose="rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = \"transport: Error while dialing dial tcp: lookup pd0 on 10.40.30.5:53: no such host\"\ngithub.com/pingcap/pd/client.(*client).tsLoop\n\t/mnt/nvme/golang/go/pkg/mod/gith

TiDB docker 只有 TiDB 的端口对外暴露了,你 benchkv 在外面是无法连接 PD 和 TiKV 的。需要做的是将 benchkv 放到同一个 docker compose 下面,参考 https://github.com/tikv/tikv/blob/master/docs/how-to/deploy/using-docker-compose.md#example