问答文章1 问答文章501 问答文章1001 问答文章1501 问答文章2001 问答文章2501 问答文章3001 问答文章3501 问答文章4001 问答文章4501 问答文章5001 问答文章5501 问答文章6001 问答文章6501 问答文章7001 问答文章7501 问答文章8001 问答文章8501 问答文章9001 问答文章9501

ubuntu mongodb 怎么重启

发布网友 发布时间:2022-04-08 00:55

我来回答

2个回答

懂视网 时间:2022-04-08 05:16

解决办法:网上说是删除 *.lock文件,再进行 --repair ,最后再打开mongodb就可以了(我没有删除 *.lock,也可以)

参考: http://dochub.mongodb.org/core/repair for recovery instructions.

D:mongodbin>mongod --dbpath d:mongodbdatadb

2015-07-03T07:59:56.140+0800 I CONTROL

2015-07-03T07:59:56.140+0800 W CONTROL  32-bit servers don‘t have journaling ena bled by default. Please use --journal if you want durability.

2015-07-03T07:59:56.140+0800 I CONTROL

2015-07-03T07:59:56.171+0800 W -        [initandlisten] Detected unclean shutdow n - d:mongodbdatadbmongod.lock is not empty.

2015-07-03T07:59:56.187+0800 I STORAGE  [initandlisten] **************

Unclean shutdown detected.

Please visit http://dochub.mongodb.org/core/repair for recovery instructions.

*************

2015-07-03T07:59:56.187+0800 I STORAGE  [initandlisten] exception in initAndList en: 12596 old lock file, terminating

2015-07-03T07:59:56.187+0800 I CONTROL  [initandlisten] dbexit:  rc: 100

D:mongodbin>mongod --dbpath d:mongodbdatadb --repair

2015-07-03T08:37:23.937+0800 I CONTROL

2015-07-03T08:37:23.937+0800 W CONTROL  32-bit servers don‘t have journaling ena bled by default. Please use --journal if you want durability.

2015-07-03T08:37:23.937+0800 I CONTROL

2015-07-03T08:37:23.953+0800 W -        [initandlisten] Detected unclean shutdow n - d:mongodbdatadbmongod.lock is not empty.

2015-07-03T08:37:23.984+0800 I CONTROL  [initandlisten] MongoDB starting : pid=3 356 port=27017 dbpath=d:mongodbdatadb 32-bit host=WWW-AB2946767CC

2015-07-03T08:37:23.984+0800 I CONTROL  [initandlisten]

2015-07-03T08:37:23.984+0800 I CONTROL  [initandlisten] ** NOTE: This is a 32 bi t MongoDB binary.

2015-07-03T08:37:23.984+0800 I CONTROL  [initandlisten] **       32 bit builds a re limited to less than 2GB of data (or less with --journal).

2015-07-03T08:37:23.984+0800 I CONTROL  [initandlisten] **       Note that journ aling defaults to off for 32 bit and is currently off.

2015-07-03T08:37:23.984+0800 I CONTROL  [initandlisten] **       See http://doch ub.mongodb.org/core/32bit

2015-07-03T08:37:23.984+0800 I CONTROL  [initandlisten]

2015-07-03T08:37:23.984+0800 I CONTROL  [initandlisten] ** NOTE: your operating system version does not support the method that MongoDB

2015-07-03T08:37:24.000+0800 I CONTROL  [initandlisten] **       uses to detect impending page faults.

2015-07-03T08:37:24.000+0800 I CONTROL  [initandlisten] **       This may result  in slower performance for certain use cases

2015-07-03T08:37:24.000+0800 I CONTROL  [initandlisten]

2015-07-03T08:37:24.000+0800 I CONTROL  [initandlisten] targetMinOS: Windows XP SP3

2015-07-03T08:37:24.000+0800 I CONTROL  [initandlisten] db version v3.0.4

2015-07-03T08:37:24.000+0800 I CONTROL  [initandlisten] git version: 0481c958dae b2969800511e7475dc66986fa9ed5

2015-07-03T08:37:24.000+0800 I CONTROL  [initandlisten] build info: windows sys. getwindowsversion(major=6, minor=1, build=7601, platform=2, service_pack=‘Servic e Pack 1‘) BOOST_LIB_VERSION=1_49

2015-07-03T08:37:24.000+0800 I CONTROL  [initandlisten] allocator: tcmalloc 2015-07-03T08:37:24.000+0800 I CONTROL  [initandlisten] options: { repair: true,  storage: { dbPath: "d:mongodbdatadb" } }

2015-07-03T08:37:24.250+0800 I STORAGE  [initandlisten] repairDatabase local

2015-07-03T08:37:24.484+0800 I INDEX    [initandlisten] allocating new ns file d :mongodbdatadb\_tmp_repairDatabase_0local.ns, filling with zeroes...

2015-07-03T08:37:24.812+0800 I STORAGE  [FileAllocator] allocating new datafile d:mongodbdatadb\_tmp_repairDatabase_0local.0, filling with zeroes...

2015-07-03T08:37:24.812+0800 I STORAGE  [FileAllocator] creating directory d:mo ngodbdatadb\_tmp_repairDatabase_0\_tmp

2015-07-03T08:37:24.812+0800 I STORAGE  [FileAllocator] done allocating datafile  d:mongodbdatadb\_tmp_repairDatabase_0local.0, size: 64MB,  took 0 secs 2015-07-03T08:37:24.828+0800 I INDEX    [initandlisten] build index on: local.st artup_log properties: { v: 1, key: { _id: 1 }, name: "_id_", ns: "local.startup_ log" }

2015-07-03T08:37:24.828+0800 I INDEX    [initandlisten]          building index using bulk method

2015-07-03T08:37:25.062+0800 I STORAGE  [initandlisten] repairDatabase myworkblo gs

2015-07-03T08:37:25.312+0800 I INDEX    [initandlisten] allocating new ns file d :mongodbdatadb\_tmp_repairDatabase_0myworkblogs.ns, filling with zeroes...

2015-07-03T08:37:25.578+0800 I STORAGE  [FileAllocator] allocating new datafile d:mongodbdatadb\_tmp_repairDatabase_0myworkblogs.0, filling with zeroes...

2015-07-03T08:37:25.578+0800 I STORAGE  [FileAllocator] creating directory d:mo ngodbdatadb\_tmp_repairDatabase_0\_tmp

2015-07-03T08:37:25.578+0800 I STORAGE  [FileAllocator] done allocating datafile  d:mongodbdatadb\_tmp_repairDatabase_0myworkblogs.0, size: 64MB,  took 0 sec s

2015-07-03T08:37:25.593+0800 I INDEX    [initandlisten] build index on: myworkbl ogs.app_updates properties: { v: 1, key: { _id: 1 }, name: "_id_", ns: "myworkbl ogs.app_updates" }

2015-07-03T08:37:25.593+0800 I INDEX    [initandlisten]          building index using bulk method

2015-07-03T08:37:25.593+0800 I INDEX    [initandlisten] build index on: myworkbl ogs.app_updates properties: { v: 1, key: { key: 1 }, name: "key_1", ns: "myworkb logs.app_updates", background: true, safe: null }

2015-07-03T08:37:25.593+0800 I INDEX    [initandlisten]          building index using bulk method

2015-07-03T08:37:25.609+0800 I INDEX    [initandlisten] build index on: myworkbl ogs.galleries properties: { v: 1, key: { _id: 1 }, name: "_id_", ns: "myworkblog s.galleries" }

2015-07-03T08:37:25.609+0800 I INDEX    [initandlisten]          building index using bulk method

2015-07-03T08:37:25.609+0800 I INDEX    [initandlisten] build index on: myworkbl ogs.galleries properties: { v: 1, unique: true, key: { key: 1 }, name: "key_1", ns: "myworkblogs.galleries", background: true, safe: null }

2015-07-03T08:37:25.609+0800 I INDEX    [initandlisten]          building index using bulk method

2015-07-03T08:37:25.625+0800 I INDEX    [initandlisten] build index on: myworkbl ogs.postcategories properties: { v: 1, key: { _id: 1 }, name: "_id_", ns: "mywor kblogs.postcategories" }

2015-07-03T08:37:25.625+0800 I INDEX    [initandlisten]          building index using bulk method

2015-07-03T08:37:25.625+0800 I INDEX    [initandlisten] build index on: myworkbl ogs.postcategories properties: { v: 1, unique: true, key: { key: 1 }, name: "key _1", ns: "myworkblogs.postcategories", background: true, safe: null }

2015-07-03T08:37:25.625+0800 I INDEX    [initandlisten]          building index using bulk method

2015-07-03T08:37:25.640+0800 I INDEX    [initandlisten] build index on: myworkbl ogs.posts properties: { v: 1, key: { _id: 1 }, name: "_id_", ns: "myworkblogs.po sts" }

2015-07-03T08:37:25.640+0800 I INDEX    [initandlisten]          building index using bulk method

2015-07-03T08:37:25.640+0800 I INDEX    [initandlisten] build index on: myworkbl ogs.posts properties: { v: 1, unique: true, key: { slug: 1 }, name: "slug_1", ns : "myworkblogs.posts", background: true, safe: null }

2015-07-03T08:37:25.640+0800 I INDEX    [initandlisten]          building index using bulk method

2015-07-03T08:37:25.640+0800 I INDEX    [initandlisten] build index on: myworkbl ogs.posts properties: { v: 1, key: { state: 1 }, name: "state_1", ns: "myworkblo gs.posts", background: true, safe: null }

2015-07-03T08:37:25.640+0800 I INDEX    [initandlisten]          building index using bulk method

2015-07-03T08:37:25.640+0800 I INDEX    [initandlisten] build index on: myworkbl ogs.posts properties: { v: 1, key: { author: 1 }, name: "author_1", ns: "myworkb logs.posts", background: true, safe: null }

2015-07-03T08:37:25.640+0800 I INDEX    [initandlisten]          building index using bulk method

2015-07-03T08:37:25.640+0800 I INDEX    [initandlisten] build index on: myworkbl ogs.posts properties: { v: 1, key: { publishedDate: 1 }, name: "publishedDate_1" , ns: "myworkblogs.posts", background: true, safe: null }

2015-07-03T08:37:25.640+0800 I INDEX    [initandlisten]          building index using bulk method

2015-07-03T08:37:25.656+0800 I INDEX    [initandlisten] build index on: myworkbl ogs.users properties: { v: 1, key: { _id: 1 }, name: "_id_", ns: "myworkblogs.us ers" }

2015-07-03T08:37:25.656+0800 I INDEX    [initandlisten]          building index using bulk method

2015-07-03T08:37:25.656+0800 I INDEX    [initandlisten] build index on: myworkbl ogs.users properties: { v: 1, key: { email: 1 }, name: "email_1", ns: "myworkblo gs.users", background: true, safe: null }

2015-07-03T08:37:25.656+0800 I INDEX    [initandlisten]          building index using bulk method

2015-07-03T08:37:25.656+0800 I INDEX    [initandlisten] build index on: myworkbl ogs.users properties: { v: 1, key: { isAdmin: 1 }, name: "isAdmin_1", ns: "mywor kblogs.users", background: true, safe: null }

2015-07-03T08:37:25.656+0800 I INDEX    [initandlisten]          building index using bulk method

2015-07-03T08:37:25.875+0800 I STORAGE  [initandlisten] finished checking dbs

2015-07-03T08:37:25.875+0800 I CONTROL  [initandlisten] now exiting

2015-07-03T08:37:25.875+0800 I NETWORK  [initandlisten] shutdown: going to close  listening sockets...

2015-07-03T08:37:25.875+0800 I NETWORK  [initandlisten] shutdown: going to flush  diaglog...

2015-07-03T08:37:25.875+0800 I NETWORK  [initandlisten] shutdown: going to close  sockets...

2015-07-03T08:37:25.875+0800 I STORAGE  [initandlisten] shutdown: waiting for fs  preallocator...

2015-07-03T08:37:25.890+0800 I STORAGE  [initandlisten] shutdown: closing all fi les...

2015-07-03T08:37:25.890+0800 I STORAGE  [initandlisten] closeAllFiles() finished

2015-07-03T08:37:25.890+0800 I STORAGE  [initandlisten] shutdown: removing fs lo ck...

2015-07-03T08:37:25.890+0800 I CONTROL  [initandlisten] dbexit:  rc: 0

D:mongodbin>mongod --dbpath d:mongodbdatadb

2015-07-03T08:37:31.500+0800 I CONTROL 2015-07-03T08:37:31.500+0800 W CONTROL  32-bit servers don‘t have journaling ena bled by default. Please use --journal if you want durability. 2015-07-03T08:37:31.500+0800 I CONTROL 2015-07-03T08:37:31.531+0800 I CONTROL  [initandlisten] MongoDB starting : pid=2 852 port=27017 dbpath=d:mongodbdatadb 32-bit host=WWW-AB2946767CC 2015-07-03T08:37:31.531+0800 I CONTROL  [initandlisten] 2015-07-03T08:37:31.531+0800 I CONTROL  [initandlisten] ** NOTE: This is a 32 bi t MongoDB binary. 2015-07-03T08:37:31.531+0800 I CONTROL  [initandlisten] **       32 bit builds a re limited to less than 2GB of data (or less with --journal). 2015-07-03T08:37:31.531+0800 I CONTROL  [initandlisten] **       Note that journ aling defaults to off for 32 bit and is currently off. 2015-07-03T08:37:31.531+0800 I CONTROL  [initandlisten] **       See http://doch ub.mongodb.org/core/32bit 2015-07-03T08:37:31.531+0800 I CONTROL  [initandlisten] 2015-07-03T08:37:31.531+0800 I CONTROL  [initandlisten] ** NOTE: your operating system version does not support the method that MongoDB 2015-07-03T08:37:31.531+0800 I CONTROL  [initandlisten] **       uses to detect impending page faults. 2015-07-03T08:37:31.531+0800 I CONTROL  [initandlisten] **       This may result  in slower performance for certain use cases 2015-07-03T08:37:31.531+0800 I CONTROL  [initandlisten] 2015-07-03T08:37:31.531+0800 I CONTROL  [initandlisten] targetMinOS: Windows XP SP3 2015-07-03T08:37:31.531+0800 I CONTROL  [initandlisten] db version v3.0.4 2015-07-03T08:37:31.531+0800 I CONTROL  [initandlisten] git version: 0481c958dae b2969800511e7475dc66986fa9ed5 2015-07-03T08:37:31.546+0800 I CONTROL  [initandlisten] build info: windows sys. getwindowsversion(major=6, minor=1, build=7601, platform=2, service_pack=‘Servic e Pack 1‘) BOOST_LIB_VERSION=1_49 2015-07-03T08:37:31.546+0800 I CONTROL  [initandlisten] allocator: tcmalloc 2015-07-03T08:37:31.546+0800 I CONTROL  [initandlisten] options: { storage: { db Path: "d:mongodbdatadb" } } 2015-07-03T08:37:31.578+0800 I NETWORK  [initandlisten] waiting for connections on port 27017

Mongodb异常关闭重启失败解决

标签:

热心网友 时间:2022-04-08 02:24

使用了这个命令关闭mongodb,使得重启的时候,重启不了!
需要把mongodb.lock 这个文件删除掉才能启动!
而且还会偶尔发生数据丢失的事情,需要repair(./mongod --repair)一下才行!
看了一下文档,关闭mongodb有两种:

1.使用客户端mondo

$ ./mongo
> db.shutdownServer()

2. 直接 kill -2 PID," or kill -15 PID
声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com
华硕笔记本电脑触摸板怎么开笔记本电脑触摸板怎么开启和关闭_百度知 ... 陕西职务侵占案立案准则 结婚后我的恋情维系了十年,怎么做到的? 玉米仁子饭产自哪里 中国期货交易所的交易品种有哪些? 历史要怎么读,有啥诀窍 高中历史诀窍 年终会活动策划方案 深度解析:第一财经回放,探索财经新风向 逆水寒手游庄园怎么邀请好友同住 11岁半的小孩偷东西被抓,会不会留下案底,*记下来名字地址电话会回访吗? 孩子在外地被警方带走没有消息,家人拨打了110行吗 孩子犯事被警方抓捕父亲做什么事被拘留? 蝈蝈是怎么叫的? 戴貔貅做恶梦 刚戴貔貅睡觉后做噩梦 11岁偷东西被抓到派出所写了记录,会入个人记录么,会有案底吗?会影响考大学吗? 蝈蝈用什么叫 带貔貅有什么讲究? 一场意外造成13岁的孩子被*带走带上手铐,该怎么疏导孩子心理 请问我小孩被派出所抓去送到了看守所,家属多久才能探监 脖子上戴的貔貅睡觉要取下来吗 为什么蝈蝈一到晚上叫的特别欢? 蝈蝈为什么要不停地叫? 宠物除跳蚤项圈有用吗 止吠项圈狗狗真的可以用吗? 宠物智能项圈可以给猫用吗? 宠物追踪器,只有项圈,无定位器,就无法定位追踪宠物位置吗? 现在市面上有一些宠物佩带的智能挂件,可以随时监测宠物健康的,哪个牌子的好用呀?多少钱? 有朋友买过伯爵复刻手表吗?求推荐!哪一家不错?求推荐! 犯罪人的孩子会被拘留么?案发时 孩子才5岁,过去快20年,忽然来个便衣*把孩子带走,说协助调查 孩子不听话时该用“警察把你抓走”这样的话恐吓孩子吗? 十二岁的孩子偷别人四十元钱被警察带走怎么办 浙江省和江苏省2010年的GDP分别是多少,“十一五”时期哪个省发展的更快? 警察办案,家长有权阻止他们带走未满18岁的小孩吗 这个插座用发泡剂可以固定吗 阿里旺旺打不开怎么回事? 手机网页版旺旺打不开,一点它页面就跳转到淘宝主页 手机淘宝旺旺没有wifi打不开怎么办? 聚氨酯发泡剂发泡过程的方向性问题及抗压强度 求2010全国发达省份排行! 阿里旺旺主界面打不开怎么办 淘宝旺旺主界面不显示解决方法 为什么在淘宝点卖家旺旺打不开? 淘宝旺旺打不开是怎么回事 我的淘宝旺旺怎么打不开了 我的淘宝、旺旺怎么都打不开? 为什么淘宝打不开 旺旺打不开 为什么在手机淘宝网上下载的阿里旺旺打不开 iphone淘宝客户端内置旺旺用不了,打不开 阿里旺旺为什么打不开?