解决storm集群上的nimbus,supervisor,ui结点自动停止的问题

一:解决方案
“Launches the nimbus daemon. This command should be run under supervision with a tool like daemontools or monit. See Setting up a Storm cluster for more information.”官网上推荐我们把nimbus和supervisor运行在daemontools or monit下面。进程被kill掉,自动就会重启。

二:daemontools安装

mkdir -p /package

cd /package/

wget http://cr.yp.to/daemontools/daemontools-0.76.tar.gz

等待下载安装包,然后解压编译。

gunzip daemontools-0.76.tar.gz

tar -xpf daemontools-0.76.tar

cd admin/daemontools-0.76/

./package/install

直接编译报错了,错误信息:


./compile wait_pid.c
./makelib unix.a alloc.o alloc_re.o buffer.o buffer_0.o buffer_1.o \
	buffer_2.o buffer_get.o buffer_put.o buffer_read.o buffer_write.o \
	coe.o env.o error.o error_str.o fd_copy.o fd_move.o fifo.o lock_ex.o \
	lock_exnb.o ndelay_off.o ndelay_on.o open_append.o open_read.o \
	open_trunc.o open_write.o openreadclose.o pathexec_env.o \
	pathexec_run.o prot.o readclose.o seek_set.o sgetopt.o sig.o \
	sig_block.o sig_catch.o sig_pause.o stralloc_cat.o stralloc_catb.o \
	stralloc_cats.o stralloc_eady.o stralloc_opyb.o stralloc_opys.o \
	stralloc_pend.o strerr_die.o strerr_sys.o subgetopt.o wait_nohang.o \
	wait_pid.o
./load envdir unix.a byte.a 
/usr/bin/ld: errno: TLS definition in /lib64/libc.so.6 section .tbss mismatches non-TLS reference in envdir.o
/lib64/libc.so.6: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [envdir] Error 1

 然后修改src目录下的error.h库文件。


vim src/error.h

找到“extern int errno;” 替换成“#include <errno.h>”,然后再编译。

./package/install

到此,提示下面信息表示成功安装。

Copying commands into ./command...
Creating symlink daemontools -> daemontools-0.76...
Making command links in /command...
Making compatibility links in /usr/local/bin...
Creating /service...
Adding svscanboot to inittab...
init should start svscan now.
 
   
 
   

三:storm ui、nimbus、supervisor配置

首先进入service目录。

cd /service/


storm ui的配置:

mkdir ui

cd ui/

vim run

run脚本如下:

#!/bin/bash
exec 2>&1
exec /opt/app/apache-storm-0.9.5/bin/storm ui

chmod 755 run

nimbus的配置:

cd /service/

mkdir nimbus

cd nimbus/

vim run

run脚本如下:

#!/bin/bash
exec 2>&1
exec /opt/app/apache-storm-0.9.5/bin/storm nimbus

chmod 755 run


supervisor的配置:

cd /service/

mkdir supervisor

cd supervisor/

vim run

run脚本如下:

#!/bin/bash
exec 2>&1
exec /opt/app/apache-storm-0.9.5/bin/storm supervisor

chmod 755 run

四:启动
 
   

nohup supervise /service/ui &

nohup supervise /service/nimbus &

nohup supervise /service/supervisor & 五:补充说明 如果不想让某个服务自动重启,用命令ps -ef|grep supervise查看,把相应的进程给kill掉服务就不会自动重启了。

 
   

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/28624388/viewspace-2062528/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/28624388/viewspace-2062528/

你可能感兴趣的:(解决storm集群上的nimbus,supervisor,ui结点自动停止的问题)