1、启动standalone集群的taskmanager
standalone集群中的taskmanager启动类为 TaskManagerRunner
2 打开master启动类
通过 ctrl+n快捷键,找到、并打开类:
org.apache.flink.runtime.taskexecutor.TaskManagerRunner
3 修改运⾏配置
基本完全按照master运⾏配置进⾏即可;
run org.apache.flink.streaming.examples.hitao.WorkCount ./demo.jar
就⼀个关于⽇志的配置稍微修改⼀下(⽇志⽂件的名称)
-Dlog.file=./log/flink-taskmanager-1.local.log -
Dlog4j.configuration=./conf/log4j.properties -
Dlog4j.configurationFile=./conf/log4j.properties -
Dlogback.configurationFile=./conf/logback.xml 6.3 修改flink-conf.yaml配置⽂件
找到项⽬根⽬录下的conf,打开其中的flink-conf.yaml
添加如下配置(主要就是taskmanager的各项内存配置,可根据⾃⼰的情况进⾏修改)
taskmanager.resource-id: tm_hitao
taskmanager.cpu.cores: 1
taskmanager.memory.task.heap.size: 512m
t askmanager.memory.managed.size: 512m
taskmanager.memory.network.min: 128m
taskmanager.memory.network.max: 128m
taskmanager.memory.task.off-heap.size: 0m