swinkler149 / 901K-Sandbox

901K Sandbox Project
4 stars 1 forks source link

Dataset acquisition and quick analysis of their structure and contents #17

Open tonypetruccelli opened 9 years ago

eahollin commented 9 years ago

Estimate: 1 hr., based on proposed renaming

eahollin commented 9 years ago

Reassigned per team standup 3/18/15

swinkler149 commented 9 years ago

First data set added - crop production by state

To load/run must create mongo user.

1) Admin shell

mongo admin --username root --password (password from ec2 log)

2) Create db user in mongo shell

use correlatordb

db.createUser({'user':'dbuser', 'pwd':'dbuserpw', roles:['readWrite']});

3) Then import your json data set. I created a script called load_cropprod.bsh, looks like this:

!/bin/bash

echo "Loading crop production data"

DBUSER="dbuser" DBPW="dbuserpw" INPUTDATA="./cropprod.json" DBNAME="correlatordb" COLLECTION="cropprod2012"

cat $INPUTDATA | mongoimport -u $DBUSER -p $DBPW -d $DBNAME -c $COLLECTION

if test $? -eq 0 then echo "Mongo Import successful" else echo "Mongo Import failed" fi

swinkler149 commented 9 years ago

New data loads added to db/load for two new collections - oes data by state and crops harvested by state.

eahollin commented 9 years ago

Awesome! I got them loaded in my copy of Mongo and will make endpoints in the app soon.

TimLeMasters commented 9 years ago

From my VM, I can now launch the app and get to the homepage and map, but my dropdowns have no data. I'm thinking I'm having an issue with the DB. The three collections cropharvested, cropprod, and oesbystate seem to be loaded correctly in correlatordb. Where do you configure the mongo auth information in the corrolator app?

ferrx commented 9 years ago

@TimLeMasters If I understand, you're looking for the mongo connection config? https://github.com/swinkler149/901K-Sandbox/blob/master/source/c2/server/config/environment/development.js

You'll need to create a user/pass in mongo with those credentials. http://docs.mongodb.org/manual/reference/method/db.createUser/

TimLeMasters commented 9 years ago

Thanks. Both the db and development.js are set up as documented. I had not known where to put the mongo url--that is what I was asking about. As it turns out, though, the checked-in version of development.js matches the notes that Ed made. Still having the empty drop-down issue, though. I'll keep investigating.