1.首先下载源码
2.本地运行
新建local_conf和local_lib文件夹,并且将编译后的文件放入对应的目录
2.1 启动前参数配置
2.1.2 StandaloneSessionClusterEntrypoint启动参数修改
2.1.3 TaskManagerRunner启动参数修改
和StandaloneSessionClusterEntrypoint一样修改
-Dlog.file=./log/flink-taskmanager-1.local.log -Dlog4j.configuration=./alocal_conf/log4j.properties -Dlog4j.configurationFile=./alocal_conf/log4j.properties -Dlogback.configurationFile=./alocal_conf/logback.xml
2.2 启动
先启动StandaloneSessionClusterEntrypoint
再启动TaskManagerRunner
遇到的问题:
1.no scalac found to compile scala sources
2.最开始采用java11编译没问题运行出错,程序包sun.misc不存在 之后修改为java8
config.yaml
# JobManager 的主机地址
jobmanager.rpc.address: localhost
# The RPC port where the JobManager is reachable.
#可访问JobManager的RPC端口
jobmanager.rpc.port: 6123
#jobmanager绑定ip,
jobmanager.bind-host: localhost
#JVM 进程总内存
jobmanager.memory.process.size: 1600m
#taskmanager绑定ip,
taskmanager.bind-host: localhost
#唯一标识 window下必须配置
taskmanager.resource-id: n1
taskmanager.cpu.cores: 1
#任务的堆内存
taskmanager.memory.task.heap.size: 512m
#托管内存
taskmanager.memory.managed.size: 512m
#网络内存(Network Memory)
taskmanager.memory.network.min: 128m
taskmanager.memory.network.max: 128m
#任务堆外内存
taskmanager.memory.task.off-heap.size: 0m
#框架内存
taskmanager.memory.framework.heap.size: 256m
#框架堆外内存
taskmanager.memory.framework.off-heap.size: 128m
#JVM Metaspace
taskmanager.memory.jvm-metaspace.size: 128m
#JVM 开销
taskmanager.memory.jvm-overhead.min: 128m
taskmanager.memory.jvm-overhead.max: 128m
#心跳参数
heartbeat.timeout: 50000
heartbeat.interval: 10000
taskmanager.host: localhost
# 进程总内存大小
taskmanager.memory.process.size: 1728m
#每个 TaskManager上并发的 slot 数
taskmanager.numberOfTaskSlots: 1
# The parallelism used for programs that did not specify and other parallelism.
#用于未指定的程序的并行度和其他并行度。
parallelism.default: 1
jobmanager.execution.failover-strategy: region
rest.address: localhost
rest.bind-address: localhost