开发者社区> 问答> 正文

flink on k8s native 测试失败怎么办?

>
> 我这里在自己搭建的 k8s 测试环境中按照官网的 flink on k8s native
> 指南进行测试,然后一直报错,具体情况如下,请求大佬们的帮助,不胜感激。
>
> 一、环境
>
>     k8s  v1.18.16
>     flink  flink-1.12.2
>     java  openjdk version "11" 2018-09-25
>
> 二、官网规定的前提条件
>
>    1、Kubernetes >= 1.9  满足
>
>
>
>     2、权限检查  满足
>
>
>  3、启用 Kubernetes DNS  满足
>
>
> 4、default service account with RBAC
> <https://ci.apache.org/projects/flink/flink-docs-release-1.13/docs/deployment/resource-providers/native_kubernetes/#rbac> permissions
> to create, delete pods ,我这里创建新的 命名空间和账号,也是满足的,情况如下:
>
> kubectl create namespace flink-session-cluster
>
> kubectl create serviceaccount flink -n flink-session-cluster
>
> kubectl create clusterrolebinding flink-role-binding-flink \ --clusterrole
> =edit \ --serviceaccount=flink-session-cluster:flink
>
>
> 三、启动 session 并提交 flink 任务
>
>      3.1 启动session 命令
>
> ./bin/kubernetes-session.sh -Dkubernetes.cluster-id=my-first-flink-cluster
> \
> > -Dkubernetes.namespace=flink-session-cluster \
> > -Dkubernetes.jobmanager.service-account=flink \
> > -Dkubernetes.service.exposed.type=NodePort
>
>   日志:
>
>
>   3.2 提交flink 任务
>
>    命令:
>       ./bin/flink run \
> >     --target kubernetes-session \
> > -Dkubernetes.namespace=flink-session-cluster \
> >     -Dkubernetes.cluster-id=my-first-flink-cluster \
> > -Dkubernetes.jobmanager.service-account=flink \
> >     ./examples/streaming/TopSpeedWindowing.jar
>
>    报错日志如下:
>
> Executing TopSpeedWindowing example with default input data set.
> Use --input to specify file input.
> Printing result to stdout. Use --output to specify output path.
> WARNING: An illegal reflective access operation has occurred
> WARNING: Illegal reflective access by
> org.apache.flink.api.java.ClosureCleaner
> (file:/home/dsi/soft/flink/flink-1.12.2/lib/flink-dist_2.11-1.12.2.jar) to
> field java.lang.String.value
> WARNING: Please consider reporting this to the maintainers of
> org.apache.flink.api.java.ClosureCleaner
> WARNING: Use --illegal-access=warn to enable warnings of further illegal
> reflective access operations
> WARNING: All illegal access operations will be denied in a future release
> 2021-05-12 15:51:30,453 INFO
> org.apache.flink.kubernetes.KubernetesClusterDescriptor      [] - Retrieve
> flink cluster my-first-flink-cluster successfully, JobManager Web
> Interface: http://10.199.252.101:8081
>
> ------------------------------------------------------------
>  The program finished with the following exception:
>
> org.apache.flink.client.program.ProgramInvocationException: The main
> method caused an error: Failed to execute job 'CarTopSpeedWindowingExample'.
> at
> org.apache.flink.client.program.PackagedProgram.callMainMethod(PackagedProgram.java:366)
> at
> org.apache.flink.client.program.PackagedProgram.invokeInteractiveModeForExecution(PackagedProgram.java:219)
> at org.apache.flink.client.ClientUtils.executeProgram(ClientUtils.java:114)
> at
> org.apache.flink.client.cli.CliFrontend.executeProgram(CliFrontend.java:812)
> at org.apache.flink.client.cli.CliFrontend.run(CliFrontend.java:246)
> at
> org.apache.flink.client.cli.CliFrontend.parseAndRun(CliFrontend.java:1054)

> at

> org.apache.flink.client.cli.CliFrontend.lambda$main$10(CliFrontend.java:1132)

> at

> org.apache.flink.runtime.security.contexts.NoOpSecurityContext.runSecured(NoOpSecurityContext.java:28)

> at org.apache.flink.client.cli.CliFrontend.main(CliFrontend.java:1132)

> Caused by: org.apache.flink.util.FlinkException: Failed to execute job

> 'CarTopSpeedWindowingExample'.

> at

> org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.executeAsync(StreamExecutionEnvironment.java:1918)

> at

> org.apache.flink.client.program.StreamContextEnvironment.executeAsync(StreamContextEnvironment.java:135)

> at

> org.apache.flink.client.program.StreamContextEnvironment.execute(StreamContextEnvironment.java:76)

> at

> org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.execute(StreamExecutionEnvironment.java:1782)

> at

> org.apache.flink.streaming.examples.windowing.TopSpeedWindowing.main(TopSpeedWindowing.java:99)

> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native

> Method)

> at

> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

> at

> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

> at java.base/java.lang.reflect.Method.invoke(Method.java:566)

> at

> org.apache.flink.client.program.PackagedProgram.callMainMethod(PackagedProgram.java:349)

> ... 8 more

> Caused by: org.apache.flink.runtime.client.JobSubmissionException: Failed

> to submit JobGraph.

> at

> org.apache.flink.client.program.rest.RestClusterClient.lambda$submitJob$7(RestClusterClient.java:400)

> at

> java.base/java.util.concurrent.CompletableFuture.uniExceptionally(CompletableFuture.java:986)

> at

> java.base/java.util.concurrent.CompletableFuture$UniExceptionally.tryFire(CompletableFuture.java:970)

> at

> java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)

> at

> java.base/java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2088)

> at

> org.apache.flink.runtime.concurrent.FutureUtils.lambda$retryOperationWithDelay$9(FutureUtils.java:390)

> at

> java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:859)

> at

> java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:837)

> at

> java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)

> at

> java.base/java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2088)

> at

> org.apache.flink.runtime.rest.RestClient.lambda$submitRequest$1(RestClient.java:430)

> at

> org.apache.flink.shaded.netty4.io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:577)

> at

> org.apache.flink.shaded.netty4.io.netty.util.concurrent.DefaultPromise.notifyListeners0(DefaultPromise.java:570)

> at

> org.apache.flink.shaded.netty4.io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:549)

> at

> org.apache.flink.shaded.netty4.io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:490)

> at

> org.apache.flink.shaded.netty4.io.netty.util.concurrent.DefaultPromise.setValue0(DefaultPromise.java:615)

> at

> org.apache.flink.shaded.netty4.io.netty.util.concurrent.DefaultPromise.setFailure0(DefaultPromise.java:608)

> at

> org.apache.flink.shaded.netty4.io.netty.util.concurrent.DefaultPromise.tryFailure(DefaultPromise.java:117)

> at

> org.apache.flink.shaded.netty4.io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.fulfillConnectPromise(AbstractNioChannel.java:321)

> at

> org.apache.flink.shaded.netty4.io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:337)

> at

> org.apache.flink.shaded.netty4.io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:702)

> at

> org.apache.flink.shaded.netty4.io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:650)

> at

> org.apache.flink.shaded.netty4.io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:576)

> at

> org.apache.flink.shaded.netty4.io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)

> at

> org.apache.flink.shaded.netty4.io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)

> at

> org.apache.flink.shaded.netty4.io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)

> at java.base/java.lang.Thread.run(Thread.java:834)

> Caused by: org.apache.flink.runtime.concurrent.FutureUtils$RetryException:

> Could not complete the operation. Number of retries has been exhausted.

> at

> org.apache.flink.runtime.concurrent.FutureUtils.lambda$retryOperationWithDelay$9(FutureUtils.java:386)

> ... 21 more

> Caused by: java.util.concurrent.CompletionException:

> org.apache.flink.shaded.netty4.io.netty.channel.AbstractChannel$AnnotatedConnectException:

> Connection refused: /10.199.252.101:8081

> at

> java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:331)

> at

> java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:346)

> at

> java.base/java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1063)

> ... 19 more

> Caused by:

> org.apache.flink.shaded.netty4.io.netty.channel.AbstractChannel$AnnotatedConnectException:

> Connection refused: /10.199.252.101:8081

> Caused by: java.net.ConnectException: Connection refused

> at java.base/sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)

> at

> java.base/sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:779)

> at

> org.apache.flink.shaded.netty4.io.netty.channel.socket.nio.NioSocketChannel.doFinishConnect(NioSocketChannel.java:330)

> at

> org.apache.flink.shaded.netty4.io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:334)

> at

> org.apache.flink.shaded.netty4.io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:702)

> at

> org.apache.flink.shaded.netty4.io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:650)

> at

> org.apache.flink.shaded.netty4.io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:576)

> at

> org.apache.flink.shaded.netty4.io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)

> at

> org.apache.flink.shaded.netty4.io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)

> at

> org.apache.flink.shaded.netty4.io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)

> at java.base/java.lang.Thread.run(Thread.java:834)

>

>

> Best,

>

> Luke Yan

>

>*来自志愿者整理的flink邮件归档

展开
收起
EXCEED 2021-12-02 11:08:55 1051 0
1 条回答
写回答
取消 提交回答
  • 你参数配置错了,应该是kubernetes.rest-service.exposed.type=NodePort*来自志愿者整理的FLINK邮件归档

    2021-12-02 11:24:44
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
Flink CDC Meetup PPT - 龚中强 立即下载
Flink CDC Meetup PPT - 王赫 立即下载
Flink CDC Meetup PPT - 覃立辉 立即下载

相关镜像