How to get CLI parameters when deploy on yarn cluster

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to get CLI parameters when deploy on yarn cluster

范超
Hi, Flink community

I’m starter at Flink ,and don’t know how to passing parameters to my jar file, where I want to start the job in detached mode on the yarn cluster.
Here is my shell code:

/usr/local/flink/bin/flink run -m yarn-cluster -d -p 3 ~/project/test/app/test.jar -runat=test 2>&1

In my jar file, the code will use different config.properties file by reading the “runat” CLI parameter, but I don’t know how to get this CLI parameter
or could you please tell me if I’ve two environment one for testing and the other for production environment property files, how can I start it using cli option?

Thanks a lot , Any help is appreciated.

Chao fan

winmail.dat (16K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How to get CLI parameters when deploy on yarn cluster

Jake
Hi fanchao

You can use params after jar file.

/usr/local/flink/bin/flink run -m yarn-cluster -d -p 3 ~/project/test/app/test.jar param1 param2 param3


Jake

On Jul 27, 2020, at 6:19 PM, 范超 <[hidden email]> wrote:

Hi, Flink community

I’m starter at Flink ,and don’t know how to passing parameters to my jar file, where I want to start the job in detached mode on the yarn cluster.
Here is my shell code:

/usr/local/flink/bin/flink run -m yarn-cluster -d -p 3 ~/project/test/app/test.jar -runat=test 2>&1

In my jar file, the code will use different config.properties file by reading the “runat” CLI parameter, but I don’t know how to get this CLI parameter
or could you please tell me if I’ve two environment one for testing and the other for production environment property files, how can I start it using cli option?

Thanks a lot , Any help is appreciated.

Chao fan
<winmail.dat>

Reply | Threaded
Open this post in threaded view
|

答复: How to get CLI parameters when deploy on yarn cluster

范超

Thanks Jake , I’ll try it out. It worked!

 

发件人: Jake [mailto:[hidden email]]
发送时间: 2020727日 星期一 18:33
收件人: 范超 <[hidden email]>
抄送: user ([hidden email]) <[hidden email]>
主题: Re: How to get CLI parameters when deploy on yarn cluster

 

Hi fanchao

 

You can use params after jar file.

 

/usr/local/flink/bin/flink run -m yarn-cluster -d -p 3 ~/project/test/app/test.jar param1 param2 param3

 

 

Jake



On Jul 27, 2020, at 6:19 PM, 范超 <[hidden email]> wrote:

 

Hi, Flink community

I’m starter at Flink ,and don’t know how to passing parameters to my jar file, where I want to start the job in detached mode on the yarn cluster.
Here is my shell code:

/usr/local/flink/bin/flink run -m yarn-cluster -d -p 3 ~/project/test/app/test.jar -runat=test 2>&1

In my jar file, the code will use different config.properties file by reading the “runat” CLI parameter, but I don’t know how to get this CLI parameter
or could you please tell me if I’ve two environment one for testing and the other for production environment property files, how can I start it using cli option?

Thanks a lot , Any help is appreciated.

Chao fan
<winmail.dat>