在向flink的网页中提交一个任务,点击Show Plan出现如下错误:

 进入linux查看日志信息:

cat flink-fei-standalonesession-0-hadoop102.log.1 

2022-03-27 01:00:56,287 WARN  akka.remote.ReliableDeliverySupervisor                       [] - Association with remote system [akka.tcp://flink@192.168.10.103:38496] has failed, address is now gated for [50] ms. Reason: [Association failed with [akka.tcp://flink@192.168.10.103:38496]] Caused by: [java.net.ConnectException: 拒绝连接: /192.168.10.103:38496]
2022-03-27 01:00:57,803 WARN  akka.remote.ReliableDeliverySupervisor                       [] - Association with remote system [akka.tcp://flink@192.168.10.104:43792] has failed, address is now gated for [50] ms. Reason: [Disassociated] 
2022-03-27 01:00:57,804 WARN  akka.remote.ReliableDeliverySupervisor                       [] - Association with remote system [akka.tcp://flink-metrics@192.168.10.104:43949] has failed, address is now gated for [50] ms. Reason: [Disassociated] 
2022-03-27 01:00:58,754 INFO  org.apache.flink.runtime.entrypoint.ClusterEntrypoint        [] - RECEIVED SIGNAL 15: SIGTERM. Shutting down as requested.
2022-03-27 01:00:58,769 INFO  org.apache.flink.runtime.entrypoint.ClusterEntrypoint        [] - Shutting StandaloneSessionClusterEntrypoint down with application status UNKNOWN. Diagnostics Cluster entrypoint has been closed externally..
2022-03-27 01:00:58,778 INFO  org.apache.flink.runtime.dispatcher.DispatcherRestEndpoint   [] - Shutting down rest endpoint.
2022-03-27 01:00:58,780 INFO  org.apache.flink.runtime.blob.BlobServer                     [] - Stopped BLOB server at 0.0.0.0:45143
2022-03-27 01:00:59,096 INFO  akka.remote.RemoteActorRefProvider$RemotingTerminator        [] - Shutting down remote daemon.
2022-03-27 01:00:59,096 INFO  akka.remote.RemoteActorRefProvider$RemotingTerminator        [] - Remote daemon shut down; proceeding with flushing remote transports.
2022-03-27 01:00:59,097 INFO  akka.remote.RemoteActorRefProvider$RemotingTerminator        [] - Shutting down remote daemon.
2022-03-27 01:00:59,115 INFO  akka.remote.RemoteActorRefProvider$RemotingTerminator        [] - Remote daemon shut down; proceeding with flushing remote transports.
2022-03-27 01:00:59,144 INFO  akka.remote.RemoteActorRefProvider$RemotingTerminator        [] - Remoting shut down.
2022-03-27 01:00:59,152 INFO  akka.remote.RemoteActorRefProvider$RemotingTerminator        [] - Remoting shut down.

 通过观察是拒绝连接,回到代码中看到原来实在监听一个端口输入的数据造成的错误

        //从参数中提取主机名和端口号
        ParameterTool parameterTool = ParameterTool.fromArgs(args);
        String hostName = parameterTool.get("host");
        Integer port = parameterTool.getInt("port");

        //读取文本流
        DataStreamSource<String> lineDataStream = env.socketTextStream(hostName, port);

 由于还是实验阶段,并没有真正的通过监听端口获取数据来计算,这里采用给定一个地址和端口号的方式来实现。即如下方式来实现:

DataStreamSource<String> lineDataStream = env.socketTextStream("hadoop102", 7777);

重新编译并打包,将达成的jar包上传到flink的网页中。

将该填的信息填好,点击Show Plan弹出下面的页面:

下一步点击Submit提交任务执行,又出现错误:

通过查看异常信息知道:

 

 出现上面异常的原因是在linux上还没有执行如下命令:

nc -lk 7777

 在hadoop102的虚拟机上执行上面的一行命令,之后重新提交一次任务

 

这下能够正常运行了,之后在linux中输入一行数据,测试程序是否好用。 

linux输入一行数据用“ ”隔开

 

 程序正在运行:

 在TaskManager中查看执行结果

 从上面可以看到任务实在在个节点上运行的,这也是符合集群运行的特点的。

 

 

 

 

 

 

Logo

有“AI”的1024 = 2048,欢迎大家加入2048 AI社区

更多推荐