我试图找出为什么我的Monit( https://mmonit.com/monit/ )不想要监视我的Solr服务。 我已经为其余的服务工作:
但由于某些原因,Solr不想正确监控。
我在这里跟着例子:
https://www.webfoobar.com/node/61
对于我的服务器我调整了一点,所以服务是正确的,还有一些path:
## Solr monitoring. ## Test the solr service. check process solr with pidfile /var/solr/solr-8983.pid group solr start program = "/etc/init.d/solr start" stop program = "/etc/init.d/solr stop" restart program = "/etc/init.d/solr restart" if failed port 8983 then restart if 3 restarts within 5 cycles then timeout depends on solr_bin depends on solr_init ## Test the process binary. check file solr_bin with path /opt/solr/bin/solr group root if failed checksum then unmonitor if failed permission 755 then unmonitor if failed uid root then unmonitor if failed gid root then unmonitor ## Test the init scripts. check file solr_init with path /etc/init.d/solr group root if failed checksum then unmonitor if failed permission 744 then unmonitor if failed uid root then unmonitor if failed gid root then unmonitor
检查语法看起来一切正常:
monit -t /etc/monit/monitrc:295: Include failed -- Success '/etc/monit/conf.d/*' Control file syntax OK
任何其他build议,我可以尝试什么?
更新:我真的不明白为什么这是行不通的。 所有的权限和文件似乎都存在,并设置正确:
root@admin:/etc/init.d# ls -l /var/solr/solr-8983.pid -rw-rw-r-- 1 solr solr 6 Jul 28 05:41 /var/solr/solr-8983.pid root@admin:/etc/init.d# ls -l /etc/init.d | grep solr -rwxr--r-- 1 root root 2711 Jul 25 13:25 solr root@admin:/etc/init.d# ls -l /opt/solr/bin/ | grep solr -rwxr-xr-x 1 root root 12694 May 29 22:36 install_solr_service.sh -rwxr-xr-x 1 root root 1255 Mar 9 20:00 oom_solr.sh -rwxr-xr-x 1 root root 72389 May 30 00:25 solr -rwxr-xr-x 1 root root 66010 May 30 00:25 solr.cmd -rwxr-xr-x 1 root root 6204 May 30 00:25 solr.in.cmd.orig -rwxr-xr-x 1 root root 6950 May 30 00:25 solr.in.sh.orig
更新2:当重新启动Monit ,我得到这个在monit.log :
[UTC Jul 28 10:22:45] info : Shutting down Monit HTTP server [UTC Jul 28 10:22:45] info : Monit HTTP server stopped [UTC Jul 28 10:22:45] info : Monit daemon with pid [26662] stopped [UTC Jul 28 10:22:45] info : 'admin.steampunkjunkies.com' Monit 5.16 stopped [UTC Jul 28 10:22:45] info : Starting Monit 5.16 daemon with http interface at [213.219.38.44]:2812 [UTC Jul 28 10:22:45] info : Starting Monit HTTP server at [213.219.38.44]:2812 [UTC Jul 28 10:22:45] info : Monit HTTP server started [UTC Jul 28 10:22:45] info : 'admin.steampunkjunkies.com' Monit 5.16 started
你的/ opt / solr / bin / solr文件存在问题,导致它不被监视 。 有了依赖关系, stream程也不受监控 。 检查solr_bin的权限,所有权等
在某些时候, solr_bin有一个问题,导致它不受监视,并且由于依赖性, solr进程也没有被监视 。 使用monit reload或service monit restart更新校验和后,必须通过UI或Monit命令请求手动监视 solr_bin和进程 。 当某些东西没有被监控时 ,它不会回到自动监控状态。 你必须明确要求它。