Window10安装Flink1.10.0-大坑

Window10安装Flink1.10.0

基本可以确定在window10安装Flink1.10.0启动时会出问题,特别恶心,目前无法修复,现在讲一讲我的踩坑经历。

首先我们去官网下载压缩包,官网下载地址:https://flink.apache.org/downloads.html

一步到位地址:http://archive.apache.org/dist/flink/flink-1.10.0/

image
image

下载后到本地解压到自己喜欢的一个路径下,尽量不要带中文路径,保持良好的开发规范。

找到对应安装路径下 apache-flink-1.10.0\bin找到 start-cluster.bat双击或者在cmd命令行执行。

正常是会非常顺利的起来,但是如果执行后会默认打开两个cmd窗口,一个是Jobmanager,一个是taskmanager,过了没一会,taskmanager的窗口突然就消失了,访问集群页面 http://localhost:8081/#/overview

image

发现taskmanager没有起来,此时此刻只能去 apache-flink-1.10.0\deps\log路径下去找taskmanager日志文件,查看到底是什么情况,我们会发现有一个 flink-用户名-taskmanager.log文件我们打开文件会提示类似错误

2020-04-02 10:06:28,864 ERROR org.apache.flink.runtime.taskexecutor.TaskManagerRunner       - TaskManager initialization failed.
org.apache.flink.configuration.IllegalConfigurationException: Failed to create TaskExecutorResourceSpec
    at org.apache.flink.runtime.taskexecutor.TaskExecutorResourceUtils.resourceSpecFromConfig(TaskExecutorResourceUtils.java:72)
    at org.apache.flink.runtime.taskexecutor.TaskManagerRunner.startTaskManager(TaskManagerRunner.java:356)
    at org.apache.flink.runtime.taskexecutor.TaskManagerRunner.(TaskManagerRunner.java:152)
    at org.apache.flink.runtime.taskexecutor.TaskManagerRunner.runTaskManager(TaskManagerRunner.java:308)
    at org.apache.flink.runtime.taskexecutor.TaskManagerRunner.lambda$runTaskManagerSecurely$2(TaskManagerRunner.java:322)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAs(Subject.java:422)
    at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1754)
    at org.apache.flink.runtime.security.HadoopSecurityContext.runSecured(HadoopSecurityContext.java:41)
    at org.apache.flink.runtime.taskexecutor.TaskManagerRunner.runTaskManagerSecurely(TaskManagerRunner.java:321)
    at org.apache.flink.runtime.taskexecutor.TaskManagerRunner.main(TaskManagerRunner.java:287)
Caused by: org.apache.flink.configuration.IllegalConfigurationException: The required configuration option Key: 'taskmanager.cpu.cores' , default: null (fallback keys: []) is not set
    at org.apache.flink.runtime.taskexecutor.TaskExecutorResourceUtils.checkConfigOptionIsSet(TaskExecutorResourceUtils.java:90)
    at org.apache.flink.runtime.taskexecutor.TaskExecutorResourceUtils.lambda$checkTaskExecutorResourceConfigSet$0(TaskExecutorResourceUtils.java:84)
    at java.util.Arrays$ArrayList.forEach(Arrays.java:3880)
    at org.apache.flink.runtime.taskexecutor.TaskExecutorResourceUtils.checkTaskExecutorResourceConfigSet(TaskExecutorResourceUtils.java:84)
    at org.apache.flink.runtime.taskexecutor.TaskExecutorResourceUtils.resourceSpecFromConfig(TaskExecutorResourceUtils.java:70)
    ... 10 more
2020-04-02 10:06:28,890 INFO  org.apache.flink.runtime.blob.TransientBlobCache              - Shutting down BLOB cache
2020-04-02 10:06:28,902 INFO  org.apache.flink.runtime.blob.PermanentBlobCache              - Shutting down BLOB cache

大致意思是说 taskmanager.cpu.cores 没有设置这个必需具体的参数,默认是NULL,需要我们手动设置一下具体的值,根据机器配置可自行设置参数,接下来重新集群还会提示很多类似的配置参数没设置的错误,而且每次只会提示一条,笔者在这里把所有的坑都踩了一下,最后的问题基本是window系统与Flink1.10.0不太兼容,建议换成Linux或者MAC环境。

你可能感兴趣的:(Window10安装Flink1.10.0-大坑)