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 the application: System.getProperty("SERVICE_NAME");

Regards,
Roman

On Thu, May 20, 2021 at 9:50 PM Milind Vaidya <kava...@gmail.com> wrote:
>
>
> 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 <ro...@apache.org> wrote:
>>
>> 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 <kava...@gmail.com> 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 also found Stack Overflow
>> >
>> > I was able to configure and see the variables in Flink Dashboard
>> >
>> > But the task manager logs stills says
>> >
>> > `The system environment variable SERVICE_NAME is missing` as an exception 
>> > message.
>> >
>> > The code trying to fetch it is as follows
>> >
>> > private String serviceName = System.getenv("SERVICE_NAME");
>> >
>> > Is the fetched one not the same as set one ? How to set / fetch 
>> > environment variables in such case ?
>> >

Reply via email to