supervisor 为啥状态监控显示不对?

2014-12-23 00:44:03 +08:00
 cevincheung




这是配置

2947 次点击
所在节点    Python
12 条回复
cevincheung
2014-12-23 00:51:19 +08:00

这样也不行
hzqim
2014-12-23 08:50:12 +08:00
/etc/init.d 下是否有nginx启动脚本?如果有,和supervisor是否冲突?把init.d下脚步的禁用看看。
cevincheung
2014-12-23 10:09:20 +08:00
@hzqim 木有,nginx操作太简单没用脚本。直接ln -s /usr/local/nginx/sbin/nginx /usr/bin/nginx。

nginx #启动
nginx -s reload 重载配置

- -#多简单- -#
geew
2015-01-09 14:34:10 +08:00
cevincheung
2015-01-09 14:36:12 +08:00
@geew 生产环境反而要取消daemon?
geew
2015-01-09 15:18:42 +08:00
@cevincheung 你要用supervisor来管理nginx的话 就要取消daemon 不然启不起来的 redis也是 文档里面有写的哦
KDr2
2015-01-09 15:22:50 +08:00
nginx.conf 里 daemon off;
supervisor 里 stopsignal = QUIT

supervisor负责把进程做成 daemon,自己 daemon 的话,supervisor 会认为它挂了。
supervisor有些不好用的地方,比如配置了 numprocs 的项目,不知道怎么一次重启这 numprocs 个进程……
cevincheung
2015-01-09 15:27:47 +08:00
@KDr2
但凡是自己有daemon机制的都要取消。是这意思呗?
那pgsql咋办
geew
2015-01-09 15:33:00 +08:00
@cevincheung 那就不用supervisor来管理就是了嘛 没必要全部的都用supervisor来管理 比如nginx 独立启动要更好些
KDr2
2015-01-09 15:35:13 +08:00
@cevincheung

我记得 pg_ctl start 就不会 daemon 的吧,或者配置文件里也能配置?
cevincheung
2015-01-09 15:35:45 +08:00
@KDr2
pg_ctl 调用 postgres 还是daemon
KDr2
2015-01-09 16:15:09 +08:00
@cevincheung 确实,可以这样:

pg_ctl -D ./data start
inotifywait -e delete ./data/postmaster.pid

不过 pgsql 异常退出的话, pid file 可能没被删除,所以再复杂点, 检测 logfile 的 close 之类的,然后就担心 logrotate...

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/155890

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX