code: public static String getLocalHostByRegistry(String registryIp) {
          String host = null;
          if (registryIp != null && registryIp.length() > 0) {
              List<InetSocketAddress> addrs = getIpListByRegistry(registryIp);
              for (int i = 0; i < addrs.size(); i++) {
                  InetAddress address = getLocalHostBySocket(addrs.get(i));
                  if (address != null) {
                      host = address.getHostAddress();
                      if (host != null && !NetUtils.isInvalidLocalHost(host)) {
                          return host;
                      }
                  }
              }
          }
          if (NetUtils.isInvalidLocalHost(host)) {
              host = NetUtils.getLocalIpv4();
          }
          return host;
      }
docs: 本地多ip情况下、连一下注册中心地址得到本地IP地址
  
  @param registryIp 注册中心地址
  @return 本地多ip情况下得到本地能连上注册中心的IP地址