为什么metastore服务会自动关闭

电脑休眠,SSH客户端断开连接后,运行的metastore服务,hive,hiveserver2服务也终止了。

解决方法:适用nohup命令。

nohup是进程不挂起运行(no hang up)的意思。


/bin/目录下有log.out文件,我们也把日志写入log.out。

[bg@BG01 bin]$ nohup hive --service metastore >log.out 2>&1 &
[1] 173162
[bg@BG01 bin]$ nohup hive --service hiveserver2 >log.out 2>&1 &

[2] 173385


服务都启动了。

看一下日志文件:


扫描二维码关注公众号,回复: 2112652 查看本文章

只有一行:nohup: ignoring input。

上面2个nohup命令都是>log.out。会使前面的日志被覆盖。于是kill掉进程,然后重新启动使用>>log.out。

nohup hive --service metastore >>log.out 2>&1 &

nohup hive --service hiveserver2 >>log.out 2>&1 &

继续cat log.out:


然后


可见服务是启动了。

只是nohup: ignoring input是什么意思呢?

继续kill掉2个RUNJar进程:

[bg@BG01 bin]$ kill -9 176978 176807

不再指定输出流到指定的文件log.out,而是用默认的:


nohup Command [Arg ...] [ &]

nohup运行由Command命令和Arg参数指定的命令行,忽略所有挂断信号。

ignoring input and appending output to ‘nohup.out’忽略输入输出,将信息记录到nohup.out



猜你喜欢

转载自blog.csdn.net/yblbbblwsle/article/details/80627420