Apache storm 将拓扑部署到不同的远程群集?
我正在为storm(storm project.net)开发拓扑。我有两个远程集群:临时集群和生产集群 我在客户端(我在笔记本电脑上编写代码)上有两个storm.yaml文件,它们指向不同的远程集群production.storm.yaml和staging.storm.yaml 不幸的是,我知道在它们之间切换的唯一方法是在通过“storm jar”命令远程部署拓扑之前,将符号链接更改为~/.storm/storm.yaml。这很容易出错,并且会在项目源代码树中创建对客户端文件树中任意位置的内容的依赖关系Apache storm 将拓扑部署到不同的远程群集?,apache-storm,Apache Storm,我正在为storm(storm project.net)开发拓扑。我有两个远程集群:临时集群和生产集群 我在客户端(我在笔记本电脑上编写代码)上有两个storm.yaml文件,它们指向不同的远程集群production.storm.yaml和staging.storm.yaml 不幸的是,我知道在它们之间切换的唯一方法是在通过“storm jar”命令远程部署拓扑之前,将符号链接更改为~/.storm/storm.yaml。这很容易出错,并且会在项目源代码树中创建对客户端文件树中任意位置的内容的
一定有更好的办法。“storm list--config staging.storm.yaml”将为我提供有关staging集群的信息,但我找不到可比较的标志来将conf文件设置为“storm jar”。或者我可以设置一个环境变量,比如“STORM_HOME”?我也有同样的问题。我所做的是编写一个用于部署Storm拓扑的Makefile。不同的目标将创建不同的符号链接。比如:
export STORM_PATH=/opt/storm
export PROJECT_PATH=/project/path
compile:
cd $(PROJECT_PATH)
mvn compile
package:
cd $(PROJECT_PATH)
mvn package
deploy-staging: package
ln -s $(STORM_PATH)/conf/staging.storm.yaml $(STORM_PATH)/conf/storm.yaml
storm jar $(PROJECT_PATH)/target/project.jar my.project.Topology myTopology
deploy-production: package
ln -s $(STORM_PATH)/conf/production.storm.yaml $(STORM_PATH)/conf/storm.yaml
storm jar $(PROJECT_PATH)/target/project.jar my.project.Topology myTopology
因此,要将拓扑部署到生产环境中,您可以:
make deploy-production
舞台也是如此。您将看到拓扑也已打包(如果使用Maven)。您还可以将不同的yaml文件作为存储库的一部分,并将符号链接指向存储库。或者,您可以在部署计算机上拥有yaml文件,并且对于不同的部署,这些文件可以不同。始终使用相同的名称。您不需要维护单独的.yaml文件。您可以使用
-c
命令行选项覆盖nimbus.host
配置:
storm jar -c nimbus.host=nimbus.example.com my-storm-jar.jar com.example.MyTopology
是否可以通过外部属性文件传递nimbus.host?