0

I'am using Apache Solr 3.6.2 integrated with Drupal 7.*. Sometimes Apache solr service goes down, and I am completely clueless that Solr is down. I don't have any other choice than manually login to the Linux server and start solr.

Is there any PHP library or piece of code that I can write so that whenever Solr service is down, it will notify me by triggering email (using php) or it will automatically restart apache solr. I am looking for some PHP PECL.

Is there a better way than PECL? Let me know if it is possible? If possible, How can I implement this in PHP?

Nomade
  • 1,760
  • 2
  • 18
  • 33
Mangesh Sathe
  • 1,987
  • 4
  • 21
  • 40

1 Answers1

0

There are many ways to monitor a service under Linux.

Look at Nagios, Icinga, netdata or any of the commercial options available (such as Pagerduty).

If you have installed Solr as a proper service on your system (i.e. as a SystemV/Upstart/systemd service), that service daemon can also restart the service if it disappears for you. How you do this depends on your configuration.

If you're handling it manually, you can also write a small bash script that restarts the process and waits until it disappears, before restarting it again.

MatsLindh
  • 49,529
  • 4
  • 53
  • 84