После короткого периода работы monit я не могу перезапустить или остановить apache, он говорит, что есть конфликт, что-то еще использует порт 80. Apache по-прежнему нормально обслуживает веб-страницы, и когда я netstat -anp | grep 80 Я все еще вижу, что apache слушает только: 80.
когда я запускаю мониторинг, я получаю сообщение об ошибке «не отслеживается» для apache. Я не уверен, имеет ли это отношение к проблеме, в настоящее время я пытаюсь решить эту проблему.
Подробная информация о Monit ниже:
set httpd port 2812 and
#use address localhost # only accept connection from localhost
allow 0.0.0.0/0.0.0.0 # allow localhost to connect to the server and
allow *******:****** # require user '' with password ....
allow @monit # allow users of group 'monit' to connect (rw)
allow @users readonly # allow users of group 'users' to connect readonly
##monitor apache
check process apache with pidfile /var/run/httpd/httpd.pid
group apache
start program = "/etc/init.d/httpd start"
stop program = "/etc/init.d/httpd stop"
if failed host 127.0.0.1 port 80
protocol http then restart
if 5 restarts within 5 cycles then timeout
Вывод monit -vv
monit: Debug: Adding net allow '0.0.0.0/0.0.0.0'.
monit: Debug: Adding credentials for user '******'.
monit: Adding PAM group 'monit'.
monit: Adding PAM group 'users'.
Runtime constants:
Control file = /etc/monit.conf
Log file = /var/log/monit
Pid file = /var/run/monit.pid
Debug = True
Log = True
Use syslog = False
Is Daemon = True
Use process engine = True
Poll time = 60 seconds with start delay 0 seconds
Expect buffer = 256 bytes
Mail server(s) = smtp.sendgrid.net:587(ssl) with timeout 30 seconds
Mail from = ******
Mail subject = monit alert -- $EVENT $SERVICE
Mail message = $EVENT Service $SERV..(truncated)
Start monit httpd = True
httpd bind address = Any/All
httpd portnumber = 2812
httpd signature = True
Use ssl encryption = False
httpd auth. style = Basic Authentication and Host/Net allow list
Alert mail to = *******
Alert on = All events
The service list contains the following entries:
Process Name = apache
Group = apache
Pid file = /var/run/httpd/httpd.pid
Monitoring mode = active
Start program = '/etc/init.d/httpd start' timeout 30 second(s)
Stop program = '/etc/init.d/httpd stop' timeout 30 second(s)
Existence = if does not exist 1 times within 1 cycle(s) then restart else if succeeded 1 times within 1 cycle(s) then alert
Pid = if changed 1 times within 1 cycle(s) then alert
Ppid = if changed 1 times within 1 cycle(s) then alert
Port = if failed 127.0.0.1:80 [HTTP via TCP] with timeout 5 seconds 1 times within 1 cycle(s) then restart else if succeeded 1 times within 1 cycle(s) then alert
Timeout = If restarted 5 times within 5 cycle(s) then unmonitor
Process Name = mysqld
Group = mysql
Pid file = /var/run/mysqld/mysqld.pid
Monitoring mode = active
Start program = '/etc/init.d/mysqld start' timeout 30 second(s)
Stop program = '/etc/init.d/mysqld stop' timeout 30 second(s)
Existence = if does not exist 1 times within 1 cycle(s) then restart else if succeeded 1 times within 1 cycle(s) then alert
Pid = if changed 1 times within 1 cycle(s) then alert
Ppid = if changed 1 times within 1 cycle(s) then alert
Port = if failed 127.0.0.1:3306 [DEFAULT via TCP] with timeout 5 seconds 1 times within 1 cycle(s) then restart else if succeeded 1 times within 1 cycle(s) then alert
Timeout = If restarted 5 times within 5 cycle(s) then unmonitor
System Name = system_ip-10-74-144-130.eu-west-1.compute.internal
Monitoring mode = active
കണക്റ്റുചെയ്യാൻ കഴിയാത്തതിലെ പ്രശ്നം ഒരുപക്ഷേ പുനരാരംഭിക്കൽ പ്രക്രിയ httpd ശരിയായി ഇല്ലാതാക്കാത്തതിനാലാണ്, അതിനാൽ ഇത് ഒരിക്കലും അടച്ചുപൂട്ടില്ല, അതിനാലാണ് പോർട്ട് 80 ഉപയോഗത്തിലുള്ളതിന്റെ പിശക് നിങ്ങൾക്ക് ലഭിക്കുന്നത് . Httpd ആരംഭിക്കുമ്പോഴോ പുനരാരംഭിക്കുമ്പോഴോ പിഡ് മാറ്റുന്നതിനെക്കുറിച്ച് എന്തെങ്കിലും ഉണ്ടാവാമെന്നും ഞാൻ സംശയിക്കുന്നു. എന്തുകൊണ്ടാണ് ഇത് പരാജയപ്പെടുന്നത് എന്നതിനെക്കുറിച്ച് ലോഗുകൾ കൂടുതൽ വിവരങ്ങൾ നൽകണം.
എന്നിരുന്നാലും, httpd സാധാരണയായി ഒരു ഡെമൺ പോലെ ദൃ solid മാണ്, മാത്രമല്ല ഇത് പുനരാരംഭിക്കാൻ ഞാൻ മോണിറ്റിനെ നിർബന്ധിക്കുകയുമില്ല, നിങ്ങൾക്ക് ഗുരുതരമായ അവസ്ഥയില്ലെങ്കിൽ ജാഗ്രത പാലിക്കുക.