{"action":"created","issue":{"url":"https://api.github.com/repos/alibaba/dubbo/issues/313","repository_url":"https://api.github.com/repos/alibaba/dubbo","labels_url":"https://api.github.com/repos/alibaba/dubbo/issues/313/labels{/name}","comments_url":"https://api.github.com/repos/alibaba/dubbo/issues/313/comments","events_url":"https://api.github.com/repos/alibaba/dubbo/issues/313/events","html_url":"https://github.com/alibaba/dubbo/issues/313","id":173379240,"number":313,"title":"dubbo版本2.5.3  dubbo服务启动的主机  与 zk集群环境 同处于一个网络中，服务端日志频现如下日志","user":{"login":"gdsh954","id":18157444,"avatar_url":"https://avatars.githubusercontent.com/u/18157444?v=3","gravatar_id":"","url":"https://api.github.com/users/gdsh954","html_url":"https://github.com/gdsh954","followers_url":"https://api.github.com/users/gdsh954/followers","following_url":"https://api.github.com/users/gdsh954/following{/other_user}","gists_url":"https://api.github.com/users/gdsh954/gists{/gist_id}","starred_url":"https://api.github.com/users/gdsh954/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gdsh954/subscriptions","organizations_url":"https://api.github.com/users/gdsh954/orgs","repos_url":"https://api.github.com/users/gdsh954/repos","events_url":"https://api.github.com/users/gdsh954/events{/privacy}","received_events_url":"https://api.github.com/users/gdsh954/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-08-26T06:30:13Z","updated_at":"2016-10-27T03:36:28Z","closed_at":null,"body":"日志如下：此  ip port  124.89.187.133:10354  并不是机房内ip 很是奇怪，日志了很大 高频率刷日志。\r\n\r\nINFO|[DubboProtocol]-[130] -  [DUBBO] disconected from /124.89.187.133:10354\r\n,url:\r\ndubbo://XX.XX.XX.XX:port/com.ifre.facade.XXXXX.AccountService?actives=10&\r\nanyhost=true&application=XXX-service-XXXX&channel.readonly.sent=true&\r\ncodec=dubbo&default.accepts=1000&default.executes=20&d\r\nefault.threadpool=fixed&default.threads=200&default.timeout=30000&\r\ndubbo=2.5.3&group=cftool&heartbeat=60000&\r\ninterface=com.ifre.facade.XXXX.AccountService&\r\nmethods=register,checkLogin,accountActive,updateUser,sendMail&\r\nmonitor=dubbo%3A%2F%2FXX.XX.XX.XX%3A2183%2Fcom.\r\nalibaba.dubbo.registry.RegistryService%3Fapplication%3DXXXX-service-XXXX%26backup%3DXX.XX.XX.XX%3Aport%2CXX.XX.XX.XX%3Aport%\r\n26dubbo%3D2.5.3%26file%3D%2Fhome%2Fifre%2F.dubbo%2Fdubbo-registry-XXXX.cache\r\n%26pid%3D17028%26protocol%3Dregistry%26refer%3Ddubbo%253D2.5.3%2526interface%2\r\n53Dcom.alibaba.dubbo.monitor.MonitorService%2526pid%253D17028%2526timestamp%253D1\r\n472177030946%26registry%3Dzookeeper%26timestamp%3D1472177030829&pid=17028&retries=0&\r\nrevision=1.1-SNAPSHOT&side=provider&timestamp=1472177030836&version=1.0, dubbo version: 2.5.3, current host: XX.XX.XX.XX"},"comment":{"url":"https://api.github.com/repos/alibaba/dubbo/issues/comments/256538481","html_url":"https://github.com/alibaba/dubbo/issues/313#issuecomment-256538481","issue_url":"https://api.github.com/repos/alibaba/dubbo/issues/313","id":256538481,"user":{"login":"lwkjob","id":2392114,"avatar_url":"https://avatars.githubusercontent.com/u/2392114?v=3","gravatar_id":"","url":"https://api.github.com/users/lwkjob","html_url":"https://github.com/lwkjob","followers_url":"https://api.github.com/users/lwkjob/followers","following_url":"https://api.github.com/users/lwkjob/following{/other_user}","gists_url":"https://api.github.com/users/lwkjob/gists{/gist_id}","starred_url":"https://api.github.com/users/lwkjob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lwkjob/subscriptions","organizations_url":"https://api.github.com/users/lwkjob/orgs","repos_url":"https://api.github.com/users/lwkjob/repos","events_url":"https://api.github.com/users/lwkjob/events{/privacy}","received_events_url":"https://api.github.com/users/lwkjob/received_events","type":"User","site_admin":false},"created_at":"2016-10-27T03:36:28Z","updated_at":"2016-10-27T03:36:28Z","body":"``` java \r\nprivate <T> Invoker<T> doRefer(Cluster cluster, Registry registry, Class<T> type, URL url) {\r\n        RegistryDirectory<T> directory = new RegistryDirectory<T>(type, url);\r\n        directory.setRegistry(registry);\r\n        directory.setProtocol(protocol);\r\n     //这里获取本地网卡地址NetUtils.getLocalHost()\r\n        URL subscribeUrl = new URL(Constants.CONSUMER_PROTOCOL, NetUtils.getLocalHost(), 0, type.getName(), directory.getUrl().getParameters());\r\n        if (! Constants.ANY_VALUE.equals(url.getServiceInterface())\r\n                && url.getParameter(Constants.REGISTER_KEY, true)) {\r\n            registry.register(subscribeUrl.addParameters(Constants.CATEGORY_KEY, Constants.CONSUMERS_CATEGORY,\r\n                    Constants.CHECK_KEY, String.valueOf(false)));\r\n        }\r\n        directory.subscribe(subscribeUrl.addParameter(Constants.CATEGORY_KEY, \r\n                Constants.PROVIDERS_CATEGORY \r\n                + \",\" + Constants.CONFIGURATORS_CATEGORY \r\n                + \",\" + Constants.ROUTERS_CATEGORY));\r\n        return cluster.join(directory);\r\n    }\r\n\r\n  //NetUtils.getLocalHost()方法内部调用了如下方法\r\n /**\r\n     * 遍历本地网卡，返回第一个合理的IP。\r\n     * \r\n     * @return 本地网卡IP\r\n     */\r\n    public static InetAddress getLocalAddress() {\r\n        if (LOCAL_ADDRESS != null)\r\n            return LOCAL_ADDRESS;\r\n        InetAddress localAddress = getLocalAddress0();\r\n        LOCAL_ADDRESS = localAddress;\r\n        return localAddress;\r\n    }\r\n```"}}
{"actor":{"display_login":"lwkjob"}}