Stopping Storm: the right way

為{幸葍}努か 提交于 2019-12-03 08:51:11

问题


Is there a clean way to stop storm without killing it with "kill XXX" where XXX is the PID?

I run "storm kill topology-name" to kill the topology, but after that, is there a clean way to shutdown workers, nimbus, supervisor and ui?

I didn't find any command which corresponds to this from the documentation: https://github.com/nathanmarz/storm/wiki/Command-line-client


回答1:


Command to kill a topology (as you rightly mentioned):

storm kill topology-name

To shutdown the cluster you need to run the following command on each node:

sudo service supervisord stop

Note: give supervisord a few seconds to shutdown all processes. Note that trying to run supervisorctl when supervisord itself is stopped will result in an error message (this appears to be a known user interface issue in supervisord 2.x)

From this documentation

How to kill ALL Storm processes including worker processes? Any worker threads (launched by the Supervisor daemons on the slave nodes) that happen to be running when you are stopping the cluster will continue to run. This is a deliberate design decision of Storm because it means that crashing/restarting Nimbus and Supervisor daemons will not affect any running topologies in Storm. The downside is that you have to put some extra effort into fully stopping all Storm-related processes in a cluster.

If you want to kill ALL processes follow this procedure on the slave nodes:

$ sudo supervisorctl stop storm-supervisor
$ sudo pkill -TERM -u storm -f 'backtype.storm.daemon.worker'



回答2:


From the page that you linked to:

kill

Syntax: storm kill topology-name [-w wait-time-secs]

Kills the topology with the name topology-name. Storm will first deactivate the topology's spouts for the duration of the topology's message timeout to allow all messages currently being processed to finish processing. Storm will then shutdown the workers and clean up their state. You can override the length of time Storm waits between deactivation and shutdown with the -w flag.

As you can see, this is designed to give you a "clean" shutdown. The kill command shuts down the workers.




回答3:


Well if you have started storm as ./storm nimbus & ./storm supervisor & ./storm ui then

after that you may forgot the process id's in that case you can use jps tool to find out pid's then kill them as

$JAVA_HOME/bin/jps

3201 ConsoleConsumer

7528 Jps

2966 Kafka

3680 nimbus

3681 supervisor

6749 Launcher

2669 QuorumPeerMain

killing nimbus first

$ sudo kill 3681

$ sudo kill 3680



来源:https://stackoverflow.com/questions/19926548/stopping-storm-the-right-way

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!