我试图弄清楚为什么我的 Monit ( https://mmonit.com/monit/ ) 似乎不想监视我的 Solr 服务。我已经为其余的服务工作了:
但由于某种原因,Solr 不想正确监控。
我按照这里的例子:
https://www.webfoobar.com/node/61
对于我的服务器,我对其进行了一些调整,因此服务是正确的,还有一些路径:
## 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
关于我可以尝试什么的任何其他建议?
更新:我真的不明白为什么这不起作用。所有权限和文件似乎都存在,并且设置正确:
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文件存在问题,导致它成为unmonitor。有了依赖关系,该过程也不受监控。检查solr_bin的权限、所有权等
在某些时候,solr_bin存在问题,导致它不受监控,并且由于依赖关系,solr 进程也不受监控。使用or更新校验和后,您必须手动监控solr_bin并通过 UI 或从 Monit 命令请求进行处理。当某些东西不受监控时,它不会自动回到监控状态。您必须明确提出要求。
monit reload
service monit restart