Setting Up MongoDB

mongodb

#23

No problem! (Random text now because replies have to be at least 20 characters long)


#24

Thanks for your support! Here is a link to my workspace https://c9.io/chbroggi/cbr_mongodb


#25

Before I go digging into that, did you try this on a brand new workspace? I’m guessing it will work there :slight_smile: If that is the case, you’ll want to clear our some space in the workspace you referenced.


#26

Yes, forgot to mention it. It is a brand new workspace. So there should be no space problem.


#27

I wanted to upgrade MongoDB to 3.2 and I followed the instructions here: https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/#install-mongodb, but I ran into problems.

Setting up mongodb-org-server (3.2.10) ...
invoke-rc.d: unknown initscript, /etc/init.d/mongod not found.
dpkg: error processing package mongodb-org-server (--configure):
 subprocess installed post-installation script returned error exit status 100

I was finally able to install it by following the workaround here: https://jira.mongodb.org/browse/SERVER-21812

Seems to be related to Docker, but I saw a couple of other posts here saying they upgraded successfully just recently so I am not sure why the problem cropped up for me.


#28

this is what i get when i try to instal mongodb

if anyone can help me out please


#29

Hi @bradydowling ! I’m having an with Cloud9 and MongoDB. I’ve been using it for several months without a problem when lastnight I tried starting it. An unclean shutdown was detected, so I used ./mongod --repair, which I’ve used many times before, but this time i received the error:

2017-03-17T18:35:28.326+0000 ** WARNING: --rest is specified without --httpinterface,
2017-03-17T18:35:28.326+0000 **          enabling http interface
warning: bind_ip of 0.0.0.0 is unnecessary; listens on all ips by default
2017-03-17T18:35:28.329+0000 [initandlisten] MongoDB starting : pid=7571 port=27017 dbpath=data 64-bit host=pearlysquirrel-bootcamp-4338674
2017-03-17T18:35:28.329+0000 [initandlisten] db version v2.6.12
2017-03-17T18:35:28.329+0000 [initandlisten] git version: d73c92b1c85703828b55c2916a5dd4ad46535f6a
2017-03-17T18:35:28.329+0000 [initandlisten] build info: Linux build5.ny.cbi.10gen.cc 2.6.32-431.3.1.el6.x86_64 #1 SMP Fri Jan 3 21:39:27 UTC 2014 x86_64 BOOST_LIB_VERSION=1_49
2017-03-17T18:35:28.329+0000 [initandlisten] allocator: tcmalloc
2017-03-17T18:35:28.329+0000 [initandlisten] options: { net: { bindIp: "0.0.0.0", http: { RESTInterfaceEnabled: true, enabled: true } }, repair: true, storage: { dbPath: "data", journal: { enabled: false } } }
2017-03-17T18:35:28.438+0000 [initandlisten] repairDatabase yelp_camp_v6
2017-03-17T18:35:28.438+0000 [initandlisten] yelp_camp_v6 Fatal assertion 17401 OutOfDiskSpace Cannot repair database yelp_camp_v6 having size: 83886080 (bytes) because free disk space is: 57257984 (bytes)
2017-03-17T18:35:28.442+0000 [initandlisten] yelp_camp_v6 0x121df81 0x11bd689 0x11a0998 0x769dad 0x76c54e 0x76e907 0x76f53b 0x76fb85 0x76fe59 0x7ffbe67c3f45 0x766419 
 mongod(_ZN5mongo15printStackTraceERSo+0x21) [0x121df81]
 mongod(_ZN5mongo10logContextEPKc+0x159) [0x11bd689]
 mongod(_ZN5mongo23fassertFailedWithStatusEiRKNS_6StatusE+0x118) [0x11a0998]
 mongod(_ZN5mongo11doDBUpgradeERKSsPNS_14DataFileHeaderE+0x9dd) [0x769dad]
 mongod() [0x76c54e]
 mongod(_ZN5mongo14_initAndListenEi+0x637) [0x76e907]
 mongod(_ZN5mongo13initAndListenEi+0x1b) [0x76f53b]
 mongod() [0x76fb85]
 mongod(main+0x9) [0x76fe59]
 /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x7ffbe67c3f45]
 mongod() [0x766419]
2017-03-17T18:35:28.442+0000 [initandlisten] 

***aborting after fassert() failure

and:

2017-03-17T18:35:28.446+0000 [initandlisten] SEVERE: Got signal: 6 (Aborted).
Backtrace:0x121df81 0x121d35e 0x7ffbe67d8cb0 0x7ffbe67d8c37 0x7ffbe67dc028 0x11a0a05 0x769dad 0x76c54e 0x76e907 0x76f53b 0x76fb85 0x76fe59 0x7ffbe67c3f45 0x766419 
 mongod(_ZN5mongo15printStackTraceERSo+0x21) [0x121df81]
 mongod() [0x121d35e]
 /lib/x86_64-linux-gnu/libc.so.6(+0x36cb0) [0x7ffbe67d8cb0]
 /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x37) [0x7ffbe67d8c37]
 /lib/x86_64-linux-gnu/libc.so.6(abort+0x148) [0x7ffbe67dc028]
 mongod(_ZN5mongo23fassertFailedWithStatusEiRKNS_6StatusE+0x185) [0x11a0a05]
 mongod(_ZN5mongo11doDBUpgradeERKSsPNS_14DataFileHeaderE+0x9dd) [0x769dad]
 mongod() [0x76c54e]
 mongod(_ZN5mongo14_initAndListenEi+0x637) [0x76e907]
 mongod(_ZN5mongo13initAndListenEi+0x1b) [0x76f53b]
 mongod() [0x76fb85]
 mongod(main+0x9) [0x76fe59]
 /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x7ffbe67c3f45]
 mongod() [0x766419]

So, now i’m unable to start my server and, being new to db’s i’m not sure how to move forward!

THanks for any help or advice you can give!


#30

Hi there,I’m just having the exact same issue,did you find a solution in the end? please share!I’m stuck


#31

Hello Wassim123
I am having the same problem. Would you mind telling me how you solved it, if you have? Thanks.


#33

Are you sure you are at exactly the right directory because it seems you are at one back step.


#34

The problem seems to have to do with a problem in the sudoers file (when trying to install mongo, a syntax error in that file caused the install to fail). Could you post the text you get by running sudo visudo (this will open the sudoers file). @ronaldwp and @ludeveloper, if you can post yours, that would be helpful as well.


#35

I got this eror while running npm install mongodb command
path c9.io/chvsai/freecodecamp/src/npm-debug.log
please let me know what should be done


#36

Hi Danny,

I have this exact same issue, and the following is the output from sudo visudo :

  GNU nano 2.2.6                                                                   File: /etc/sudoers.tmp                                                                                                                                            

# This file is overwritten by Cloud9 when a container is restarted, changes will not be kept.
Defaults        env_reset
Defaults        mail_badpass
Defaults        !secure_path

# User privilege specification
root    ALL=(ALL:ALL) ALL

# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL

# Allow members of group sudo to execute any command
%sudo ALL=(ALL)NOPASSWD:ALL

I installed mongodb in my base workspace and not within the test app directory I created using angular-cli. Should it be installed in the app directory itself?

Edit: Just tested setting up within the app directory and that the same error occurs.

Edit 2: Ok so upon checking my terminal logs it seems I somehow managed to miss out the sudo command in the beginning, therefore not even installing mongodb. I feel pretty silly. All working now! ><


#37

Error connecting to mongo. failed to connect to server [localhost:27017] on first connect [MongoError: connect ECONNREFUSED 127.0.0.1:27017]

facing this issue in step 2-CONNECT

Need help


#38

Great advice @dannytech, I came here to tell people about this command but you’ve enlightened us already.


#39

Installing MongoDB on Ubuntu , Windows, Mac OSX steps are provided here http://www.amazonwebservicesforum.com/2017/08/installing-mongodb.html


#40

I find this very weird that no one has really solved this issue. I am trying to follow an online course but this keeps happening.

cwredesign:~ $ ./mongod
2017-09-25T01:54:36.155+0000 ** WARNING: --rest is specified without --httpinterface,
2017-09-25T01:54:36.155+0000 ** enabling http interface
warning: bind_ip of 0.0.0.0 is unnecessary; listens on all ips by default
2017-09-25T01:54:36.158+0000 [initandlisten] MongoDB starting : pid=4394 port=27017 dbpath=data 64-bit host=cwredesign-mongodb-project-5131358
2017-09-25T01:54:36.158+0000 [initandlisten] db version v2.6.12
2017-09-25T01:54:36.158+0000 [initandlisten] git version: d73c92b1c85703828b55c2916a5dd4ad46535f6a
2017-09-25T01:54:36.158+0000 [initandlisten] build info: Linux build5.ny.cbi.10gen.cc 2.6.32-431.3.1.el6.x86_64 #1 SMP Fri Jan 3 21:39:27 UTC 2014 x86_64 BOOST_LIB_VERSION=1_49
2017-09-25T01:54:36.158+0000 [initandlisten] allocator: tcmalloc
2017-09-25T01:54:36.158+0000 [initandlisten] options: { net: { bindIp: “0.0.0.0”, http: { RESTInterfaceEnabled: true, enabled: true } }, storage: { dbPath: “data”, journal: { enabled: false } } }
2017-09-25T01:54:36.165+0000 [initandlisten] couldn’t open data/local.ns errno:13 Permission denied
2017-09-25T01:54:36.166+0000 [initandlisten] error couldn’t open file data/local.ns terminating
2017-09-25T01:54:36.166+0000 [initandlisten] dbexit:
2017-09-25T01:54:36.166+0000 [initandlisten] shutdown: going to close listening sockets…
2017-09-25T01:54:36.166+0000 [initandlisten] shutdown: going to flush diaglog…
2017-09-25T01:54:36.166+0000 [initandlisten] shutdown: going to close sockets…
2017-09-25T01:54:36.166+0000 [initandlisten] shutdown: waiting for fs preallocator…
2017-09-25T01:54:36.166+0000 [initandlisten] shutdown: closing all files…
2017-09-25T01:54:36.166+0000 [initandlisten] closeAllFiles() finished
2017-09-25T01:54:36.166+0000 [initandlisten] shutdown: removing fs lock…
2017-09-25T01:54:36.166+0000 [initandlisten] dbexit: really exiting now


#43

Very late reply. Try resizing. It’s a size error on the DB.


#44

same problem here
have you solved it?


#45

new problems here, please help:

admin:~ $ sudo apt-get install -y mongodb-org
sudo: apt-get: command not found

admin:~ $ sudo yum install -y mongodb-org
Loaded plugins: priorities, update-motd, upgrade-helper
amzn-main | 2.1 kB 00:00
amzn-updates | 2.5 kB 00:00
1039 packages excluded due to repository priority protections
No package mongodb-org available.
Error: Nothing to do