How To Get System.getProperties() In Apache Flink Jobs











up vote
0
down vote

favorite












I am running flink standalone cluster that consist of 3 servers. I added "env.java.opts: '-Dmykey=1000'" this settings on my 3 nodes, in this file flink-1.6.0/conf/flink-conf.yaml



When I check java programs, I can see this parameter passed through to my TaskManager and JobManager



 /usr/lib/jvm/java-8-oracle/bin/java -Xms15360M -Xmx15360M -XX:MaxDirectMemorySize=8388607T -Dmykey=1000 -Dlog.file=/home/kafka/flink-1.6.0/log/flink-


When I try to print out all properties, iterating System.getProperties(), I cannot fetch my custom properties.



I have libraries that uses property files to get external information, I cannot change my libraries, make them use ParameterTools. I did a lot things, but still could not solve this. Is there any advice for me?










share|improve this question






















  • You can try querying the configurations for keys env.java.opts.jobmanager and env.java.opts.taskmanager. Refer ci.apache.org/projects/flink/flink-docs-stable/ops/…
    – shriyog
    Nov 12 at 6:46










  • @shriyog when I look at the linux processes, I see -Dmykey=1000. But I cannot get it in my program.
    – Yılmaz
    Nov 13 at 10:27










  • Did you use the above mentioned keynames for getting values from the configuration map?
    – shriyog
    Nov 13 at 10:28










  • @shriyog When I submit my fat jar, I print out all System.getProperties() values. For example, I can see log.file key and value of it, but I cannot see mykey and value of it.
    – Yılmaz
    Nov 13 at 10:35










  • I tried it out and it seemed to work for me. Where exactly are you printing the system properties? Please make sure that this happens on the cluster (e.g. in a user code function). If you print it outside of a user function, it will actually be executed on the client.
    – Till Rohrmann
    Nov 20 at 16:42















up vote
0
down vote

favorite












I am running flink standalone cluster that consist of 3 servers. I added "env.java.opts: '-Dmykey=1000'" this settings on my 3 nodes, in this file flink-1.6.0/conf/flink-conf.yaml



When I check java programs, I can see this parameter passed through to my TaskManager and JobManager



 /usr/lib/jvm/java-8-oracle/bin/java -Xms15360M -Xmx15360M -XX:MaxDirectMemorySize=8388607T -Dmykey=1000 -Dlog.file=/home/kafka/flink-1.6.0/log/flink-


When I try to print out all properties, iterating System.getProperties(), I cannot fetch my custom properties.



I have libraries that uses property files to get external information, I cannot change my libraries, make them use ParameterTools. I did a lot things, but still could not solve this. Is there any advice for me?










share|improve this question






















  • You can try querying the configurations for keys env.java.opts.jobmanager and env.java.opts.taskmanager. Refer ci.apache.org/projects/flink/flink-docs-stable/ops/…
    – shriyog
    Nov 12 at 6:46










  • @shriyog when I look at the linux processes, I see -Dmykey=1000. But I cannot get it in my program.
    – Yılmaz
    Nov 13 at 10:27










  • Did you use the above mentioned keynames for getting values from the configuration map?
    – shriyog
    Nov 13 at 10:28










  • @shriyog When I submit my fat jar, I print out all System.getProperties() values. For example, I can see log.file key and value of it, but I cannot see mykey and value of it.
    – Yılmaz
    Nov 13 at 10:35










  • I tried it out and it seemed to work for me. Where exactly are you printing the system properties? Please make sure that this happens on the cluster (e.g. in a user code function). If you print it outside of a user function, it will actually be executed on the client.
    – Till Rohrmann
    Nov 20 at 16:42













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I am running flink standalone cluster that consist of 3 servers. I added "env.java.opts: '-Dmykey=1000'" this settings on my 3 nodes, in this file flink-1.6.0/conf/flink-conf.yaml



When I check java programs, I can see this parameter passed through to my TaskManager and JobManager



 /usr/lib/jvm/java-8-oracle/bin/java -Xms15360M -Xmx15360M -XX:MaxDirectMemorySize=8388607T -Dmykey=1000 -Dlog.file=/home/kafka/flink-1.6.0/log/flink-


When I try to print out all properties, iterating System.getProperties(), I cannot fetch my custom properties.



I have libraries that uses property files to get external information, I cannot change my libraries, make them use ParameterTools. I did a lot things, but still could not solve this. Is there any advice for me?










share|improve this question













I am running flink standalone cluster that consist of 3 servers. I added "env.java.opts: '-Dmykey=1000'" this settings on my 3 nodes, in this file flink-1.6.0/conf/flink-conf.yaml



When I check java programs, I can see this parameter passed through to my TaskManager and JobManager



 /usr/lib/jvm/java-8-oracle/bin/java -Xms15360M -Xmx15360M -XX:MaxDirectMemorySize=8388607T -Dmykey=1000 -Dlog.file=/home/kafka/flink-1.6.0/log/flink-


When I try to print out all properties, iterating System.getProperties(), I cannot fetch my custom properties.



I have libraries that uses property files to get external information, I cannot change my libraries, make them use ParameterTools. I did a lot things, but still could not solve this. Is there any advice for me?







apache-flink flink-streaming






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 9 at 14:50









Yılmaz

7019




7019












  • You can try querying the configurations for keys env.java.opts.jobmanager and env.java.opts.taskmanager. Refer ci.apache.org/projects/flink/flink-docs-stable/ops/…
    – shriyog
    Nov 12 at 6:46










  • @shriyog when I look at the linux processes, I see -Dmykey=1000. But I cannot get it in my program.
    – Yılmaz
    Nov 13 at 10:27










  • Did you use the above mentioned keynames for getting values from the configuration map?
    – shriyog
    Nov 13 at 10:28










  • @shriyog When I submit my fat jar, I print out all System.getProperties() values. For example, I can see log.file key and value of it, but I cannot see mykey and value of it.
    – Yılmaz
    Nov 13 at 10:35










  • I tried it out and it seemed to work for me. Where exactly are you printing the system properties? Please make sure that this happens on the cluster (e.g. in a user code function). If you print it outside of a user function, it will actually be executed on the client.
    – Till Rohrmann
    Nov 20 at 16:42


















  • You can try querying the configurations for keys env.java.opts.jobmanager and env.java.opts.taskmanager. Refer ci.apache.org/projects/flink/flink-docs-stable/ops/…
    – shriyog
    Nov 12 at 6:46










  • @shriyog when I look at the linux processes, I see -Dmykey=1000. But I cannot get it in my program.
    – Yılmaz
    Nov 13 at 10:27










  • Did you use the above mentioned keynames for getting values from the configuration map?
    – shriyog
    Nov 13 at 10:28










  • @shriyog When I submit my fat jar, I print out all System.getProperties() values. For example, I can see log.file key and value of it, but I cannot see mykey and value of it.
    – Yılmaz
    Nov 13 at 10:35










  • I tried it out and it seemed to work for me. Where exactly are you printing the system properties? Please make sure that this happens on the cluster (e.g. in a user code function). If you print it outside of a user function, it will actually be executed on the client.
    – Till Rohrmann
    Nov 20 at 16:42
















You can try querying the configurations for keys env.java.opts.jobmanager and env.java.opts.taskmanager. Refer ci.apache.org/projects/flink/flink-docs-stable/ops/…
– shriyog
Nov 12 at 6:46




You can try querying the configurations for keys env.java.opts.jobmanager and env.java.opts.taskmanager. Refer ci.apache.org/projects/flink/flink-docs-stable/ops/…
– shriyog
Nov 12 at 6:46












@shriyog when I look at the linux processes, I see -Dmykey=1000. But I cannot get it in my program.
– Yılmaz
Nov 13 at 10:27




@shriyog when I look at the linux processes, I see -Dmykey=1000. But I cannot get it in my program.
– Yılmaz
Nov 13 at 10:27












Did you use the above mentioned keynames for getting values from the configuration map?
– shriyog
Nov 13 at 10:28




Did you use the above mentioned keynames for getting values from the configuration map?
– shriyog
Nov 13 at 10:28












@shriyog When I submit my fat jar, I print out all System.getProperties() values. For example, I can see log.file key and value of it, but I cannot see mykey and value of it.
– Yılmaz
Nov 13 at 10:35




@shriyog When I submit my fat jar, I print out all System.getProperties() values. For example, I can see log.file key and value of it, but I cannot see mykey and value of it.
– Yılmaz
Nov 13 at 10:35












I tried it out and it seemed to work for me. Where exactly are you printing the system properties? Please make sure that this happens on the cluster (e.g. in a user code function). If you print it outside of a user function, it will actually be executed on the client.
– Till Rohrmann
Nov 20 at 16:42




I tried it out and it seemed to work for me. Where exactly are you printing the system properties? Please make sure that this happens on the cluster (e.g. in a user code function). If you print it outside of a user function, it will actually be executed on the client.
– Till Rohrmann
Nov 20 at 16:42

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53228032%2fhow-to-get-system-getproperties-in-apache-flink-jobs%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53228032%2fhow-to-get-system-getproperties-in-apache-flink-jobs%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Landwehr

Reims

Schenkenzell