gpt4 book ai didi

ubuntu、zookeeper 和 pid ......它在哪里 - 它需要监控吗?

转载 作者:行者123 更新时间:2023-12-04 18:32:34 25 4
gpt4 key购买 nike

我正在使用 zookeeper 并安装在 ubuntu 12.04

apt-get install zookeeper

我需要 pid 进行监控。它不在/var/run 中,但 zookeeper 正在运行。我查看了/etc/init.d/zookeeper 并没有提到 pid。
service zookeeper status
zookeeper start/running, process 7242

lsof -i :2181
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
java 7242 zookeeper 28u IPv6 106186 0t0 TCP *:2181 (LISTEN)

最佳答案

如果你阅读 Zookeeper 的/etc/init.d/zookeeper 脚本中的注释,你会看到

# Symlink target for initscripts that have been converted to Upstart.

这意味着它是委派给 Upstart 的标准脚本。换句话说,它只是说查看/etc/init/zookeeper.conf Upstart 作业,而不是查看此文件。

这个 Upstart 工作使用 start-stop-daemon来控制 Zookeeper,但它不会传递 --pidfile 或 --make-pidfile 标志,Zookeeper 也不会自行创建 pidfile。最简单的方法是覆盖 Zookeeper upstart 作业(此 zookeeper.conf 文件)以将这两个标志添加到 start-stop-daemon .

关于ubuntu、zookeeper 和 pid ......它在哪里 - 它需要监控吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17707460/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com