English 中文(简体)
Problems to run examples in Meteor
原标题:

I m testing Meteor examples and this is what I see when I run meteor in todos examples:

Unexpected mongo exit code 100. Restarting.
Unexpected mongo exit code 100. Restarting.
Unexpected mongo exit code 100. Restarting.
Can t start mongod. Check for other processes listening on port 3002 or other meteors running in the same project.

And this is what happens if I run mongod in the command line:

Thu Apr 12 19:27:39 Mongo DB : starting : pid = 2686 port = 27017 dbpath = /data/db/ master = 0 slave = 0  32-bit 

** NOTE: when using MongoDB 32 bit, you are limited to about 2 gigabytes of data
**       see http://blog.mongodb.org/post/137788967/32-bit-limitations for more

Thu Apr 12 19:27:39 db version v1.4.4, pdfile version 4.5
Thu Apr 12 19:27:39 git version: nogitversion
Thu Apr 12 19:27:39 sys info: Linux murphy 2.6.32.14-dsa-ia32 #1 SMP Thu May 27 16:19:20 CEST 2010 i686 BOOST_LIB_VERSION=1_42
Thu Apr 12 19:27:39 waiting for connections on port 27017
Thu Apr 12 19:27:39 listen(): bind() failed errno:98 Address already in use for port: 27017
Thu Apr 12 19:27:39 MiniWebServer: bind() failed port:28017 errno:98 Address already in use
Thu Apr 12 19:27:39   addr already in use
Thu Apr 12 19:27:39 warning: web admin interface failed to initialize on port 28017

Someone helps? Thanks!

问题回答

I had the same problem. Fixed with:

WARNING: This erases your local database:

meteor reset

I had the same problem. Just remove .meteor/local/db/mongod.lock in your meteor project folder. And meteor should run normally.

Hope it helped! :)

As mKriss mentioned, try

meteor reset

If you get this error:

reset: Meteor is running.

This command does not work while Meteor is running your application.
Exit the running meteor development server.

Then look for meteor in your running processes:

ps -x | grep meteor

This gave me the following output:

14877 pts/0    Sl     0:02 /usr/lib/meteor/mongodb/bin/mongod --bind_ip 127.0.0.1 --port 3005 --dbpath /home/sam/proto/.meteor/local/db
15022 pts/0    S+     0:00 grep --color=auto meteor

So then I did:

kill -s KILL 14877
meteor reset
meteor

Now everything works!

Not sure if this is relevant to your problem, but I got this error and eventually discovered it was caused because I had my app directory in a NFS share (I am running on Ubuntu in VirtualBox) which mongodb doesn t like. Putting my app in my home directory instead fixed the problem.

There are a few ways around this, the question didn t show how to use mongod so I m going to run through how to get a bit more detail on the error. meteor reset might work but not always & it will clear your apps data if it does work.

The core issue is meteor is very undescriptive when it comes to displaying data, so I would advise to get get a bit more detail on the error as it could literally any mongodb error out there. The steps below should reproduce the error with more verbosity to help diagnose what the root issue is

Find where Meteor installs mongodb

If you have the mongod tool (downloadable from http://mongodb.com), otherwise use the one installed with meteor. Just be careful you don t get too new a version that upgrades your old database, then meteor s older mongodb won t be able to understand it.

typically (but not always) at

/usr/local/meteor/mongodb/bin/mongod (OS X)

/usr/lib/meteor/mongodb/bin/mongod (Red Hat/Debian)

C:Program FilesMeteormongodbinmongod.exe (Windows via Tom Wijsman s port)

Run Meteor s database manually with mongodb

So we re going to use this to manually run mongodb on your apps mongodb database:

In your projects directory with your terminal app/command prompt

cd .meteor
cd local
/usr/local/meteor/mongodb/bin/mongod --dbpath ./

If your mongod path is something else use that instead, the above works on OS X.

Analyse the output to find the root cause of the issue

Now mongodb should run and give you a good description of what the problem is, or run smoothly:

Mon Apr  1 23:59:55 [initandlisten] MongoDB starting : pid=84640 port=27017 dbpath=./ 64-bit  host=MacBook-Pro.local
Mon Apr  1 23:59:55 [initandlisten] 
Mon Apr  1 23:59:55 [initandlisten] ** WARNING: soft rlimits too low. Number of files is 256, should be at least 1000
Mon Apr  1 23:59:55 [initandlisten] db version v2.2.1, pdfile version 4.5
Mon Apr  1 23:59:55 [initandlisten] git version: d6764bf8dfe0685521b8bc7b98fd1fab8cfeb5ae
Mon Apr  1 23:59:55 [initandlisten] waiting for connections on port 27017

Have a look at the what the error might be and then tackle the problem displayed. It could be one of many.

Example issue

If it has:

exception in initAndListen: 10310 Unable to lock file: ./mongod.lock. Is a mongod instance already running?, terminating

Then restart your computer to kill any processes that might be using the file and if it still doesn t help use meteor reset to clear the directory at .meteor/local/db so your app uses a fresh database.

The errors are very helpful e.g low disk space (clear up the trash ;-) or cannot write to disk (permissions issue - use chmod/sudo).

Very obscure issues

If you find something very perplexing it might be a mongodb issue more than a meteor one, have a look around for the error you get here on stackoverflow and if you can t find it put a question up and swarms of helpful people are hopefully ready to help :)

I have very simple solution:

export LC_ALL="en_US.UTF-8"

and run meteor

If it is ok, you can add this line to

sudo vim /usr/local/bin/meteor

If meteor reset isn t working for you, check your disk space usage.

If you don t have any free disk space, you will get this error. MongoDB takes up about 450MBs, so creating a few projects can fill up a partition quickly.

If your meteor project is in a DropBox-folder, check for file names that contain the words conflicted copy in .meteor/local/db/ in your project folder and remove them. That should free up Mongod to run.

This is what helped me to run meteor on Google Compute Engine:

export LC_ALL=C

Watch for accents in the path of your projects.

..SystèmeMyMeteorProject will not work, ..SystemMyMeteorProject will work.

Forgive the obvious, but does netstat -antep | grep 3002 show anything? (assuming you re on *nix)

I know this question is rather old, however I just ran into this issue as well and thought this might be useful to someone. What worked in my case was to run "sudo meteor"

I got this error message:

MongoDB had an unspecified uncaught exception.
This can be caused by MongoDB being unable to write to a local database.
Check that you have permissions to write to .meteor/local. MongoDB does
not support filesystems like NFS that do not allow file locking.

...and it turned out that I had an instance of the same app running on a different port, so add "making sure you don t have any other instances of the app running on an alternate port" to the list of things that can cause this error.

I could solve the issue under Meteor 1.2.1 and recover my data by deleting the lock file, copying whats left of .meteor/local/db/ to a temporary location (you might call this a backup), issue meteor reset and copy the backup data back to .meteor/local/db/. Everything worked as before.

for those using vagrant and do not want to meteor reset, clearing out the db of your meteor s local directory resolved the conflict. from the terminal:

rm -rf .meteor/local/db/
Thu Apr 12 19:27:39 listen(): bind() failed errno:98 Address already in use for port: 27017

Something else is already using the port 27017, so mongo startup is failing. Start mongo on a different port or kill whatever process is using 27017 first.

Meteor reset command did not work for me in DOS

I deleted all files and folder under <projectfolder>/.meteor/local/db to Recycle Bin

**DOS Log below:**

D:Meteor	odos>meteor reset
Project reset.

D:Meteor	odos>

I found the same conflict issue from syncing. I was using Ubuntu One and a bunch of new files were created in .meteor/local/db/ with "u1_conflicted" appended. I deleted those, and the ones in .meteor/local/db/journal and was back up and running.

I could recover the error by deleting the Local Mogo db lock.

Steps to remove the db lock :

  1. Navigate to your app directory(where you have Meteor application files)
  2. Remove file $ rm .meteor/local/db/mongod.lock

NOTE : $ meteor reset

WARNING: meteor reset erases everything in your local database.

Error occurs if Meteor Application is still running in background. Db lock is not released by the running application or due to improper system/application shutdown and unavailable for second instance of same application.

So take care to quit the application every time.

Same problem when I tried to create my project in a VMWare shared folder linking to a host folder...

cd /mnt/hgfs/Folder_in_C_host_drive

meteor create myapp

cd myapp

meteor

Unexpected mongo exit code 100. Restarting.

...

Solved by moving the project to a standard folder in my filesystem...VMWare Shared Folders are not capable of handling file security and any files are root:root owned...that was why it ended in those MongoDB errors

If you are using Vagrant, MongoDb won t run in the Vagrant shared directory: https://gist.github.com/gabrielhpugliese/5855677

If you using Windows for your dev work, Meteor now has a Windows installer: http://win.meteor.com/

You can just try to stop running your meteor app using this command: kill -9 ps ax | grep node | grep meteor | awk {print $1}

I ran into the Unexpected mongo exit code 100. Restarting. error a while back.I ended up answering my own question here which seems to have done the trick for many facing the same issue.Most importantly is it doesn t require meteor resetwhich wipes the database.It s a simple and very quick three step fix so I d recommend trying it before some of the more complicated suggestions.

I had the same problem. Fixed with:

Fixed with:

  1. your project directory
  2. redirect to .meteor directory > .local > .db
  3. in .db folder remove all the files from here
  4. run command "meteor"

It s working fine for me.Try this, it really helps alot.

Become a superuser:

# meteor --allow-superuser

run the command meteor reset on sudo user. It should work for you..





相关问题
Access DB Ref MongoDB

Whats the best way to access/query a DB Ref: UPDATE: users: name, groupref : {$ref:"groups",$id:"ObjectId ..." } } groups: name, topic, country,...,.. Assumption is that user belongs to only one ...

MongoDB nested sets

What re the best practices to store nested sets (like trees of comments) in MongoDB? I mean, every comment can have a parent comment and children-comments (answers). Storing them like this: { ...

MongoMapper and migrations

I m building a Rails application using MongoDB as the back-end and MongoMapper as the ORM tool. Suppose in version 1, I define the following model: class SomeModel include MongoMapper::Document ...

MongoDB takes long for indexing

I have the following setup: Mac Pro with 2 GB of RAM (yes, not that much) MongoDB 1.1.3 64-bit 8 million entries in a single collection index for one field (integer) wanted Calling .ensureIndex(...) ...

Storing and accessing large amounts of data

My application creates pieces of data that, in xml, would look like this: <resource url="someurl"> <term> <name>somename</name> <frequency>somenumber</...

热门标签