关于flink的日志文件设置

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

1)yarn的启动脚本

exec /bin/bash -c "$JAVA_HOME/bin/java -Xms580m -Xmx580m -XX:MaxDirectMemorySize=320m -Daaa=1  -XX:NativeMemoryTracking=detail -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=70  -XX:+UseCompressedClassPointers -XX:CompressedClassSpaceSize=512M -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m -Dlog.file=/data/yarn/container-logs/application_1542184485247_0212/container_e17_1542184485247_0212_01_000003/taskmanager.log -Dlog4j.configuration=file:./log4j.properties org.apache.flink.yarn.YarnTaskManager --configDir . 1> /data/yarn/container-logs/application_1542184485247_0212/container_e17_1542184485247_0212_01_000003/taskmanager.out 2> /data/yarn/container-logs/application_1542184485247_0212/container_e17_1542184485247_0212_01_000003/taskmanager.err"

2)log4j.properties

log4j.rootLogger=INFO, file

log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=[%d] %p %m (%c) %l %n

log4j.appender.file=org.apache.log4j.DailyRollingFileAppender
log4j.appender.file.DatePattern='.'yyyy-MM-dd-HH
log4j.appender.file.File=${log.file}
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=[%d] %p %m (%c)%n

3)flink-conf.yaml

env.java.opts.taskmanager: -Daaa=1  -XX:NativeMemoryTracking=detail -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=70  -XX:+UseCompressedClassPointers -XX:CompressedClassSpaceSize=512M -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m -XX:+PrintGCDetails -Xloggc:${LOG_DIRS}/taskmanager.out

就可以了!

转载于:https://my.oschina.net/qiangzigege/blog/2878074

你可能感兴趣的:(关于flink的日志文件设置)