alexmizell / Turntable.fm-Bots

5 stars 2 forks source link

How Do I Install Mongo? #1

Open mnafricano opened 11 years ago

mnafricano commented 11 years ago

I've looked on the internet and found some tutorials on how to install Mongo but they aren't working. Whenever I type, mongo into my command prompt, this is the output that I get:

Last login: Tue May 21 17:24:18 on ttys000
marcellos-imac:~ marcelloafricano$ mongo
MongoDB shell version: 2.4.3
connecting to: test
Tue May 21 17:30:23.148 JavaScript execution failed: Error: couldn't connect to server 127.0.0.1:27017 at src/mongo/shell/mongo.js:L112
exception: connect failed
marcellos-imac:~ marcelloafricano$ 

Can you please explain to me how to do this? Thank you!

alexmizell commented 11 years ago

Try running mongod first.

mnafricano commented 11 years ago

Do you mean, type mongod, into the command prompt like this:

Last login: Tue May 21 17:38:41 on ttys000
marcellos-imac:~ marcelloafricano$ mongod
alexmizell commented 11 years ago

you might have to use ./mongod

mnafricano commented 11 years ago

Okay, I will try that when I arrive home, then I'll edit this comment to show my results. Thank you.

alexmizell commented 11 years ago

Fwiw you don't actually have to have mongodb for the bot to work. Even if it's not installed at all the bot will still run normally with no changes. The database just provides a way to remember song history, and the bot doesn't even do anything with that data in this version.

mnafricano commented 11 years ago

Hmm, I'll try that out because that mongodb command never really actually worked for me.

alexmizell commented 11 years ago

It's not mongodb but mongod, short for Mongo Daemon. You'll need to cd (change directory) into the bin subfolder of the folder where you unpacked Mongo and then type "./mongod" (dot forward slash mongod). Mash enter and then theoretically you should see something like this:

C:\jazzbot5200\mongodb\bin>mongod
mongod --help for help and startup options
Tue May 28 17:51:46 [initandlisten] MongoDB starting : pid=10036 port=27017 dbpath=/data/db 64-bit host=burroughs
Tue May 28 17:51:46 [initandlisten] db version v2.0.4, pdfile version 4.5
Tue May 28 17:51:46 [initandlisten] git version: 329f3c47fe8136c03392c8f0e548506cb21f8ebf
Tue May 28 17:51:46 [initandlisten] build info: windows sys.getwindowsversion(major=6, minor=1, build=7601, platform
Tue May 28 17:51:46 [initandlisten] options: {}
Tue May 28 17:51:46 [initandlisten] journal dir=/data/db/journal
Tue May 28 17:51:46 [initandlisten] recover : no journal files present, no recovery needed
Tue May 28 17:51:46 [initandlisten] waiting for connections on port 27017
Tue May 28 17:51:46 [websvr] admin web console waiting for connections on port 28017

Then when you run the bot with node you'll see a connection in this Window and the Turntable song history will be saved. Or whatever you are trying to do with Mongo will work. As databases go it doesn't get much easier than this.

mnafricano commented 11 years ago

Thank you for all the help! :wink: