环境准备
① 为了提供无界流的测试,在任意节点(这里以node2为例)安装网络工具Netcat,并开启当地监听端口(这里以9999端口为例)。
[hadoop@node2 ~]$ sudo yum install nc
[hadoop@node2 ~]$ nc -lk 9999
复制代码
② 为了提交Flink步伐任务到集群中执行验证。本例中提供无界流词频统计的步伐FlinkWC-1.0-SNAPSHOT.jar进行测试。其中,步伐入口为com.flink.wc.demo.WordCountUnbounded
下载FlinkWC-1.0-SNAPSHOT.jar
2.1.3.1 方式1: Web UI上提交作业
任务打包完成后,打开Flink的WEB UI页面,在右侧导航栏点击Submit New Job,然后点击按钮Add New,选择要上传运行的FlinkWC-1.0-SNAPSHOT.jar包,如下图所示。
Exception in thread "Thread-4" java.lang.IllegalStateException: Trying to access closed classloader. Please check if you store classloaders directly or indirectly in static fields. If the stacktrace suggests that the leak occurs in a third party library and cannot be fixed immediately, you can disable this check with the configuration 'classloader.check-leaked-classloader'.
at org.apache.flink.util.FlinkUserCodeClassLoaders$SafetyNetWrapperClassLoader.ensureInner(FlinkUserCodeClassLoaders.java:189)