public static String getIPV4LocalAddress() {
        if (localIPAddress != null) {
            return localIPAddress;
        }
        String tmpAdress = null;
        try {
            Enumeration<NetworkInterface> enumeration = NetworkInterface.getNetworkInterfaces();
            if (enumeration == null) {
                throw new AddressException("Get NetworkInterfaces is null");
            }
            while (enumeration.hasMoreElements()) {
                try {
                    Tuple2<Boolean, String> result =
                            getValidIPV4Address(enumeration.nextElement(), null);
                    if (result.getF0()) {
                        tmpAdress = result.getF1();
                        break;
                    }
                } catch (Throwable e) {
                    //
                }
            }
            if (tmpAdress == null) {
                tmpAdress = InetAddress.getLocalHost().getHostAddress();
            }
            if (tmpAdress != null) {
                localIPAddress = tmpAdress;
                return tmpAdress;
            }
        } catch (SocketException | UnknownHostException e) {
            throw new AddressException("Call getIPV4LocalAddress throw exception", e);
        }
        throw new AddressException(new StringBuilder(256)
                .append("Illegal parameter: not found the default ip")
                .append(" in local networkInterfaces!").toString());
    }
Get local IP V4 address

@return  the local IP V4 address
inlong-tubemq/tubemq-core/src/main/java/org/apache/inlong/tubemq/corebase/utils/AddressUtils.java