zenbeni zenbeni - 4 months ago 14
Java Question

Stopping Storm: the right way

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

Answer

command to kill the topology ( as you rightly mentioned )

    storm kill topology-name

Now to shutdown the cluster you need to run the following command to each node

    sudo service supervisord stop

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'