Home > Database > Mysql Tutorial > mongodb进程号的查找

mongodb进程号的查找

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 16:11:15
Original
1770 people have browsed it

因监控需要,必须调用mongodb的PID, 方法1: 在交互文件里面加上,pidfilepath=/var/run/mongodb.pid,重启mongodb后, 注意,2.5.3以下的版本,找不到PID文件,这个是bug,在2.5.3以上的版本才修复; 方法2: 写脚本获取吧:脚本主要内容 PID=`ps aux|grep m

因监控需要,必须调用mongodb的PID,

方法1:

在交互文件里面加上,pidfilepath=/var/run/mongodb.pid,重启mongodb后,

注意,2.5.3以下的版本,找不到PID文件,这个是bug,在2.5.3以上的版本才修复;

方法2:写脚本获取吧:脚本主要内容

PID=`ps aux|grep mongodb |awk '{print $2}'|sed -n '1p'`

方法3:无意间去mongodb的data目录下,发现有个mongod.lock,里面记录就是pid嘛

随后做个链接,给监控调用就好了

#ln -s /data/mongodb/mongod.lock /var/run/mongodb.pid

cat /var/run/mongodb.pid

5231

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
mongodb start
From 1970-01-01 08:00:00
0
0
0
linux - ubuntu14 error installing mongodb
From 1970-01-01 08:00:00
0
0
0
Use of symfony2 mongodb
From 1970-01-01 08:00:00
0
0
0
mongodb _id rename
From 1970-01-01 08:00:00
0
0
0
Parameter understanding of mongodb
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template