Sengoli sa Lingoloa
Qalo ea Redis ha e fumane sebaka sa faele ea pid? Faele ea pid ea Redis e hokae?
LinuxU ka sheba aterese ea sebaka sa faele ea pid ea Redis joang?
Linux fumana taelo ea ts'ebetso ea redis▼
ps -ef | grep redis
Khutlela ho hlahisa liphetho tse latelang tsa potso▼
redis 28221 1 1 Feb08 ? 00:13:19 /usr/bin/redis-server 127.0.0.1:6379
- Ha ke sheba ts'ebetso ea redis, ha ke fumane sebaka sa faele ea pid. Ke lokela ho etsa eng?
redis.pid ha e fumanehe?
Sengoloa sa ho qala sa Redis se tlameha ho theha faele ea pid ha e qala, empa re netefalitse litlhophiso tsohle tseo re ka li fumanang, mme ha ho faele ea pid e entsoeng.
Ho thoe'ng haeba daemon ea Redis e sa thehe faele ea PID?
Redis.pid e hlahisoa joang?
bakeng sa seva sa linux CentOS 7:
Lebitso la seva sa Redis keredis.service
, SSH Kenya taelo e latelang ho qala ho hlophisa▼
systemctl edit redis.service
eketsa sena ▼
[Service] ExecStartPost=/bin/sh -c "echo $MAINPID > /var/run/redis/redis.pid" PIDFile=/var/run/redis/redis.pid
Qala tšebeletso hape:
systemctl daemon-reload systemctl restart redis monit reload
Ebe, aterese ea faele ea sebaka sena e tla sebelisoa ho hlahisa faele ea pid ea Redis:/etc/systemd/system/redis.service.d/override.conf
pid faele aterese▼
cat /var/run/redis/redis.pid
=> 27585
Ho na le eng faeleng ea redis.pid?
- Faele ea redis.pid e boloka ID ea ts'ebetso.
- sebedisa
cat
Taelo ea ho sheba, u ka bona hore ho na le mola o le mong feela, o rekotang ID ea ts'ebetso.
Karolo ea faele ea redis.pid ke efe?
- Karolo ea faele ea redis.pid ke ho thibela likopi tse ngata tsa ts'ebetso ho qala.
- Lenaneo la Monit le beha leihlo tšebetso ea redis mme le hloka ho sebelisa aterese ea sebaka sa faele ea redis.pid.
Molao-motheo oa faele ea pid ke ofe?
- Kamora hore ts'ebetso e sebetse, senotlolo sa faele se eketsoa faeleng ea .pid.
- Ke ts'ebetso feela e fumanang senotlolo e nang le tumello ea ho ngola (F_WRLCK), mme e ngola pid ea eona faeleng.
- Mekhoa e meng e lekang ho fumana senotlolo e tla tsoa ka bo eona.
Monit monitoringKenya aterese ea sebaka sa faele ea Redis pid
Lifaele tsa tlhophiso bakeng sa mananeo a ho beha leihlo ho Monitmonit.conf
Ho eona, eketsa aterese ea sebaka sa faele ea pid ea Redis ▼
check process redis with pidfile "/var/run/redis/redis.pid" start program "/usr/bin/systemctl start" stop program "/usr/bin/systemctl stop" if failed host 127.0.0.1 port 6379 then restart if 5 restarts within 5 cycles then timeout group redis
Mokhoa oa ho theha faele ea monit.conf?
Monit monitoring ke mohloli oa mahala le o bulehileng软件, tobetsa sehokelo se ka tlase ho bala thupelo ea ho kenya CWP7 Monit monitoring software ▼
Hope Chen Weiliang Blog ( https://www.chenweiliang.com/ ) o arolelane "Redis ha e fumane pid? Mokhoa oa ho hlophisa aterese ea sebaka sa faele ea pid kamora hore Redis e qale", e tla u thusa.
Rea u amohela ho arolelana sehokelo sa sengoloa sena:https://www.chenweiliang.com/cwl-26494.html
Rea u amohela ho mocha oa Telegraph oa blog ea Chen Weiliang ho fumana lintlha tsa morao-rao!
📚 Tataiso ena e na le boleng bo boholo, 🌟Ona ke monyetla o sa tloaelehang, se ke oa o fetoa! ⏰⌛💨
Share le rata haeba u rata!
Ho arolelana le lintho tseo u li ratang ke khothatso ea rona e tsoelang pele!