FLINK-通过REST API提交Flink作业时如何传递自定义参数
我需要在Flink作业中提供一个解密的密码,以将其连接到Redis。但是,Redis密码只能在本地机器上解密。因此,我的计划是首先在本地解密,然后在通过REST API提交工作时尝试将其传递给Flink。 (我不允许将解密的密码写入属性文件。)
这是可能的吗?我注意到我可以在 programargs programargslist 监视/rest_api.html#jars-jarid-run“ rel =“ nofollow noreferrer”> json post request 。但是,我找不到在程序中访问这些参数的任何方法。
我已经检查了streamExecutionEnvironment.getExecutionEnvironment()。getConfig()
,但是参数并未保存在那里。
有什么方法可以访问我在作业中提交的参数?还是有更好的方法可以实现相同的目标?
I need to provide a decrypted password in a Flink job to connect it to redis. But the redis password can only be decrypted on a local machine. So my plan is to decrypt it locally first and then try to pass it to Flink when submitting the job through REST API. (I'm not allowed to write the decrypted password to the properties file.)
Is this possible? I noticed that I can specify programArgs
and programArgsList
in the JSON POST request. However, I'm not finding any means to access these parameters inside my program.
I have checked StreamExecutionEnvironment.getExecutionEnvironment().getConfig()
, but the parameters are not saved there.
Is there any way to access the parameters which I submitted with the job? Or are there better ways to achieve the same goal?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它们是Java程序参数:
您将在
args
数组中将它们放在。该文档在此处提到: https://nightlies.apache.org/flink/flink/flink-docs-stable/docs/dev/datastream/application_parameters/#from-the-from-the-command-line-line-line-argumentsThey are Java program arguments:
You'll have them in the
args
array. The documentation mentions it in here: https://nightlies.apache.org/flink/flink-docs-stable/docs/dev/datastream/application_parameters/#from-the-command-line-arguments