mongodb 流星:意外的 mongo 退出代码 100

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15610385/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 13:07:38  来源:igfitidea点击:

Meteor: unexpected mongo exit code 100

mongodbpermissionscentosmeteorsamba

提问by Aaron Cunnington

I have just installed Meteor version 0.5.9 (45fef52095) to my CentOS release 6.3 (Final) server (Linux version 2.6.32-279.19.1.el6.i686 ([email protected]) (gcc version 4.4.6 20120305 (Red Hat 4.4.6-4) (GCC) ) #1 SMP Wed Dec 19 04:30:58 UTC 2012)

我刚刚将 Meteor 版本 0.5.9 (45fef52095) 安装到我的 CentOS 版本 6.3(最终)服务器(Linux 版本 2.6.32-279.19.1.el6.i686 ([email protected]) (gcc版本 4.4.6 20120305 (Red Hat 4.4.6-4) (GCC) ) #1 SMP Wed Dec 19 04:30:58 UTC 2012)

I have a samba share to a Windows SBS server mounted as /mnt/apshared under the apache user. I have created a directory inside this called 'webmeteor'. I have created an app called 'myapp' inside the 'webmeteor' directory, so my directory is like so: /mnt/apshared/webmeteor/myapp.

我有一个 samba 共享到 Windows SBS 服务器,在 apache 用户下安装为 /mnt/apshared。我在其中创建了一个名为“webmeteor”的目录。我在“webmeteor”目录中创建了一个名为“myapp”的应用程序,所以我的目录是这样的:/mnt/apshared/webmeteor/myapp。

I am logged in as root. When I try to run the app using the meteorcommand, I am given the following error messages:

我以 root 身份登录。当我尝试使用该meteor命令运行应用程序时,收到以下错误消息:

Unexpected mongo exit code 100. Restarting.
Unexpected mongo exit code 100. Restarting.
Unexpected mongo exit code 100. Restarting.
Can't start mongod

MongoDB had an unspecified uncaught exception.
Check to make sure that MongoDB is able to write to its database directory.

My first point of call was this StackOverflow question: Creating a new meteor.js file and get error 100, MongoDB not able to write-- however, following these suggestions (sudo'ing the meteor command, and checking for disk space of which I have 70GB free) has not worked. I am quite certain that these issues are permission related.

我的第一个调用点是这个 StackOverflow 问题:创建一个新的meteor.js 文件并得到错误 100,MongoDB 无法写入——但是,遵循这些建议(sudo'ing themete 命令,并检查我的磁盘空间有 70GB 可用空间)没有用。我很确定这些问题与许可有关。

I have tried to chownrecursively to root:root (as I am logged in as root), and chmodto 777 recursively also, but to no avail.

我试图chown递归到 root:root (因为我以 root 身份登录),并chmod递归到 777,但无济于事。

I am asking you, what should I try next, to allow my Meteor app to start?

我问你,接下来我应该尝试什么,让我的 Meteor 应用程序启动?

Thanks in advance.

提前致谢。

采纳答案by mmmeff

It looks like a temporary solution can be found by running meteor out of a directory that isn't in the mount. Mongodb doesn't seem to take too kindly to shares, so you'll need set up rsync to periodically copy the files from your share to the directory where meteor is running.

看起来可以通过从不在挂载中的目录中运行meteor 来找到临时解决方案。Mongodb 似乎对共享不太友好,因此您需要设置 rsync 以定期将文件从共享中复制到运行meteor 的目录中。

Source: Problems to run examples in Meteor

来源:在 Meteor 中运行示例的问题

回答by Prashant

Using meteor reseterases all the data from your database. If you're worried about this then navigate to your project folder.

使用meteor reset会擦除数据库中的所有数据。如果您对此感到担心,请导航到您的项目文件夹。

cd /path/to/my/project

cd /path/to/my/project

Here you need to erase the mongodb.lockfile.

在这里你需要删除mongodb.lock文件。

rm .meteor/local/db/mongodb.lock

rm .meteor/local/db/mongodb.lock

Now you can run Meteor using the command,

现在您可以使用以下命令运行 Meteor,

meteor

meteor

回答by gabrielstuff

Removing this file and folder worked for me:

删除此文件和文件夹对我有用:

rm -rf .meteor/local/db/mongod.lock .meteor/local/db/journal/

回答by Xiv

Mine was fixed in the end by running export LC_ALL=C. Found the error through the debugging steps suggested in this post: https://stackoverflow.com/a/15752736/1820510

最后通过运行 export 修复了我的问题LC_ALL=C。通过本文中建议的调试步骤发现错误:https: //stackoverflow.com/a/15752736/1820510

回答by Jonatan Littke

As suggested elsewhere, running meteor resetfixed the problem for me on OS X.

正如其他地方所建议的,meteor reset在 OS X 上运行为我解决了这个问题。

WARNING: meteor reseterases everything in your local database.

警告:meteor reset删除本地数据库中的所有内容。

回答by Navan

This is what helped me.

这就是帮助我的原因。

  1. I deleted .meteor/local/db/mongod.lock
  2. I killed mongod process. You can find this using "ps -ef | grep mongo"
  1. 我删除了 .meteor/local/db/mongod.lock
  2. 我杀了 mongod 进程。您可以使用“ps -ef | grep mongo”找到它

回答by Paul Sturm

Make sure you have enough free space on that partition. If not, you'll get this very error.

确保该分区上有足够的可用空间。如果没有,你会得到这个错误。

回答by Robert Forbes

I'm running meteor under Vagrant and came across this issue, before finding this thread I removed my MongoDB files from /var/lib/mongodbas there was a .lockin there as well, this might or might not have been required but worth a look for other areas where MongoDB might be residing beside the .meteorfolder.

我在 Vagrant 下运行流星并遇到了这个问题,在找到这个线程之前我删除了我的 MongoDB 文件,/var/lib/mongodb因为那里也有一个.lock,这可能需要也可能不需要,但值得一看 MongoDB 可能的其他领域驻留在.meteor文件夹旁边。

回答by HammerGuy

this bug used to happen everytime I restarted meteor and

每次我重新启动meteor时都会发生这个错误

rm .meteor/local/db/mongod.lock

didn't work for me (i'm working on cloud9 online IDE)

对我不起作用(我正在使用 cloud9 在线 IDE)

I now do

我现在做

rm .meteor/local/db/mongod.lock .meteor/local/db/local.*

and everything gets back to normal withouterasing my database

一切都恢复正常而不会删除我的数据库

回答by pal

I had the same issue on Windows 8.1 x64 : 'Unexpected mongo exit code 100. Restarting.'. And 'meteor reset' or 'delete mongod.lock' didn't solve it. To display the error details when launching mongod, I added a proc.stdout.onfunction in the run-mongo.js file :

我在 Windows 8.1 x64 上遇到了同样的问题:“意外的 mongo 退出代码 100。正在重新启动。” . 并且 'meteor reset' 或 'delete mongod.lock' 没有解决它。为了在启动mongod时显示错误详细信息,我在 run-mongo.js 文件中添加了一个proc.stdout.on函数:

// Let's not actually start a process if we yielded (eg during
// findMongoAndKillItDead) and we decided to stop in the middle (eg, because
// we're in multiple mode and another process exited).
if (stopped) return;

proc = spawnMongod(mongod_path, port, dbPath, replSetName);

// added this 3 lines just to debug 'Unexpected mongo exit code 100. Restarting.'
proc.stdout.on('data', function (data) {
  console.log('stdout: ' + data);
});

Then i got the explicit error :

然后我得到了明确的错误:

*********************************************************************
ERROR: dbpath (C:\Users\Pierre-André\Desktop\Pal\Meteor\simple-todos\.meteor\local\db) does not exist.
Create this directory or give existing directory in --dbpath.
See http://dochub.mongodb.org/core/startingandstoppingmongo
*********************************************************************

The error indicates the db directory doesn't exist. However, it exists. The problem was that i have a special character in the path (accent é in my name). I move my meteor project folder to another place in the disk which the path is accent free, and the it worked fine.

该错误表明 db 目录不存在。然而,它存在。问题是我在路径中有一个特殊字符(我名字中的重音 é)。我将我的流星项目文件夹移动到磁盘中路径没有重音的另一个位置,并且它工作正常。

Hope that'll help.

希望这会有所帮助。

The run-mongo.jsfile is located in my pc at : C:\Users\Pierre-André\AppData\Local\.meteor\packages\meteor-tool\1.1.10\mt-os.windows.x86_32\tools\runners

运行mongo.js文件位于我的电脑:C:\用户\皮埃尔-安德烈\应用程序数据\本地\ .meteor \包\流星工具\ 1.1.10 \ MT-os.windows.x86_32 \工具\跑步者

Don't forget to delete the 3 lines after solving the issue, or you'll have a lot of console logs each time the project is loaded.

解决问题后不要忘记删除3行,否则每次加载项目时都会有很多控制台日志。