docker 部署 storm
docker run -d --restart always --name some-zookeeper zookeeper
docker run -d --restart always --name some-nimbus --link some-zookeeper:zookeeper storm storm nimbus
docker run -d --restart always --name supervisor --link some-zookeeper:zookeeper --link some-nimbus:nimbus storm storm supervisor
docker run -d -p 8887:8080 --restart always --name ui --link some-nimbus:nimbus storm storm ui
拜访 http://192.168.2.214:8887
提交 topology 集群 官网写的
docker run --link some-nimbus:nimbus -it --rm -v $(pwd)/topology.jar:/topology.jar storm storm jar /topology.jar org.apache.storm.starter.WordCountTopology topology
试了官网的形式 报错 Error: Could not find or load main class com.liang.netcar.charging.StormStart
docker run --link some-nimbus:nimbus -it --rm -v liang-netcar-charging-0.0.1-SNAPSHOT-jar-with-dependencies.jar:/liang.jar storm storm jar /liang.jar com.liang.netcar.charging.StormStart cluster
docker run --link some-nimbus:nimbus -it --rm -v liang-netcar-charging-0.0.1-SNAPSHOT-jar-with-dependencies.jar:/liang-netcar-charging-0.0.1-SNAPSHOT-jar-with-dependencies.jar storm storm jar /liang-netcar-charging-0.0.1-SNAPSHOT-jar-with-dependencies.jar com.liang.netcar.charging.StormStart cluster
官网 本地模式运行
docker run -it -v $(pwd)/topology.jar:/topology.jar storm storm jar /topology.jar org.apache.storm.starter.ExclamationTopology
本地模式也报错
docker run -it -v liang-netcar-charging-0.0.1-SNAPSHOT-jar-with-dependencies.jar:/liang-netcar-charging-0.0.1-SNAPSHOT-jar-with-dependencies.jar storm storm jar /liang-netcar-charging-0.0.1-SNAPSHOT-jar-with-dependencies.jar com.liang.netcar.charging.StormStart cluster
进入容器外面运行 胜利
docker cp liang-netcar-charging-0.0.1-SNAPSHOT-jar-with-dependencies.jar supervisor:/
docker exec -it supervisor /bin/bash
cd /
storm jar liang-netcar-charging-0.0.1-SNAPSHOT-jar-with-dependencies.jar com.liang.netcar.charging.StormStart cluster
进行
storm kill NetcarChargingStormStart -w 3