Configuring Storm for Supervision
If you are deploying a production cluster with Storm, you should configure the Storm components to operate under supervision.
Follow these steps to configure Storm for supervision:
Stop all Storm components.
Using Ambari Web, browse to
Services > Storm > Service Actions
.Choose Stop, and wait until the Storm service completes.
Stop Ambari Server:
ambari-server stop
Change the Supervisor and Nimbus command scripts in the Stack definition.
On Ambari Server host, run:
sed -ir "s/scripts\/supervisor.py/scripts\/supervisor_prod.py/g" /var/lib/ambari-server/resources/common-services/STORM/0.9.1.2.1/metainfo.xml sed -ir "s/scripts\/nimbus.py/scripts\/nimbus_prod.py/g" /var/lib/ambari-server/resources/common-services/STORM/0.9.1.2.1/metainfo.xml
Install
supervisord
on all Nimbus and Supervisor hosts.Install EPEL repository:
yum install epel-release -y
Install supervisor package for
supervisord
:yum install supervisor -y
Enable
supervisord
on autostart:chkconfig supervisord on
Change
supervisord
configuration file permissions:chmod 600 /etc/supervisord.conf
Configure
supervisord
to supervise Nimbus Server and Supervisors by appending the following to/etc/supervisord.conf
on all Supervisor host and Nimbus hosts:[program:storm-nimbus] command=env PATH=$PATH:/bin:/usr/bin/:/usr/jdk64/jdk1.7.0_67/bin/ JAVA_HOME=/usr/jdk64/jdk1.7.0_67 /usr/hdp/current/storm-nimbus/bin/storm nimbus user=storm autostart=true autorestart=true startsecs=10 startretries=999 log_stdout=true log_stderr=true logfile=/var/log/storm/nimbus.out logfile_maxbytes=20MB logfile_backups=10 [program:storm-supervisor] command=env PATH=$PATH:/bin:/usr/bin/:/usr/jdk64/jdk1.7.0_67/bin/ JAVA_HOME=/usr/jdk64/jdk1.7.0_67 /usr/hdp/current/storm-supervisor/bin/storm supervisor user=storm autostart=true autorestart=true startsecs=10 startretries=999 log_stdout=true log_stderr=true logfile=/var/log/storm/supervisor.out logfile_maxbytes=20MB logfile_backups=10
Note Change
/usr/jdk64/jdk1.7.0_67
to the location of the JDK being used by Ambari in your environment.Start
supervisord
on all Supervisor and Nimbus hosts:service supervisord start
Start Ambari Server:
ambari-server start
Start all other Storm components:
Using Ambari Web, browse to
Services > Storm > Service Actions
.Choose
Start
.