Closed WangShuangQuan-A closed 2 years ago
注册中心启动需要配置当前meta节点的ip(即是application.properties文件里配置的“DefualtDataCenter:localhost”,机房名称:metaip),如果按照默认配置为localhost,这个时候对应ip不确定是那个网卡的ip,上述描述获取了docker0这个网卡的ip。当前环境有多个网卡,但是配置中心本身获取当前机器ip的逻辑是:不指定网卡就获取第一个网卡的ip作为当前机器ip,导致localhost对应的ip和注册中心获取的当前机器ip未必一致
同样如果不使用设置localhost,通过明确修改ip设置比如DefualtDataCenter:192.168.155.60,这个样还是无法保证192.168.155.60这个ip就是注册中心内部获取的网卡对应ip
这些不一致一定会导致meta启动会有问题,因为内部获取的当前机器ip和配置的不符,导致上述选举列表不在配置范围内的情况,所以修改方式就是保证配置的ip和内部获取ip的一致
配置中心提供了网卡指定的配置,通过jvm参数指定-Dnetwork_interface_binding=你的ip的网卡名称
。这样指定了网卡,确定绑定的ip和配置的ip 192.168.155.60一致了,上述描述应该配置-Dnetwork_interface_binding=wlp2s0
就可以了
jvm参数-D可以通过修改启动脚本加入即可,后续我们可以把这个变为启动参数加入application.properties文件里配置
蟹蟹
能告知一下registry的默认注册端口是哪个嘛,我执行sofa的官方demo一直不成功
@maodou38 默认端口 9603,这里有写:https://www.sofastack.tech/projects/sofa-rpc/registry-sofa/
@khotyn 我的9063也无法注册成功 ,已经解决了网卡选择问题,ip获取没什么问题,但是sofastack的demo执行就是找不到推送
@maodou38 你有修改过 Demo 的代码吗?可以把日志打个包放上来看下。
common-error.log中的报错信息: 只是改了下start.sh中加了个选择网卡 [2020-03-17 06:43:18,191][ERROR][DataNodeChangePushTaskDataDispatcher-0][DataNodeServiceImpl] - Push dataNode list error! No data node registered! [2020-03-17 06:43:18,194][ERROR][DataNodeChangePushTaskDataDispatcher-0][DataNodeSingleTaskProcessor] - [Task] Data node SingleTask Process error! java.lang.RuntimeException: Push dataNode list error! No data node registered! at com.alipay.sofa.registry.server.meta.node.impl.DataNodeServiceImpl.pushDataNodes(DataNodeServiceImpl.java:88) at com.alipay.sofa.registry.server.meta.task.DataNodeChangePushTask.execute(DataNodeChangePushTask.java:86) at com.alipay.sofa.registry.server.meta.task.processor.DataNodeSingleTaskProcessor.process(DataNodeSingleTaskProcessor.java:41) at com.alipay.sofa.registry.server.meta.task.processor.DataNodeSingleTaskProcessor.process(DataNodeSingleTaskProcessor.java:32) at com.alipay.sofa.registry.task.batcher.TaskExecutors$WorkerRunnable.run(TaskExecutors.java:136) at java.lang.Thread.run(Thread.java:748) [2020-03-17 06:43:18,194][ERROR][DataNodeChangePushTaskSessionDispatcher-17][SessionNodeServiceImpl] - Push sessionNode list error! No session node connected! [2020-03-17 06:43:18,221][ERROR][DataNodeChangePushTaskSessionDispatcher-17][DataNodeSingleTaskProcessor] - [Task] Data node SingleTask Process error! java.lang.RuntimeException: Push sessionNode list error! No session node connected! at com.alipay.sofa.registry.server.meta.node.impl.SessionNodeServiceImpl.pushDataNodes(SessionNodeServiceImpl.java:131) at com.alipay.sofa.registry.server.meta.task.DataNodeChangePushTask.execute(DataNodeChangePushTask.java:81) at com.alipay.sofa.registry.server.meta.task.processor.DataNodeSingleTaskProcessor.process(DataNodeSingleTaskProcessor.java:41) at com.alipay.sofa.registry.server.meta.task.processor.DataNodeSingleTaskProcessor.process(DataNodeSingleTaskProcessor.java:32) at com.alipay.sofa.registry.task.batcher.TaskExecutors$WorkerRunnable.run(TaskExecutors.java:136) at java.lang.Thread.run(Thread.java:748) [2020-03-17 06:43:21,536][ERROR][DataNodeChangePushTaskSessionDispatcher-18][SessionNodeServiceImpl] - Push sessionNode list error! No session node connected! [2020-03-17 06:43:21,536][ERROR][DataNodeChangePushTaskSessionDispatcher-18][DataNodeSingleTaskProcessor] - [Task] Data node SingleTask Process error! java.lang.RuntimeException: Push sessionNode list error! No session node connected! at com.alipay.sofa.registry.server.meta.node.impl.SessionNodeServiceImpl.pushDataNodes(SessionNodeServiceImpl.java:131) at com.alipay.sofa.registry.server.meta.task.DataNodeChangePushTask.execute(DataNodeChangePushTask.java:81) at com.alipay.sofa.registry.server.meta.task.processor.DataNodeSingleTaskProcessor.process(DataNodeSingleTaskProcessor.java:41) at com.alipay.sofa.registry.server.meta.task.processor.DataNodeSingleTaskProcessor.process(DataNodeSingleTaskProcessor.java:32) at com.alipay.sofa.registry.task.batcher.TaskExecutors$WorkerRunnable.run(TaskExecutors.java:136) at java.lang.Thread.run(Thread.java:748) [2020-03-17 06:43:21,561][ERROR][main][RegistryApplication] - localhost:9622 health check failed. javax.ws.rs.InternalServerErrorException: HTTP 500 Internal Server Error at org.glassfish.jersey.client.JerseyInvocation.convertToException(JerseyInvocation.java:1098) at org.glassfish.jersey.client.JerseyInvocation.translate(JerseyInvocation.java:883) at org.glassfish.jersey.client.JerseyInvocation.lambda$invoke$1(JerseyInvocation.java:767) at org.glassfish.jersey.internal.Errors.process(Errors.java:316) at org.glassfish.jersey.internal.Errors.process(Errors.java:298) at org.glassfish.jersey.internal.Errors.process(Errors.java:229) at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:414) at org.glassfish.jersey.client.JerseyInvocation.invoke(JerseyInvocation.java:765) at org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.java:428) at org.glassfish.jersey.client.JerseyInvocation$Builder.get(JerseyInvocation.java:324) at com.alipay.sofa.registry.server.integration.RegistryApplication.nodeHealthCheck(RegistryApplication.java:134) at com.alipay.sofa.registry.server.integration.RegistryApplication.waitClusterStart(RegistryApplication.java:119) at com.alipay.sofa.registry.server.integration.RegistryApplication.main(RegistryApplication.java:80) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) at org.springframework.boot.loader.Launcher.launch(Launcher.java:51) at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:52) [2020-03-17 06:43:21,561][ERROR][main][RegistryApplication] - localhost:9622 health check failed. [2020-03-17 06:43:25,235][ERROR][ReceiveStatusConfirmNotifyTaskDispatcher-0][BoltServer] - Bolt Server sendSync message RemotingException! target url:Origin url [10.140.0.7:41122], Unique key [10.140.0.7:41122]. com.alipay.remoting.rpc.exception.InvokeTimeoutException: Rpc invocation timeout[responseCommand TIMEOUT]! the address is 10.140.0.7:41122 at com.alipay.remoting.rpc.RpcResponseResolver.preProcess(RpcResponseResolver.java:83) at com.alipay.remoting.rpc.RpcResponseResolver.resolveResponseObject(RpcResponseResolver.java:54) at com.alipay.remoting.rpc.RpcRemoting.invokeSync(RpcRemoting.java:186) at com.alipay.remoting.rpc.RpcServerRemoting.invokeSync(RpcServerRemoting.java:67) at com.alipay.remoting.rpc.RpcServer.invokeSync(RpcServer.java:541) at com.alipay.sofa.registry.remoting.bolt.BoltServer.sendSync(BoltServer.java:251) at com.alipay.sofa.registry.server.meta.remoting.DataNodeExchanger.request(DataNodeExchanger.java:62) at com.alipay.sofa.registry.server.meta.node.impl.DataNodeServiceImpl.notifyStatusConfirm(DataNodeServiceImpl.java:175) at com.alipay.sofa.registry.server.meta.task.ReceiveStatusConfirmNotifyTask.execute(ReceiveStatusConfirmNotifyTask.java:57) at com.alipay.sofa.registry.server.meta.task.processor.DataNodeSingleTaskProcessor.process(DataNodeSingleTaskProcessor.java:41) at com.alipay.sofa.registry.server.meta.task.processor.DataNodeSingleTaskProcessor.process(DataNodeSingleTaskProcessor.java:32) at com.alipay.sofa.registry.task.batcher.TaskExecutors$WorkerRunnable.run(TaskExecutors.java:136) at java.lang.Thread.run(Thread.java:748) [2020-03-17 06:43:25,235][ERROR][ReceiveStatusConfirmNotifyTaskDispatcher-0][DataNodeExchanger] - DataNode Exchanger request data error! java.lang.RuntimeException: Bolt Server sendSync message RemotingException! at com.alipay.sofa.registry.remoting.bolt.BoltServer.sendSync(BoltServer.java:255) at com.alipay.sofa.registry.server.meta.remoting.DataNodeExchanger.request(DataNodeExchanger.java:62) at com.alipay.sofa.registry.server.meta.node.impl.DataNodeServiceImpl.notifyStatusConfirm(DataNodeServiceImpl.java:175) at com.alipay.sofa.registry.server.meta.task.ReceiveStatusConfirmNotifyTask.execute(ReceiveStatusConfirmNotifyTask.java:57) at com.alipay.sofa.registry.server.meta.task.processor.DataNodeSingleTaskProcessor.process(DataNodeSingleTaskProcessor.java:41) at com.alipay.sofa.registry.server.meta.task.processor.DataNodeSingleTaskProcessor.process(DataNodeSingleTaskProcessor.java:32) at com.alipay.sofa.registry.task.batcher.TaskExecutors$WorkerRunnable.run(TaskExecutors.java:136) at java.lang.Thread.run(Thread.java:748) Caused by: com.alipay.remoting.rpc.exception.InvokeTimeoutException: Rpc invocation timeout[responseCommand TIMEOUT]! the address is 10.140.0.7:41122 at com.alipay.remoting.rpc.RpcResponseResolver.preProcess(RpcResponseResolver.java:83) at com.alipay.remoting.rpc.RpcResponseResolver.resolveResponseObject(RpcResponseResolver.java:54) at com.alipay.remoting.rpc.RpcRemoting.invokeSync(RpcRemoting.java:186) at com.alipay.remoting.rpc.RpcServerRemoting.invokeSync(RpcServerRemoting.java:67) at com.alipay.remoting.rpc.RpcServer.invokeSync(RpcServer.java:541) at com.alipay.sofa.registry.remoting.bolt.BoltServer.sendSync(BoltServer.java:251) ... 7 common frames omitted [2020-03-17 06:43:25,308][ERROR][ReceiveStatusConfirmNotifyTaskDispatcher-0][DataNodeSingleTaskProcessor] - [Task] Data node SingleTask Process error! java.lang.RuntimeException: Notify status confirm error: request url: URL{address='10.140.0.7:41122'}, body: StatusConfirmRequest{node=DataNode{ip=10.140.0.7}, nodeStatus=INIT}, DataNode Exchanger request data error! at com.alipay.sofa.registry.server.meta.node.impl.DataNodeServiceImpl.notifyStatusConfirm(DataNodeServiceImpl.java:182) at com.alipay.sofa.registry.server.meta.task.ReceiveStatusConfirmNotifyTask.execute(ReceiveStatusConfirmNotifyTask.java:57) at com.alipay.sofa.registry.server.meta.task.processor.DataNodeSingleTaskProcessor.process(DataNodeSingleTaskProcessor.java:41) at com.alipay.sofa.registry.server.meta.task.processor.DataNodeSingleTaskProcessor.process(DataNodeSingleTaskProcessor.java:32) at com.alipay.sofa.registry.task.batcher.TaskExecutors$WorkerRunnable.run(TaskExecutors.java:136) at java.lang.Thread.run(Thread.java:748) Caused by: com.alipay.sofa.registry.remoting.exchange.RequestException: request url: URL{address='10.140.0.7:41122'}, body: StatusConfirmRequest{node=DataNode{ip=10.140.0.7}, nodeStatus=INIT}, DataNode Exchanger request data error! at com.alipay.sofa.registry.server.meta.remoting.DataNodeExchanger.request(DataNodeExchanger.java:77) at com.alipay.sofa.registry.server.meta.node.impl.DataNodeServiceImpl.notifyStatusConfirm(DataNodeServiceImpl.java:175) ... 5 common frames omitted Caused by: java.lang.RuntimeException: Bolt Server sendSync message RemotingException! at com.alipay.sofa.registry.remoting.bolt.BoltServer.sendSync(BoltServer.java:255) at com.alipay.sofa.registry.server.meta.remoting.DataNodeExchanger.request(DataNodeExchanger.java:62) ... 6 common frames omitted Caused by: com.alipay.remoting.rpc.exception.InvokeTimeoutException: Rpc invocation timeout[responseCommand TIMEOUT]! the address is 10.140.0.7:41122 at com.alipay.remoting.rpc.RpcResponseResolver.preProcess(RpcResponseResolver.java:83) at com.alipay.remoting.rpc.RpcResponseResolver.resolveResponseObject(RpcResponseResolver.java:54) at com.alipay.remoting.rpc.RpcRemoting.invokeSync(RpcRemoting.java:186) at com.alipay.remoting.rpc.RpcServerRemoting.invokeSync(RpcServerRemoting.java:67) at com.alipay.remoting.rpc.RpcServer.invokeSync(RpcServer.java:541) at com.alipay.sofa.registry.remoting.bolt.BoltServer.sendSync(BoltServer.java:251) ... 7 common frames omitted
@khotyn registry-startup中各项启动都正常 9622端口的health check也是正常的,怎么到了common-error中9622也不正常了
[2020-03-17 06:43:15,153][INFO][main][MetaServerBootstrap] - the configuration items are as follows: com.alipay.sofa.registry.server.meta.bootstrap.MetaServerConfigBean@74235045[
sessionServerPort=9610
dataServerPort=9611
metaServerPort=9612
httpServerPort=9615
schedulerHeartbeatTimeout=3
schedulerHeartbeatFirstDelay=3
schedulerHeartbeatExpBackOffBound=10
schedulerGetDataChangeTimeout=5
schedulerGetDataChangeFirstDelay=5
schedulerGetDataChangeExpBackOffBound=5
schedulerConnectMetaServerTimeout=3
schedulerConnectMetaServerFirstDelay=3
schedulerConnectMetaServerExpBackOffBound=10
schedulerCheckNodeListChangePushTimeout=3
schedulerCheckNodeListChangePushFirstDelay=1
schedulerCheckNodeListChangePushExpBackOffBound=10
dataNodeExchangeTimeout=3000
sessionNodeExchangeTimeout=3000
metaNodeExchangeTimeout=3000
dataCenterChangeNotifyTaskRetryTimes=3
dataNodeChangePushTaskRetryTimes=1
getDataCenterChangeListTaskRetryTimes=3
receiveStatusConfirmNotifyTaskRetryTimes=3
sessionNodeChangePushTaskRetryTimes=3
enableMetrics=true
decisionMode=
@khotyn 41122端口哪来的,我netstat发现并没有打开
按照https://www.sofastack.tech/guides/sofastack-quick-start/#%E6%9B%B4%E5%A4%9A这个demo做的。 安装了openzipkin/zipkin xzchaoo/lookout-allinone:1.6.0-SNAPSHOT elasticsearch:5.6 三个docker容器 加上registry-integration。启动就是炸裂。
@khotyn 劳烦了,我看了一下午日志,自己解决了。但是还是要吐槽下,那个sofastack-demo是真的粗制滥造啊,里面都还有些错。而且本机作为注册中心,都一直会出现500找不到RPC对象。google云200ms直接没办法玩,这registry不是很稳定啊
@maodou38 我们再看下 Demo,看下优化一下,多谢多谢~~~
你们内部有这个sofa-registry的那种监控工具嘛,类似zookeeper的那个。我现在很好奇为什么我的registry一会好一会坏了。SOFALookout和ZipKin都部署在台湾google cloud上,时延大概200ms。拿不到RPC对象和这有关系嘛?
@maodou38 SOFALookout 和 Zipkin 跟服务发现没有关系,应该不是这个原因。
@maodou38 Could you tell me how to solve it?
6.1.4 版本优先会使用 eth0和en0 网络设备获取ip , 如果有希望自己指定的网卡,可以使用-Dnetwork_interface_binding 指定 https://github.com/sofastack/sofa-registry/blob/master/server%2Fcommon%2Futil%2Fsrc%2Fmain%2Fjava%2Fcom%2Falipay%2Fsofa%2Fregistry%2Fnet%2FNetUtil.java#L61
使用默认配置文件,DefualtDataCenter:本机地址 启动报错,leader选举地址为docker网卡对应地址
Your scenes
错误信息如下 registry-raft.log
java -version
):uname -a
):