使用 Monit 监控 Ubuntu 16.0.4 上的 solr 服务

使用 Monit 监控 Ubuntu 16.0.4 上的 solr 服务

我正在尝试弄清楚为什么我的 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 时,我得到了这个监控日志

[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

答案1

您的/opt/solr/bin/solr文件导致它取消监控. 有了依赖,过程未受监控也。检查权限、所有权等solr_bin

在某个时候,solr_bin导致它成为取消监控并且由于依赖性,solr 进程曾是未受监控也。之后校验和已更新为monit reloadservice monit restart,您必须手动监视器solr_bin过程通过 UI 或 Monit 命令进行请求。当发生未受监控,它不会再回到监视器自动状态。您必须明确请求它。

相关内容