本地调试的单元测试中基于testcontainers依赖 使用docker创建tidb集群异常

【 TiDB 使用环境】测试/ Poc
【 TiDB 版本】v.6.5.4
【复现路径】做过哪些操作出现的问题
使用如下配置环境 创建tidb集群

   @ClassRule
    public static final GenericContainer<?> PD =
            new FixedHostPortGenericContainer<>("pingcap/pd:v6.5.4")
                    .withFileSystemBind("src/test/resources/config/pd.toml", "/pd.toml")
                    .withFixedExposedPort(pdPort, PD_PORT_ORIGIN)
                    .withCommand(
                            "--name=pd0",
                            "--client-urls=http://0.0.0.0:" + pdPort + ",http://0.0.0.0:2379",
                            "--peer-urls=http://0.0.0.0:2380",
                            "--advertise-client-urls=http://pd0:" + pdPort + ",http://pd0:2379",
                            "--advertise-peer-urls=http://pd0:2380",
                            "--initial-cluster=pd0=http://pd0:2380",
                            "--data-dir=/data/pd0",
                            "--config=/pd.toml",
                            "--log-file=/logs/pd0.log")
                    .withNetwork(NETWORK)
                    .withNetworkAliases(PD_SERVICE_NAME)
                    .withStartupTimeout(Duration.ofSeconds(120))
                    .withEnv("TZ", "Asia/Shanghai")
                    .withLogConsumer(new Slf4jLogConsumer(LOG));

    @ClassRule
    public static final GenericContainer<?> TIKV =
            new FixedHostPortGenericContainer<>("pingcap/tikv:v6.5.4")
                    .withFixedExposedPort(TIKV_PORT_ORIGIN, TIKV_PORT_ORIGIN)
                    .withFileSystemBind("src/test/resources/config/tikv.toml", "/tikv.toml")
                    .withCommand(
                            "--addr=0.0.0.0:20160",
                            "--advertise-addr=tikv0:20160",
                            "--data-dir=/data/tikv0",
                            "--pd=pd0:2379",
                            "--config=/tikv.toml",
                            "--log-file=/logs/tikv0.log")
                    .withNetwork(NETWORK)
                    .dependsOn(PD)
                    .withNetworkAliases(TIKV_SERVICE_NAME)
                    .withStartupTimeout(Duration.ofSeconds(120))
                    .withLogConsumer(new Slf4jLogConsumer(LOG))
                    .withEnv("TZ", "Asia/Shanghai");

    @ClassRule
    public static final GenericContainer<?> TIDB =
            new GenericContainer<>("pingcap/tidb:v6.5.4")
                    .withExposedPorts(TIDB_PORT)
                    .withFileSystemBind("src/test/resources/config/tidb.toml", "/tidb.toml")
                    .withCommand(
                            "--store=tikv",
                            "--path=pd0:2379",
                            "--config=/tidb.toml",
                            "--advertise-address=tidb0")
                    .withNetwork(NETWORK)
                    .dependsOn(TIKV)
                    .withNetworkAliases(TIDB_SERVICE_NAME)
                    .withStartupTimeout(Duration.ofSeconds(120))
                    .withEnv("TZ", "Asia/Shanghai")
                    .withLogConsumer(new Slf4jLogConsumer(LOG));
   @BeforeClass
    public static void startContainers() throws Exception {
        // Add jvm dns cache for flink to invoke pd interface.
        DnsCacheManipulator.setDnsCache(PD_SERVICE_NAME, "127.0.0.1");
        DnsCacheManipulator.setDnsCache(TIKV_SERVICE_NAME, "127.0.0.1");
        LOG.info("Starting containers...");
        Startables.deepStart(Stream.of(PD, TIKV, TIDB)).join();
        LOG.info("Containers are started.");
    }

    @AfterClass
    public static void stopContainers() {
        DnsCacheManipulator.removeDnsCache(PD_SERVICE_NAME);
        DnsCacheManipulator.removeDnsCache(TIKV_SERVICE_NAME);
        Stream.of(TIKV, PD, TIDB).forEach(GenericContainer::stop);
    }

    public String getJdbcUrl(String databaseName) {
        return "jdbc:mysql://"
                + TIDB.getContainerIpAddress()
                + ":"
                + TIDB.getMappedPort(TIDB_PORT)
                + "/"
                + databaseName;
    }

出现如下相关异常:

47141 [pool-10-thread-1] INFO  org.tikv.common.PDClient - updating leader finish
47914 [pool-10-thread-1] WARN  org.tikv.common.PDClient - updating leader or forward follower
47915 [pool-10-thread-1] WARN  org.tikv.common.PDClient - failed to get member from pd server from http://pd0:2389, caused by: UNKNOWN: Channel Pipeline: [ProtocolNegotiators$ProxyProtocolNegotiationHandler#0, WriteBufferingAndExceptionHandler#0, DefaultChannelPipeline$TailContext#0]
47998 [pool-10-thread-1] WARN  org.tikv.common.util.ConcreteBackOffer - BackOffer.maxSleep 60ms is exceeded, errors:
47998 [pool-10-thread-1] WARN  org.tikv.common.util.ConcreteBackOffer -- 0.org.tikv.shade.io.grpc.StatusRuntimeException: UNKNOWN: Channel Pipeline: [ProtocolNegotiators$ProxyProtocolNegotiationHandler#0, WriteBufferingAndExceptionHandler#0, DefaultChannelPipeline$TailContext#0]
48296 [CDC-Client-1] WARN  org.tikv.common.util.ConcreteBackOffer - BackOffer.maxSleep 5000ms is exceeded, errors:
48296 [CDC-Client-1] WARN  org.tikv.common.util.ConcreteBackOffer - 
10.org.tikv.shade.io.grpc.StatusRuntimeException: UNKNOWN: Channel Pipeline: [ProtocolNegotiators$ProxyProtocolNegotiationHandler#0, WriteBufferingAndExceptionHandler#0, DefaultChannelPipeline$TailContext#0]
11.
java.util.concurrent.CompletionException: org.tikv.common.exception.GrpcException: retry is exhausted.
	at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:273) ~[?:1.8.0_421]
	at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:280) ~[?:1.8.0_421]
	at java.util.concurrent.CompletableFuture$AsyncRun.run$$$capture(CompletableFuture.java:1643) ~[?:1.8.0_421]
	at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java) ~[?:1.8.0_421]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_421]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_421]
	at java.lang.Thread.run(Thread.java:750) [?:1.8.0_421]
Caused by: org.tikv.common.exception.GrpcException: retry is exhausted.

【遇到的问题:问题现象及影响】
无法连接pd,进行代码调试
【资源配置】

【附件:截图/日志/监控】

http://pd0:2389

把pd0改成ip试试看。