On CentOS 7 needs to be configured for memcached Monit monitoringWhen I program, I encounter the problem that memcached cannot find the pid file...
All the configs we can find in googling contain this line:
check process memcached with pidfile /var/run/memcached/memcached.pid
but,/var/run
Not in memcached.pid
file, nor /var/run/memcached
folder.
checked /usr/lib/systemd/system/memcached.service
[Service] Type=simple EnvironmentFile=-/etc/sysconfig/memcached ExecStart=/usr/bin/memcached -u $USER -p $PORT -m $CACHESIZE -c $MAXCONN $OPTIONS
- Therefore, there is no path to the .pid file.
- If checking memcached without a .pid file?
- Also, can this .pid file be in another location?
How does CentOS 7 specify the location address of the memcache pid file?
The solution is to specify the memcache pid file address you specified in the Monit monitoring configuration▼
check process memcached with pidfile /var/run/memcached/memcached.pid
Replace with the file address of the following memcached pid▼
check process memcached with match memcached
Our configuration for memcached:
check process memcached with match memcached start program = "/usr/bin/systemctl start memcached" stop program = "/usr/bin/systemctl stop memcached" if failed host 127.0.0.1 port 11211 protocol MEMCACHE then restart if cpu > 70% for 2 cycles then alert if cpu > 98% for 5 cycles then restart if 2 restarts within 3 cycles then timeout
For the installation method of Centos 7 Monit monitoring 5.14, please refer to the following tutorial▼
Hope Chen Weiliang Blog ( https://www.chenweiliang.com/ ) shared "memcached can't find the pid file? CentOS 7 Specify memcache pid" to help you.
Welcome to share the link of this article:https://www.chenweiliang.com/cwl-26685.html
Welcome to the Telegram channel of Chen Weiliang's blog to get the latest updates!
📚 This guide contains huge value, 🌟This is a rare opportunity, don’t miss it! ⏰⌛💨
Share and like if you like!
Your sharing and likes are our continuous motivation!