dubbo 获取不到本地地址,返回 127.0.0.1
2019-08-14 12:29:09.609 WARN 1079 --- [ main] org.apache.dubbo.config.AbstractConfig : [DUBBO] There's no valid metadata config found, if you are using the simplified mode of registry url, please make sure you have a metadata address configured properly., dubbo version: 2.7.1, current host: 127.0.0.1
2019-08-14 12:29:09.968 INFO 1079 --- [ main] o.a.dubbo.registry.nacos.NacosRegistry : [DUBBO] Register: consumer://127.0.0.1/com.lkk.platform.system.domain.service.ELPeopleService?application=erdp-discuss-app&category=consumers&check=false&default.check=false&default.cluster=failfast&default.generic=false&default.lazy=false&default.loadbalance=leastactive&default.sticky=false&default.version=1.0.0&dubbo=2.0.2&generic=false&interface=com.lkk.platform.system.domain.service.ELPeopleService&lazy=false&logger=slf4j&methods=batchAddOrUpdate,selectFieldListByActive,checkUserAccount,insertOrUpdate,deleteByMap,queryDimissionPage,getPeopleByOrgIds,updateBatchById,resetButton,insertAllColumn,findUser,expirationReminder,InInsert,getTableName,selectById,getResetPwdByCode,deleteById,insertBatch,selectCount,updateAllColumnById,queryPage,getCodeById,getUser,save,updateAllColumnBatchById,update,insert,delete,selectAvlbFieldList,deleteBatchIds,getUserByCode,fuzzyFindUser,fuzzyQueryPage,getUserByNameOrEmail,get,getIdByCode,updateUserPinyin,batchList,selectPage,updatePwd,getLeaderIdByOrgIds,updateById,selectBatchIds,selectList,selectOne,insertOne,getUserByName,getPeople,getUserView,queryById&pid=1079&release=2.7.1&revision=2.0.2-SNAPSHOT&side=consumer&sticky=false×tamp=1565756949610, dubbo version: 2.7.1, current host: 127.0.0.1
或者
2019-08-14 12:29:10.109 INFO 1079 --- [ main] o.a.dubbo.registry.nacos.NacosRegistry : [DUBBO] Subscribe: consumer://127.0.0.1/com.lkk.platform.system.domain.service.ELPeopleService?application=erdp-discuss-app&category=providers,configurators,routers&default.check=false&default.cluster=failfast&default.generic=false&default.lazy=false&default.loadbalance=leastactive&default.sticky=false&default.version=1.0.0&dubbo=2.0.2&generic=false&interface=com.lkk.platform.system.domain.service.ELPeopleService&lazy=false&logger=slf4j&methods=batchAddOrUpdate,selectFieldListByActive,checkUserAccount,insertOrUpdate,deleteByMap,queryDimissionPage,getPeopleByOrgIds,updateBatchById,resetButton,insertAllColumn,findUser,expirationReminder,InInsert,getTableName,selectById,getResetPwdByCode,deleteById,insertBatch,selectCount,updateAllColumnById,queryPage,getCodeById,getUser,save,updateAllColumnBatchById,update,insert,delete,selectAvlbFieldList,deleteBatchIds,getUserByCode,fuzzyFindUser,fuzzyQueryPage,getUserByNameOrEmail,get,getIdByCode,updateUserPinyin,batchList,selectPage,updatePwd,getLeaderIdByOrgIds,updateById,selectBatchIds,selectList,selectOne,insertOne,getUserByName,getPeople,getUserView,queryById&pid=1079&release=2.7.1&revision=2.0.2-SNAPSHOT&side=consumer&sticky=false×tamp=1565756949610, dubbo version: 2.7.1, current host: 127.0.0.1
Register 的地址是 dubbo://127.0.0.1:20880, 这明显不对
注意其后面出现:
java.net.UnknownHostException: erdp200: erdp200: 未知的名称或服务
erdp200 是我的主机名, 奇怪的事, 竟然识别不了 erdp200?
java.net.UnknownHostException: erdp200: erdp200: 未知的名称或服务
at java.net.InetAddress.getLocalHost(InetAddress.java:1506) ~[na:1.8.0_201]
at org.apache.dubbo.common.utils.NetUtils.getLocalAddress0(NetUtils.java:245) [dubbo-2.7.1.jar!/:2.7.1]
at org.apache.dubbo.common.utils.NetUtils.getLocalAddress(NetUtils.java:222) [dubbo-2.7.1.jar!/:2.7.1]
at org.apache.dubbo.common.utils.NetUtils.getLocalHost(NetUtils.java:187) [dubbo-2.7.1.jar!/:2.7.1]
at org.apache.dubbo.rpc.filter.ConsumerContextFilter.invoke(ConsumerContextFilter.java:45) [dubbo-2.7.1.jar!/:2.7.1]
at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:73) [dubbo-2.7.1.jar!/:2.7.1]
at org.apache.dubbo.rpc.protocol.InvokerWrapper.invoke(InvokerWrapper.java:56) [dubbo-2.7.1.jar!/:2.7.1]
at org.apache.dubbo.rpc.cluster.support.FailfastClusterInvoker.doInvoke(FailfastClusterInvoker.java:48) [dubbo-2.7.1.jar!/:2.7.1]
at org.apache.dubbo.rpc.cluster.support.AbstractClusterInvoker.invoke(AbstractClusterInvoker.java:242) [dubbo-2.7.1.jar!/:2.7.1]
at org.apache.dubbo.rpc.cluster.support.wrapper.MockClusterInvoker.invoke(MockClusterInvoker.java:76) [dubbo-2.7.1.jar!/:2.7.1]
at org.apache.dubbo.rpc.proxy.InvokerInvocationHandler.invoke(InvokerInvocationHandler.java:57) [dubbo-2.7.1.jar!/:2.7.1]
at org.apache.dubbo.common.bytecode.proxy0.selectBatchIds(proxy0.java) [dubbo-2.7.1.jar!/:2.7.1]
at com.lkk.ppm.discuss.controller.controller.DiscussController.fetchUsers(DiscussController.java:263) [erdp_discuss_controller-2.0.2-SNAPSHOT.jar!/:2.0.2-SNAPSHOT]
at com.lkk.ppm.discuss.controller.controller.DiscussController.listTopicDiscuss(DiscussController.java:233) [erdp_discuss_controller-2.0.2-SNAPSHOT.jar!/:2.0.2-SNAPSHOT]
at com.lkk.ppm.discuss.controller.controller.DiscussController$$FastClassBySpringCGLIB$$32bbd2d3.invoke(<generated>) [erdp_discuss_controller-2.0.2-SNAPSHOT.jar!/:2.0.2-SNAPSHOT]
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) [spring-core-5.1.5.RELEASE.jar!/:5.1.5.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:749) [spring-aop-5.1.5.RELEASE.jar!/:5.1.5.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) [spring-aop-5.1.5.RELEASE.jar!/:5.1.5.RELEASE]
at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:88) [spring-aop-5.1.5.RELEASE.jar!/:5.1.5.RELEASE]
at com.lkk.platform.common.web.aop.CommonLogAspectHandler.around(CommonLogAspectHandler.java:57) [platform_common_web-2.0.2-SNAPSHOT.jar!/:2.0.2-SNAPSHOT]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_201]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_201]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_201]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_201]
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:644) [spring-aop-5.1.5.RELEASE.jar!/:5.1.5.RELEASE]
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:633) [spring-aop-5.1.5.RELEASE.jar!/:5.1.5.RELEASE]
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70) [spring-aop-5.1.5.RELEASE.jar!/:5.1.5.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175) [spring-aop-5.1.5.RELEASE.jar!/:5.1.5.RELEASE]
at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:88) [spring-aop-5.1.5.RELEASE.jar!/:5.1.5.RELEASE]
at com.lkk.platform.common.web.aop.ValidateAspectHandel.validateAround(ValidateAspectHandel.java:111) [platform_common_web-2.0.2-SNAPSHOT.jar!/:2.0.2-SNAPSHOT]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_201]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_201]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_201]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_201]
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:644) [spring-aop-5.1.5.RELEASE.jar!/:5.1.5.RELEASE]
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:633) [spring-aop-5.1.5.RELEASE.jar!/:5.1.5.RELEASE]
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70) [spring-aop-5.1.5.RELEASE.jar!/:5.1.5.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175) [spring-aop-5.1.5.RELEASE.jar!/:5.1.5.RELEASE]
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:93) [spring-aop-5.1.5.RELEASE.jar!/:5.1.5.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) [spring-aop-5.1.5.RELEASE.jar!/:5.1.5.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688) [spring-aop-5.1.5.RELEASE.jar!/:5.1.5.RELEASE]
at com.lkk.ppm.discuss.controller.controller.DiscussController$$EnhancerBySpringCGLIB$$5b78365a.listTopicDiscuss(<generated>) [erdp_discuss_controller-2.0.2-SNAPSHOT.jar!/:2.0.2-SNAPSHOT]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_201]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_201]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_201]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_201]
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:189) [spring-web-5.1.5.RELEASE.jar!/:5.1.5.RELEASE]
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138) [spring-web-5.1.5.RELEASE.jar!/:5.1.5.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102) [spring-webmvc-5.1.5.RELEASE.jar!/:5.1.5.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895) [spring-webmvc-5.1.5.RELEASE.jar!/:5.1.5.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:800) [spring-webmvc-5.1.5.RELEASE.jar!/:5.1.5.RELEASE]
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) [spring-webmvc-5.1.5.RELEASE.jar!/:5.1.5.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1038) [spring-webmvc-5.1.5.RELEASE.jar!/:5.1.5.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942) [spring-webmvc-5.1.5.RELEASE.jar!/:5.1.5.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1005) [spring-webmvc-5.1.5.RELEASE.jar!/:5.1.5.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:897) [spring-webmvc-5.1.5.RELEASE.jar!/:5.1.5.RELEASE]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:634) [tomcat-embed-core-9.0.16.jar!/:9.0.16]
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:882) [spring-webmvc-5.1.5.RELEASE.jar!/:5.1.5.RELEASE]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) [tomcat-embed-core-9.0.16.jar!/:9.0.16]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) [tomcat-embed-core-9.0.16.jar!/:9.0.16]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.16.jar!/:9.0.16]
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) [tomcat-embed-websocket-9.0.16.jar!/:9.0.16]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.16.jar!/:9.0.16]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.16.jar!/:9.0.16]
at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:92) [spring-web-5.1.5.RELEASE.jar!/:5.1.5.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.1.5.RELEASE.jar!/:5.1.5.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.16.jar!/:9.0.16]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.16.jar!/:9.0.16]
at org.apache.catalina.filters.RemoteIpFilter.doFilter(RemoteIpFilter.java:845) [tomcat-embed-core-9.0.16.jar!/:9.0.16]
at org.apache.catalina.filters.RemoteIpFilter.doFilter(RemoteIpFilter.java:902) [tomcat-embed-core-9.0.16.jar!/:9.0.16]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.16.jar!/:9.0.16]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.16.jar!/:9.0.16]
at com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:123) [druid-1.1.5.jar!/:1.1.5]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.16.jar!/:9.0.16]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.16.jar!/:9.0.16]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:320) [spring-security-web-5.1.4.RELEASE.jar!/:5.1.4.RELEASE]
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:127) [spring-security-web-5.1.4.RELEASE.jar!/:5.1.4.RELEASE]
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:91) [spring-security-web-5.1.4.RELEASE.jar!/:5.1.4.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-5.1.4.RELEASE.jar!/:5.1.4.RELEASE]
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:119) [spring-security-web-5.1.4.RELEASE.jar!/:5.1.4.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-5.1.4.RELEASE.jar!/:5.1.4.RELEASE]
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:137) [spring-security-web-5.1.4.RELEASE.jar!/:5.1.4.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-5.1.4.RELEASE.jar!/:5.1.4.RELEASE]
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111) [spring-security-web-5.1.4.RELEASE.jar!/:5.1.4.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-5.1.4.RELEASE.jar!/:5.1.4.RELEASE]
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:170) [spring-security-web-5.1.4.RELEASE.jar!/:5.1.4.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-5.1.4.RELEASE.jar!/:5.1.4.RELEASE]
at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63) [spring-security-web-5.1.4.RELEASE.jar!/:5.1.4.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-5.1.4.RELEASE.jar!/:5.1.4.RELEASE]
at org.springframework.security.oauth2.provider.authentication.OAuth2AuthenticationProcessingFilter.doFilter(OAuth2AuthenticationProcessingFilter.java:176) [spring-security-oauth2-2.3.5.RELEASE.jar!/:na]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-5.1.4.RELEASE.jar!/:5.1.4.RELEASE]
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:116) [spring-security-web-5.1.4.RELEASE.jar!/:5.1.4.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-5.1.4.RELEASE.jar!/:5.1.4.RELEASE]
at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:74) [spring-security-web-5.1.4.RELEASE.jar!/:5.1.4.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.1.5.RELEASE.jar!/:5.1.5.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-5.1.4.RELEASE.jar!/:5.1.4.RELEASE]
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105) [spring-security-web-5.1.4.RELEASE.jar!/:5.1.4.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-5.1.4.RELEASE.jar!/:5.1.4.RELEASE]
at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56) [spring-security-web-5.1.4.RELEASE.jar!/:5.1.4.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.1.5.RELEASE.jar!/:5.1.5.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-5.1.4.RELEASE.jar!/:5.1.4.RELEASE]
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:215) [spring-security-web-5.1.4.RELEASE.jar!/:5.1.4.RELEASE]
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:178) [spring-security-web-5.1.4.RELEASE.jar!/:5.1.4.RELEASE]
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:357) [spring-web-5.1.5.RELEASE.jar!/:5.1.5.RELEASE]
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:270) [spring-web-5.1.5.RELEASE.jar!/:5.1.5.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.16.jar!/:9.0.16]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.16.jar!/:9.0.16]
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200) [spring-web-5.1.5.RELEASE.jar!/:5.1.5.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.1.5.RELEASE.jar!/:5.1.5.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.16.jar!/:9.0.16]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.16.jar!/:9.0.16]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:200) [tomcat-embed-core-9.0.16.jar!/:9.0.16]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [tomcat-embed-core-9.0.16.jar!/:9.0.16]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490) [tomcat-embed-core-9.0.16.jar!/:9.0.16]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) [tomcat-embed-core-9.0.16.jar!/:9.0.16]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) [tomcat-embed-core-9.0.16.jar!/:9.0.16]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) [tomcat-embed-core-9.0.16.jar!/:9.0.16]
at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:679) [tomcat-embed-core-9.0.16.jar!/:9.0.16]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) [tomcat-embed-core-9.0.16.jar!/:9.0.16]
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) [tomcat-embed-core-9.0.16.jar!/:9.0.16]
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat-embed-core-9.0.16.jar!/:9.0.16]
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:834) [tomcat-embed-core-9.0.16.jar!/:9.0.16]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1415) [tomcat-embed-core-9.0.16.jar!/:9.0.16]
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-9.0.16.jar!/:9.0.16]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_201]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_201]
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-9.0.16.jar!/:9.0.16]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_201]
Caused by: java.net.UnknownHostException: erdp200: 未知的名称或服务
at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method) ~[na:1.8.0_201]
at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:929) ~[na:1.8.0_201]
at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1324) ~[na:1.8.0_201]
at java.net.InetAddress.getLocalHost(InetAddress.java:1501) ~[na:1.8.0_201]
... 127 common frames omitted
后面发现 , 需要修改 /etc/hosts , 增加对应的 ip hostname 这样的一行就好了!
为什么读取的不是lan 的ip,
而是虚拟网卡的ip:
addressOp = /172.18.0.1
localAddress0 = /172.18.0.1
因为我安装了 docker,k8s的原因吗?
# ifconfig
br-ef2850b464e5: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 172.18.0.1 netmask 255.255.0.0 broadcast 172.18.255.255
ether 02:42:40:a7:10:04 txqueuelen 0 (Ethernet)
RX packets 2643595 bytes 4115706912 (3.8 GiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2643595 bytes 4115706912 (3.8 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 docker0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.17.0.1 netmask 255.255.0.0 broadcast 172.17.255.255
inet6 fe80::42:dff:fe70:3389 prefixlen 64 scopeid 0x20<link>
ether 02:42:0d:70:33:89 txqueuelen 0 (Ethernet)
RX packets 4759568754 bytes 371508394572 (345.9 GiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 4774072779 bytes 761901712932 (709.5 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 ens192: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.11.200 netmask 255.255.255.0 broadcast 192.168.11.255
inet6 fe80::846:50d2:ba3a:1f28 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:20:55:ed txqueuelen 1000 (Ethernet)
RX packets 5201526620 bytes 914341297984 (851.5 GiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 5135122785 bytes 625366352018 (582.4 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 2643595 bytes 4115706912 (3.8 GiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2643595 bytes 4115706912 (3.8 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 veth070da3e: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet6 fe80::828:e0ff:fe7d:8208 prefixlen 64 scopeid 0x20<link>
ether 0a:28:e0:7d:82:08 txqueuelen 0 (Ethernet)
RX packets 1291637 bytes 240497841 (229.3 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1407428 bytes 155779146 (148.5 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 veth0a306d8: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet6 fe80::2032:f0ff:fe4c:c6b5 prefixlen 64 scopeid 0x20<link>
ether 22:32:f0:4c:c6:b5 txqueuelen 0 (Ethernet)
RX packets 1501576 bytes 314407273 (299.8 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1967105 bytes 214900891 (204.9 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 veth0cd5e30: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet6 fe80::ac0d:90ff:fef3:63a4 prefixlen 64 scopeid 0x20<link>
ether ae:0d:90:f3:63:a4 txqueuelen 0 (Ethernet)
RX packets 10298334 bytes 1984915816 (1.8 GiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 11261264 bytes 1707200507 (1.5 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 veth1046ba1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet6 fe80::94af:6aff:fe4c:ef55 prefixlen 64 scopeid 0x20<link>
ether 96:af:6a:4c:ef:55 txqueuelen 0 (Ethernet)
RX packets 542741 bytes 35003885 (33.3 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 544217 bytes 559096100 (533.1 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
但是, 同事那边也有这个问题啊, 他都已经加的了, 为什么还这样? 哦, 原来他的hostname 是 localhost.localdomain
我也是醉了, 原来他的hostname没有改, 这样的话,下面的配置的 最后一行是没有用的
/etc/hosts 中手动添加的 ip hostname 从而没有用,因为这里的hostname 并不是其实际的 hostname 。。 难怪呢 难怪他启动dubbo 的时候也没有报 UnknownHostException 的错误,
2019-08-14 15:02:12.784 INFO 16140 --- [ main] o.a.dubbo.registry.nacos.NacosRegistry : [DUBBO] Load registry cache file /root/.dubbo/dubbo-registry-erdp-discuss-app-192.168.0.143:8848.cache, data: {com.lkk.platform.system.domain.service.ELPeopleService:1.0.0=dubbo://127.0.0.1:20880/com.lkk.platform.system.domain.service.ELPeopleService?anyhost=true&application=erdp-system-app&bean.name=com.lkk.platform.system.domain.service.ELPeopleService&category=providers&default.cluster=failfast&default.connections=5&default.deprecated=false&default.dynamic=false&default.loadbalance=leastactive&default.register=true&default.retries=0&default.timeout=10000&default.version=1.0.0&deprecated=false&dubbo=2.0.2&dynamic=false&generic=false&interface=com.lkk.platform.system.domain.service.ELPeopleService&logger=slf4j&methods=batchAddOrUpdate,selectFieldListByActive,checkUserAccount,insertOrUpdate,deleteByMap,queryDimissionPage,getPeopleByOrgIds,updateBatchById,resetButton,insertAllColumn,findUser,expirationReminder,InInsert,getTableName,selectById,getResetPwdByCode,deleteById,insertBatch,selectCount,updateAllColumnById,queryPage,getCodeById,getUser,save,updateAllColumnBatchById,update,insert,delete,selectAvlbFieldList,deleteBatchIds,getUserByCode,fuzzyQueryPage,getUserByNameOrEmail,fuzzyFindUser,get,getIdByCode,updateUserPinyin,batchList,selectPage,updatePwd,getLeaderIdByOrgIds,updateById,selectBatchIds,selectList,selectOne,insertOne,getUserByName,getPeople,getUserView,queryById&path=com.lkk.platform.system.domain.service.ELPeopleService&pid=5646&protocol=dubbo®ister=true&release=2.7.1&revision=2.0.2-SNAPSHOT&side=provider&threadpool=fixed&threads=50&timeout=1200000×tamp=1565753463091}, dubbo version: 2.7.1, current host: 127.0.0.1
因为 localhost.localdomain 并不是 unknown, 只是解析到最后 org.apache.dubbo.common.utils.NetUtils 只能返回 127.0.0.1。
看过 org.apache.dubbo.common.utils.NetUtils 源码,其实他的获取ip 的逻辑还是比较复杂的。 首先是通过hostname 去获取,获取不到才是通过 遍历 网卡的方式,获取到第一个有效的 网卡ip 就返回。 我开始还以为是 linux 机器网卡、虚拟网卡太多了(安装了 docker、k8s)的原因呢!
但是 后面 怎么又变成了 127.0.0.1 呢? 。。。 未完待续
参考
http://www.zuidaima00.com/blog/3658395741932544.htm
http://dubbo.apache.org/zh-cn/blog/dubbo-network-interfaces.html
dubbo 获取不到本地地址,返回 127.0.0.1的更多相关文章
- Java 获取客户端ip返回127.0.0.1问题
Java开发中使用 request.getRemoteAddr 获取客户端 ip ,返回结果始终为127.0.0.1.原因是服务器使用了nginx反向代理. 解决办法:在nginx配置文件nginx. ...
- jsp获取ip使用request.getRemoteAddr返回0:0:0:0:0:0:0:1
JAVA Web开发过程中,很多场景下需要获取访问终端的IP,对应方法getRemoteAddr.例如调试过程中本地回环ip地址是127.0.0.1,忽然有一天返回 0:0:0:0:0:0:0:1,这 ...
- 搞定迅雷固件在TP-LINK WR720N,127.0.0.1 9000 获取不到激活码
本帖最后由 exzzzipad 于 2014-7-2 22:33 编辑 基本情况:设备:TP-LINK WR720N目前固件:[antclan][20120825]720N-4M-NAS-withSA ...
- dubbo could not get local host ip address will use 127.0.0.1 instead 异常处理
dubbo could not get local host ip address will use 127.0.0.1 instead 查看hostname localhost:spring wls ...
- android datepicker monthOfYear getMonth(): 获取当前月(注意:返回数值为0..11,需要自己+1来显示).....
关键点: 1. getMonth(): 获取当前月(注意:返回数值为0..11,需要自己+1来显示) 2. 初始年(译者注:注意使用new Date()初始化年时,需要+1900,如下:dat ...
- nginx 部署 .net core 获取的客户端ip为127.0.0.1
采用nginx和.net core 部署一套api接口到服务器上,发现获取到的ip地址为127.0.0.1 经过检查发现,需要在nginx配置上以下参数 proxy_set_header Host $ ...
- qos-server can not bind localhost:22222, dubbo version: 2.6.0, current host: 127.0.0.1【问题解决】
好吧,这个问题比较low,但是记录一下,以免后期遗忘. 说白了,这个问题就是端口被占用了. 问题: qos-server can not bind localhost:22222, dubbo ver ...
- C++问题--Reis连接redisContext *pRedisContext = redisConnectWithTimeout("127.0.0.1", 6379, tv);pRedisContext->errstr返回错误磁盘空间不足
一.问题 使用C++连接Redis的时候出错,错误String为磁盘空间不足,连接代码如下: //reids默认监听端口6387 ; struct timeval tv; tv.tv_sec = iT ...
- java获取本机IP地址,非127.0.0.1
综合了网上找的代码,整理的,Windows和Linux都可以用. private static String getHostIp(){ try{ Enumeration<NetworkInter ...
随机推荐
- Python与自然语言处理搭建环境
参考书籍<Python自然语言处理>,书籍中的版本是Python2和NLTK2,我使用的版本是Python3和NLTK3 实验环境Windows8.1,已有Python3.4,并安装了Nu ...
- IT网址 插件 系统 软件 网址收集!
http://www.css88.com http://www.runoob.com/jquery/jquery-plugin-validate.html http://www.iteye.com/n ...
- Python爬虫实战之爬取糗事百科段子
首先,糗事百科大家都听说过吧?糗友们发的搞笑的段子一抓一大把,这次我们尝试一下用爬虫把他们抓取下来. 友情提示 糗事百科在前一段时间进行了改版,导致之前的代码没法用了,会导致无法输出和CPU占用过高的 ...
- 转:浅谈Spring的PropertyPlaceholderConfigurer
大型项目中,我们往往会对我们的系统的配置信息进行统一管理,一般做法是将配置信息配置与一个cfg.properties的文件中,然后在我们系统初始化的时候,系统自动读取cfg.properties配置文 ...
- 消息通知机制(NSNotification和NSNotificationCenter)
作者:FlyElephant 出处:http://www.cnblogs.com/xiaofeixiang iOS中委托模式和消息机制基本上开发中用到的比较多,一般最开始页面传值通过委托实现的比较多, ...
- JavaScript基础5
字符串操作方法和属性 length 获取字符串的长度 str.chartAt(指定字符的索引) 获取指定位置的字符 返回string类型的值 str.concat(字符串) 链接多个字符串 ...
- dotnet core gbk 编码错误解决方案
.Net Core GBK解码 1.添加引用 System.Text.Encoding.CodePages 2.注册 Encoding.RegisterProvider(CodePagesEnco ...
- 第6节:Java基础 - 三大集合(上)
第6节:Java基础 - 三大集合(上) 本小节是Java基础篇章的第四小节,主要介绍Java中的常用集合知识点,涉及到的内容包括Java中的三大集合的引出,以及HashMap,Hashtable和C ...
- Swap Digits
Description ) in the first line, which has the same meaning as above. And the number is in the next ...
- Orleans的生产环境部署
这一章非常简单 只要照着官方文档做就行了 文档地址 打好NUGET包后 Sql脚本是在项目下的OrleansAdoNetContent