memcached nemôže nájsť súbor pid? CentOS 7 špecifikuje memcache pid

CentOS 7 je potrebné nakonfigurovať pre memcaching Monitorovanie monitorovaniaKeď programujem, narazím na problém, že memcached nemôže nájsť súbor pid...

memcached nemôže nájsť súbor pid? CentOS 7 špecifikuje memcache pid

Všetky konfigurácie, ktoré môžeme nájsť v googli, obsahujú tento riadok:

check process memcached with pidfile /var/run/memcached/memcached.pid

ale,/var/run Nie v memcached.pid súbor, no /var/run/memcached priečinok.

skontrolované /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
  • Preto neexistuje žiadna cesta k súboru .pid.
  • Ak kontrolujete memcached bez súboru .pid?
  • Môže byť tento súbor .pid aj na inom mieste?

Ako CentOS 7 určuje adresu umiestnenia súboru pid memcache?

Riešením je nastavenie adresy pid súboru memcache, ktorú ste zadali v konfigurácii monitorovania Monit▼

check process memcached with pidfile /var/run/memcached/memcached.pid

Nahraďte adresu súboru nasledujúceho pid v memcached▼

check process memcached with match memcached

Naša konfigurácia pre 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

Spôsob inštalácie monitorovania Centos 7 Monit 5.14 nájdete v nasledujúcom návode▼

发表 评论

Vaša emailová adresa nebude zverejnená. 必填 项 已 用 * Štítok

Prejdite na začiatok