如何将JVM参数传递给storm应用程序

fsi0uk1n  于 2022-12-09  发布在  Apache
关注(0)|答案(2)|浏览(159)

我正在开发一个storm应用程序,需要使用vmargs传递环境和云信息。程序参数会引发安全问题,因为我使用System.setproperty & properties文件设置这些值,而我无法使用。Vmargs不支持storm。你知道我还能做什么吗?

pkwftd7m

pkwftd7m1#

I assume you are running storm in cluster mode on a remote machine. In this case, storm suggests you to use the storm jar command. It is true, that this by default accepts just a few arguments since it is internally using a python script that is calling java.
But it seems to be possible to start storm with a java command as well and pass command line commands to that - see this link .

u3r8eeie

u3r8eeie2#

Another method to pass some variables to topology is the environment variable substitution in a flux file and run

name: topo${ENV-YOURVAR}

when run in bash looks like:

export YOURVAR=test
storm jar yourtopo.jar org.apache.storm.flux.Flux yourtopo.flux -e

Flag -e tells storm to substitute environment variables in the flux file

相关问题