Flink - adding tools

I want to add NewRelic tools to my fling work. I do not see where it is possible to pass additional classpath / other params parameters to the bin/flink run <job> command.

The NewRelic Java Agent wants to add -javaagent:<path to jar> to the execution path. It is also recommended that you skip the path to the configuration file.


Edit:

I added this line to my conf / flink-conf.yaml on all (3) cluster machines:

 env.java.opts: "-javaagent:/opt/newrelic/newrelic.jar -Dnewrelic.config.file=/opt/newrelic/newrelic.yml" 

When I started the cluster, only the job manager will start. Dispatcher It does not start on any of the machines.

The only way I was able to add the toolkit (for now) is to change the command line at the end of bin / flink to include the above options. This is fine, except that it requires a session in which the command was run in order to remain open. If you exit, Flink continues, but the NewRelic agent exits.

+5
source share
2 answers

You can pass additional JVM startup parameters using the env.java.opts configuration env.java.opts , which you can set in the Flink configuration file flink-conf.yaml .

+4
source

First remove the quotation marks in the value (right)

 env.java.opts: -javaagent:/opt/newrelic/newrelic.jar -Dnewrelic.config.file=/opt/newrelic/newrelic.yml 

Also make sure you put the files in the "lib" flink directory and rewrite the command as

 env.java.opts: -javaagent:lib/newrelic.jar -Dnewrelic.config.file=lib/newrelic.yml 

All files in the "lib" directory will be copied to the task manager and task managers and are available in the relative path "./lib"

0
source

Source: https://habr.com/ru/post/1236552/


All Articles