Mongod setup issue on Node install

mongodb

#1

issue initializing mongod daemon.

the problem

Running mongod w/o strictly following the instructions from this guide results in an error.
Yes, following this guide is the only successful approach I’ve seen although I’d recommend not labeling the script mongod so people don’t confuse ./mongod with mongod

From what I have gathered, the error:

t3h2mas:~/workspace $ mongod
Error parsing command line: unknown option small
try 'mongod --help' for more information

happens because c9 is trying to alias mongod to some script that uses --smallfiles to better fit in with the workspace constraints.

solution?

from what I can see…

Running mongod from the terminal even with the --smallfiles argument passed still returns the error. You could specify that the only way to run the mongo daemon is to follow this guide. Or you could alter the broken aliased? script that is providing the broken arguments/opts.


#2

Hi,

Hmm, I’m not sure I understand. According to the guide referenced, you have to create the mongod file yourself.

$ echo 'mongod --bind_ip=$IP --dbpath=data --nojournal --rest "$@"' > mongod
$ chmod a+x mongod

so we aren’t doing anything automatically to the mongod file. If you’d like to call mongod with a different set of arguments, just change the above command to pass the arguments you desire. (I think you might have already done that)

The error shown in your post: Error parsing command line: unknown option small means that you might be passing an argument --small which may not be understood by the mongod binary.

In order to help debug the issue, please let us know the full command you’re using instead of the one above. (The one that contains --small).

Regards,
​Mutahhir


#3

He gave you the right command, i have the same issue.
the 3 following commands give the same error:
moody_mudskipper:~/workspace (master) mongod --smallfiles Error parsing command line: unknown option small try 'mongod --help' for more information moody_mudskipper:~/workspace (master) mongod --help
Error parsing command line: unknown option small
try ‘mongod --help’ for more information
moody_mudskipper:~/workspace (master) $ mongod
Error parsing command line: unknown option small
try ‘mongod --help’ for more information


#4

There’s a difference between the mongod binary and the script that the instructions has you make. If there wasn’t a system mongod binary then the script wouldn’t make sense. Something is passing an invalid argument to mongod. Interestingly the mongod works from within the script…


#5

Same issue.

  1. Check the .bash_aliases and you will see: alias mongod=“mongod --bind_ip=IP --small --rest '@’”
  2. Edit it to look like so: alias mongod="mongod --bind_ip=$IP --smallfiles --rest --httpinterface "
  3. source ~/.bash_aliases
  4. mongod

No need to use --smallfiles anymore as it is built into the alias now. Not sure what they were trying to do with the $@ but it is not needed. You can test this by running: mongod --help


#6

I found a workaround! The following command works:

gbhojraj:~/workspace (master) $ “mongod” --nojournal


#7

Hi all,

Thank you @MichaelLeeHobbs for pointing out the issue there!! I wasn’t aware of that :sweat_smile:. We’re now in the process of fixing the .bash_aliases file, so you won’t encounter this issue.

Regards,
Mutahhir


#8

Just encountered this issue. Is there any word of when this will be fixed?


#9

I run into this issue today.

it’s because a alias, with the “–small”

$ alias
alias mongod='mongod --bind_ip=0.0.0.0 --small --rest '\'''\'''

please fix.


#10

This is still an issue 15 days later. Got around by putting quotes around "mongod".