Re: Issues with forwarding environment variables

2021-05-20 Thread Yangze Guo
Hi, Milind Could you help to provide the skeleton of your job code? Actually, if you implement a custom function, like Tokenizer in the WordCount example, the class member will be initialized at the client-side and be serialized to the task manager. As a result, neither the system envs nor the sys

Re: Issues with forwarding environment variables

2021-05-20 Thread Milind Vaidya
This is java code. I have a flink job running and it is trying to fetch this variable at run time itself. I see the properties getting reflected in the logs as already mentioned but not visible from the code. On Thu, May 20, 2021 at 1:53 PM Roman Khachatryan wrote: > > private String serviceName

Re: Issues with forwarding environment variables

2021-05-20 Thread Roman Khachatryan
> private String serviceName = System.getenv("SERVICE_NAME"); Is it a scala object? If so, it can be initialized before any properties are set. What happens if the variable/property is read later at run time? Regards, Roman On Thu, May 20, 2021 at 10:41 PM Milind Vaidya wrote: > > here are the e

Re: Issues with forwarding environment variables

2021-05-20 Thread Milind Vaidya
here are the entries from taskmanager logs 2021-05-20 13:34:13,739 INFO org.apache.flink.configuration. GlobalConfiguration - Loading configuration property: env.java.opts.taskmanager, "-DSERVICE_NAME=hello-test,-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005" 2021-05-20 13:34:1

Re: Issues with forwarding environment variables

2021-05-20 Thread Roman Khachatryan
Thanks, it should work. I've created a ticket to track the issue [1]. Could you please specify Flink and Yarn versions you are using? You can also use properties (which don't depend on Yarn integration), for example like this: In flink-conf.yaml: env.java.opts.taskmanager: -DSERVICE_NAME=... In th

Re: Issues with forwarding environment variables

2021-05-20 Thread Milind Vaidya
Hi Roman, I have added following lines to conf/flink-conf.yaml containerized.taskmanager.env.SERVICE_NAME: "test_service_name" containerized.master.env.SERVICE_NAME: "test_service_name" On Thu, May 20, 2021 at 12:30 PM Roman Khachatryan wrote: > Hi, > > Could you please share the relevant

Re: Issues with forwarding environment variables

2021-05-20 Thread Roman Khachatryan
Hi, Could you please share the relevant parts of your flink-conf.yaml? Regards, Roman On Thu, May 20, 2021 at 9:13 PM Milind Vaidya wrote: > > Hi > > Need to forward a few env variables to Job and Task manager. > I am running jobs in Yarn cluster > I was referring to this : Forwarding > > I als

Issues with forwarding environment variables

2021-05-20 Thread Milind Vaidya
Hi Need to forward a few env variables to Job and Task manager. I am running jobs in Yarn cluster I was referring to this : Forwarding I also found Stack Overflow