0
memcached找不到pid文件?CentOS 7指定memcache pid
source link: https://www.chenweiliang.com/cwl-26685.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
memcached找不到pid文件?CentOS 7指定memcache pid
2022年2月15日
在 CentOS 7 上需要为 memcached 配置 Monit监控程序时,遇到memcached找不到pid文件的问题……
我们可以在谷歌搜索中,找到的所有配置都包含这一行:
check process memcached with pidfile /var/run/memcached/memcached.pid
但是,/var/run
中没有 memcached.pid
文件,也没有 /var/run/memcached
文件夹。
检查了 /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
- 因此,没有 .pid 文件的路径。
- 如果在没有 .pid 文件的情况下检查 memcached 吗?
- 还有,这个 .pid 文件可以在另一个位置吗?
CentOS 7如何指定memcache pid文件位置地址?
解决方法,将你在Monit监控配置中,指定的memcache pid文件地址 ▼
check process memcached with pidfile /var/run/memcached/memcached.pid
替换为以下memcached pid的文件地址 ▼
check process memcached with match memcached
我们对 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
Centos 7 Monit监控 5.14的安装方法,请参考以下教程 ▼
AddThis Recommended
www.chenweiliang.com
www.chenweiliang.com
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK