最后解决的办法。升级jdk到1.8最新的版本解决。的确是小版本升级就能搞定了,在Mac上一系列的问題都是由此引起的。
谢谢大家。

On Wed, Nov 6, 2019 at 8:53 AM jeff kit <[email protected]> wrote:

>
> 执行命令1的时候,localhost:8081看上去是正常的,有可用的TaskManager,JobSlot等。log下的StandaloneSession和TaskExecutor的log均无异常。
> dispatcher也是正常起来的:
>
> 2019-11-03 21:07:58,438 INFO
> org.apache.flink.runtime.dispatcher.DispatcherRestEndpoint    - Rest
> endpoint listening at localhost:8081
>
> 2019-11-03 21:07:58,438 INFO
> org.apache.flink.runtime.dispatcher.DispatcherRestEndpoint    -
> http://localhost:8081 was granted leadership with
> leaderSessionID=00000000-0000-0000-0000-000000000000
>
> 2019-11-03 21:07:58,439 INFO
> org.apache.flink.runtime.dispatcher.DispatcherRestEndpoint    - Web
> frontend listening at http://localhost:8081.
>
> 2019-11-03 21:07:58,507 INFO
> org.apache.flink.runtime.rpc.akka.AkkaRpcService              - Starting
> RPC endpoint for
> org.apache.flink.runtime.resourcemanager.StandaloneResourceManager at
> akka://flink/user/resourcemanager .
>
> 2019-11-03 21:07:58,526 INFO
> org.apache.flink.runtime.rpc.akka.AkkaRpcService              - Starting
> RPC endpoint for org.apache.flink.runtime.dispatcher.StandaloneDispatcher
> at akka://flink/user/dispatcher .
>
> 2019-11-03 21:07:58,549 INFO
> org.apache.flink.runtime.resourcemanager.StandaloneResourceManager  -
> ResourceManager akka.tcp://flink@localhost:6123/user/resourcemanager was
> granted leadership with fencing token 00000000000000000000000000000000
>
> 2019-11-03 21:07:58,550 INFO
> org.apache.flink.runtime.resourcemanager.slotmanager.SlotManager  -
> Starting the SlotManager.
>
> 2019-11-03 21:07:58,563 INFO
> org.apache.flink.runtime.dispatcher.StandaloneDispatcher      -
> Dispatcher akka.tcp://flink@localhost:6123/user/dispatcher was granted
> leadership with fencing token 00000000-0000-0000-0000-000000000000
>
> 2019-11-03 21:07:58,565 INFO
> org.apache.flink.runtime.dispatcher.StandaloneDispatcher      -
> Recovering all persisted jobs.
>
> 2019-11-03 21:08:02,248 INFO
> org.apache.flink.runtime.resourcemanager.StandaloneResourceManager  -
> Registering TaskManager with ResourceID ba0633856bb7670711e9e4e946168800
> (akka.tcp://[email protected]:54796/user/taskmanager_0) at
> ResourceManager
>
> On Tue, Nov 5, 2019 at 8:21 PM zhisheng <[email protected]> wrote:
>
>> 执行命令 1 的时候,建议打开 localhost:8081 看看是否 Flink UI 打开是否有问题,再或者看看 Flink log 目录下的
>> jobmanager 和 taskmanager 的日志是否有异常?
>>
>> 我本地测试你同样的命令是 OK 的
>>
>> tison <[email protected]> 于2019年11月5日周二 下午3:01写道:
>>
>> > 这个问题其实还挺常见的,问题有很多种可能。比如你看一下 log 下面 cluster 的日志看看
>> > Dispatcher 有没有正常的起起来,flink-conf 你有没有改过导致超时过短(比如 1 ms)或者
>> > 资源不够。也有升级 jdk 小版本后就不复现的。
>> >
>> > Best,
>> > tison.
>> >
>> >
>> > jeff kit <[email protected]> 于2019年11月5日周二 下午2:43写道:
>> >
>> > > 你好。
>> > > 我本地的Flink是官网提供的Binary包,非自己编译的。
>> > > 我相信我的情况是少数,绝大多数人的Mac都是能跑的。
>> > >
>> > > On Tue, Nov 5, 2019 at 2:24 PM Biao Liu <[email protected]> wrote:
>> > >
>> > > > 你好,
>> > > >
>> > > > MacOS 可以跑 Flink,我自己刚试了下,复制你的命令就可以跑。
>> > > > 建议再查一下你本地的环境,你本地的 Flink 是自己编译的吗?如果不行试一下 Flink 提供的 binary 包 [1]?
>> > > >
>> > > > [1] https://flink.apache.org/downloads.html
>> > > >
>> > > > Thanks,
>> > > > Biao /'bɪ.aʊ/
>> > > >
>> > > >
>> > > >
>> > > > On Tue, 5 Nov 2019 at 12:30, jeff kit <[email protected]> wrote:
>> > > >
>> > > > > HI,大家好:
>> > > > > 我在运行Flink官方的Quick
>> > > > >
>> Start就遇到了问題。为了避免自己问蠢问題,我先做了很多尝试,如换Flink的版本,从1.7到1.8及至1.9都试过,在我自己的Mac
>> > OS
>> > > > > X上这个问題是必然出现的,而换到其他操作系统例如Windows,则是正常的。
>> > > > >
>> > > > > 这也许不是一个常见的问題,更多是我本机的运行环境问題,但多天尝试下来仍然没有找到解决方法,才在这里求助一下。
>> > > > >
>> > > > > 操作步骤:
>> > > > > 1. ./bin/start-cluster.sh  # 启动flink。
>> > > > > 2. ./bin/flink run examples/batch/WordCount.jar   # 提交wordCount 包
>> > > > >
>> > > > > 随后就是抛了异常:
>> > > > > Starting execution of program
>> > > > > Executing WordCount example with default input data set.
>> > > > > Use --input to specify file input.
>> > > > > Printing result to stdout. Use --output to specify output path.
>> > > > >
>> > > > > ------------------------------------------------------------
>> > > > >  The program finished with the following exception:
>> > > > >
>> > > > > org.apache.flink.client.program.ProgramInvocationException: Could
>> not
>> > > > > retrieve the execution result. (JobID:
>> > > 81bc8720dee57710788cc8e41079ba4d)
>> > > > > at
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> org.apache.flink.client.program.rest.RestClusterClient.submitJob(RestClusterClient.java:255)
>> > > > > at
>> > > > >
>> > >
>> org.apache.flink.client.program.ClusterClient.run(ClusterClient.java:338)
>> > > > > at
>> > > > >
>> > >
>> org.apache.flink.client.program.ClusterClient.run(ClusterClient.java:326)
>> > > > > at
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> org.apache.flink.client.program.ContextEnvironment.execute(ContextEnvironment.java:62)
>> > > > > at
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> org.apache.flink.api.java.ExecutionEnvironment.execute(ExecutionEnvironment.java:820)
>> > > > > at org.apache.flink.api.java.DataSet.collect(DataSet.java:413)
>> > > > > at org.apache.flink.api.java.DataSet.print(DataSet.java:1652)
>> > > > > at
>> > > > >
>> > > >
>> > >
>> >
>> org.apache.flink.examples.java.wordcount.WordCount.main(WordCount.java:88)
>> > > > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> > > > > at
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>> > > > > at
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>> > > > > at java.lang.reflect.Method.invoke(Method.java:483)
>> > > > > at
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> org.apache.flink.client.program.PackagedProgram.callMainMethod(PackagedProgram.java:576)
>> > > > > at
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> org.apache.flink.client.program.PackagedProgram.invokeInteractiveModeForExecution(PackagedProgram.java:438)
>> > > > > at
>> > > > >
>> > >
>> org.apache.flink.client.program.ClusterClient.run(ClusterClient.java:274)
>> > > > > at
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> org.apache.flink.client.cli.CliFrontend.executeProgram(CliFrontend.java:746)
>> > > > > at
>> > > >
>> > org.apache.flink.client.cli.CliFrontend.runProgram(CliFrontend.java:273)
>> > > > > at
>> org.apache.flink.client.cli.CliFrontend.run(CliFrontend.java:205)
>> > > > > at
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> org.apache.flink.client.cli.CliFrontend.parseParameters(CliFrontend.java:1010)
>> > > > > at
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> org.apache.flink.client.cli.CliFrontend.lambda$main$10(CliFrontend.java:1083)
>> > > > > at
>> > > > >
>> > > >
>> > >
>> >
>> org.apache.flink.client.cli.CliFrontend$$Lambda$31/1990451863.call(Unknown
>> > > > > Source)
>> > > > > at
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> org.apache.flink.runtime.security.NoOpSecurityContext.runSecured(NoOpSecurityContext.java:30)
>> > > > > at
>> > org.apache.flink.client.cli.CliFrontend.main(CliFrontend.java:1083)
>> > > > > Caused by: org.apache.flink.runtime.client.JobSubmissionException:
>> > > Failed
>> > > > > to submit JobGraph.
>> > > > > at
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> org.apache.flink.client.program.rest.RestClusterClient.lambda$submitJob$8(RestClusterClient.java:382)
>> > > > > at
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> org.apache.flink.client.program.rest.RestClusterClient$$Lambda$44/1067599825.apply(Unknown
>> > > > > Source)
>> > > > > at
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> java.util.concurrent.CompletableFuture$ExceptionCompletion.run(CompletableFuture.java:1246)
>> > > > > at
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:193)
>> > > > > at
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> java.util.concurrent.CompletableFuture.internalComplete(CompletableFuture.java:210)
>> > > > > at
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> java.util.concurrent.CompletableFuture$ThenApply.run(CompletableFuture.java:723)
>> > > > > at
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:193)
>> > > > > at
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> java.util.concurrent.CompletableFuture.internalComplete(CompletableFuture.java:210)
>> > > > > at
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> java.util.concurrent.CompletableFuture$ThenCopy.run(CompletableFuture.java:1333)
>> > > > > at
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:193)
>> > > > > at
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2361)
>> > > > > at
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> org.apache.flink.runtime.concurrent.FutureUtils.lambda$retryOperationWithDelay$8(FutureUtils.java:263)
>> > > > > at
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> org.apache.flink.runtime.concurrent.FutureUtils$$Lambda$63/318445555.accept(Unknown
>> > > > > Source)
>> > > > > at
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> java.util.concurrent.CompletableFuture$WhenCompleteCompletion.run(CompletableFuture.java:1298)
>> > > > > at
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:193)
>> > > > > at
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> java.util.concurrent.CompletableFuture.internalComplete(CompletableFuture.java:210)
>> > > > > at
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> java.util.concurrent.CompletableFuture$AsyncCompose.exec(CompletableFuture.java:626)
>> > > > > at
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> java.util.concurrent.CompletableFuture$Async.run(CompletableFuture.java:428)
>> > > > > at
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>> > > > > at
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>> > > > > at java.lang.Thread.run(Thread.java:745)
>> > > > > Caused by: org.apache.flink.runtime.rest.util.RestClientException:
>> > > > > [Internal server error., <Exception on server side:
>> > > > > akka.pattern.AskTimeoutException: Ask timed out on
>> > > > > [Actor[akka://flink/user/dispatcher#-80166821]] after [10000 ms].
>> > > Message
>> > > > > of type
>> [org.apache.flink.runtime.rpc.messages.LocalFencedMessage]. A
>> > > > > typical reason for `AskTimeoutException` is that the recipient
>> actor
>> > > > didn't
>> > > > > send a reply.
>> > > > > at
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> akka.pattern.PromiseActorRef$.$anonfun$defaultOnTimeout$1(AskSupport.scala:635)
>> > > > > at
>> akka.pattern.PromiseActorRef$$$Lambda$190/1064265473.apply(Unknown
>> > > > > Source)
>> > > > > at
>> > akka.pattern.PromiseActorRef$.$anonfun$apply$1(AskSupport.scala:650)
>> > > > > at
>> > > >
>> > akka.pattern.PromiseActorRef$$$Lambda$191/517355658.apply$mcV$sp(Unknown
>> > > > > Source)
>> > > > > at akka.actor.Scheduler$$anon$4.run(Scheduler.scala:205)
>> > > > > at
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> scala.concurrent.Future$InternalCallbackExecutor$.unbatchedExecute(Future.scala:870)
>> > > > > at
>> > > scala.concurrent.BatchingExecutor.execute(BatchingExecutor.scala:109)
>> > > > > at
>> > > scala.concurrent.BatchingExecutor.execute$(BatchingExecutor.scala:103)
>> > > > > at
>> > > > >
>> > > >
>> > >
>> >
>> scala.concurrent.Future$InternalCallbackExecutor$.execute(Future.scala:868)
>> > > > > at
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> akka.actor.LightArrayRevolverScheduler$TaskHolder.executeTask(LightArrayRevolverScheduler.scala:328)
>> > > > > at
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> akka.actor.LightArrayRevolverScheduler$$anon$3.executeBucket$1(LightArrayRevolverScheduler.scala:279)
>> > > > > at
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> akka.actor.LightArrayRevolverScheduler$$anon$3.nextTick(LightArrayRevolverScheduler.scala:283)
>> > > > > at
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> akka.actor.LightArrayRevolverScheduler$$anon$3.run(LightArrayRevolverScheduler.scala:235)
>> > > > > at java.lang.Thread.run(Thread.java:745)
>> > > > >
>> > > > > End of exception on server side>]
>> > > > > at
>> > > > >
>> > > >
>> > >
>> >
>> org.apache.flink.runtime.rest.RestClient.parseResponse(RestClient.java:389)
>> > > > > at
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> org.apache.flink.runtime.rest.RestClient.lambda$submitRequest$3(RestClient.java:373)
>> > > > > at
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> org.apache.flink.runtime.rest.RestClient$$Lambda$62/2010911005.apply(Unknown
>> > > > > Source)
>> > > > > at
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> java.util.concurrent.CompletableFuture$AsyncCompose.exec(CompletableFuture.java:604)
>> > > > > ... 4 more
>> > > > >
>> > > > >
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>> 对了,在我的Mac上,遇到的奇怪问題还不止这一个,在其他人的机器上正常运行的Flink程序,到我这里都是有这样那样的问題的。所以,Flink对系统环境有什么依赖吗?
>> > > > > 我本地的环境是 jdk 1.8.0, maven 3.5.4
>> > > > >
>> > > > > 谢谢大家。
>> > > > >
>> > > >
>> > >
>> >
>>
>

回复