public static boolean checkConnectivity(String host, int port, int connectTimeout, TimeUnit timeUnit) {
        InetSocketAddress socketAddress = new InetSocketAddress(host, port);
        Socket socket = new Socket();
        try {
            socket.connect(socketAddress, (int) timeUnit.toMillis(connectTimeout));
            return socket.isConnected();
        } catch (IOException e) {
            log.error(String.format("%s:%s connected failed with err msg:%s", host, port, e.getMessage()));
            return false;
        } finally {
            try {
                socket.close();
            } catch (IOException e) {
                log.warn("close connection from {}:{} failed", host, port, e);
            }
        }
    }
Check whether the host and port can connect

@param host target host address
@param port target port
@param connectTimeout connect timeout
@param timeUnit time unit of timeout
@return true if connect successfully, false if connect failed
inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/util/HttpUtils.java