apache / dubbo

The java implementation of Apache Dubbo. An RPC and microservice framework.
https://dubbo.apache.org/
Apache License 2.0
40.5k stars 26.43k forks source link

内网服务连接外网阿里云上部署的100台服务启动时间超长(5分钟以上) #10763

Open liunancun opened 2 years ago

liunancun commented 2 years ago

整体架构是内网跟外网有2个zk作为注册中心,外网的服务注册到外网zk上面,内网的服务分别连接内网和外网的zk

内网服务在启动的时候时间很长,基本上要5分钟左右才能完全启动成功,想知道为什么会要这么长的时间启动?

是Spring Boot应用,Spring Boot是2.2.10.RELEASE版本,Dubbo是3.1.1版本

liunancun commented 2 years ago

2022-10-19 20:12:52.763 INFO 1 --- [NettyClientWorker-5-1] o.a.d.r.t.netty4.NettyClientHandler : [DUBBO] The connection of /172.17.0.9:51750 -> /192.168.99.176:20202 is established., dubbo version: 3.1.1, current host: 172.17.0.9 2022-10-19 20:12:52.770 INFO 1 --- [main] o.a.d.remoting.transport.AbstractClient : [DUBBO] Successfully connect to server /192.168.99.176:20202 from NettyClient 172.17.0.9 using dubbo version 3.1.1, channel is NettyChannel [channel=[id: 0x7b746cb3, L:/172.17.0.9:51750 - R:/192.168.99.176:20202]], dubbo version: 3.1.1, current host: 172.17.0.9 2022-10-19 20:12:52.770 INFO 1 --- [main] o.a.d.remoting.transport.AbstractClient : [DUBBO] Start NettyClient /172.17.0.9 connect to the server /192.168.99.176:20202, dubbo version: 3.1.1, current host: 172.17.0.9 2022-10-19 20:12:52.839 INFO 1 --- [main] o.a.d.remoting.transport.AbstractClient : [DUBBO] Successfully connect to server /192.168.99.123:20202 from NettyClient 172.17.0.9 using dubbo version 3.1.1, channel is NettyChannel [channel=[id: 0xcc74f381, L:/172.17.0.9:44734 - R:/192.168.99.123:20202]], dubbo version: 3.1.1, current host: 172.17.0.9 2022-10-19 20:12:52.839 INFO 1 --- [NettyClientWorker-5-2] o.a.d.r.t.netty4.NettyClientHandler : [DUBBO] The connection of /172.17.0.9:44734 -> /192.168.99.123:20202 is established., dubbo version: 3.1.1, current host: 172.17.0.9 2022-10-19 20:12:52.839 INFO 1 --- [main] o.a.d.remoting.transport.AbstractClient : [DUBBO] Start NettyClient /172.17.0.9 connect to the server /192.168.99.123:20202, dubbo version: 3.1.1, current host: 172.17.0.9 2022-10-19 20:12:52.842 INFO 1 --- [NettyClientWorker-5-3] o.a.d.r.t.netty4.NettyClientHandler : [DUBBO] The connection of /172.17.0.9:50534 -> /192.168.99.175:20202 is established., dubbo version: 3.1.1, current host: 172.17.0.9 2022-10-19 20:12:52.842 INFO 1 --- [main] o.a.d.remoting.transport.AbstractClient : [DUBBO] Successfully connect to server /192.168.99.175:20202 from NettyClient 172.17.0.9 using dubbo version 3.1.1, channel is NettyChannel [channel=[id: 0x8425ea63, L:/172.17.0.9:50534 - R:/192.168.99.175:20202]], dubbo version: 3.1.1, current host: 172.17.0.9

看这日志他是会去连接我外网的100台服务器吗?要等100台服务器都连接成功了才能完全启动?在这之前整个服务都是无法提供服务的,http端口也访问不了

AlbumenJ commented 2 years ago

外网 zk 的网络时延多高。Dubbo 是采用懒加载去建连接的