Solved How to access mongoDB

Hi,

I have installed the Ubiquiti Unifi controler on our server a year ago..
I have been asked for some info that is store in the DB but I cannot figure out how to access the database..
I tried mongo show dbs and got
Code:
MongoDB shell version: 2.6.12
connecting to: show
2017-03-09T14:01:18.556+0000 warning: Failed to connect to 127.0.0.1:27017, reason: errno:61 Connection refused
2017-03-09T14:01:18.557+0000 Error: couldn't connect to server 127.0.0.1:27017 (127.0.0.1), connection attempt failed at src/mongo/shell/mongo.js:146
exception: connect failed
How do find out the name of the databases installed?

I am trying to export my user stats to CSV as per this forum
After getting the right port and knowing which DB to connect to MongoVUE worked a charm. Exporting to CSV works better with MongoVue than with the other option.



For anyone else who is struggling with this the settings I used in the end:



Name: UnifiDB

Server: localhost

Port: 27117

Username:

Password:

Database(s): ace,ace_stat
 
Code:
2017-03-09T14:01:18.556+0000 warning: Failed to connect to 127.0.0.1:27017, reason: errno:61 Connection refused
There's no MongoDB running on 127.0.0.1 port 27017.

And if you read the forum thread you posted:
Also, unless you changed the port it's 27117 not 27017.
You're connecting to the wrong port.

And I'm going to point to rule #7: https://forums.freebsd.org/threads/38922/
 
root@UniFi:/ # ps -aux
Code:
USER    PID %CPU %MEM     VSZ    RSS TT  STAT STARTED     TIME COMMAND
root   5698  0.0  0.0   14528   2140  -  SsJ  12Jan17  0:04.82 /usr/sbin/syslogd -s
unifi  5766  0.0  0.0   14492   1924  -  IsJ  24Feb17  0:00.00 daemon: /usr/local/openjdk8/bin/java[5767] (daemon)
unifi  5767  0.0  3.8 2870936 479560  -  IJ   24Feb17 47:10.19 /usr/local/openjdk8/bin/java -Djava.awt.headless=true -Xmx1024M -jar lib/ace.jar start
unifi  5768  0.0  1.3 1229256 158020  -  SJ   24Feb17 60:23.45 bin/mongod --dbpath /usr/local/share/java/unifi/data/db --port 27117 --logappend --logpath logs/mongod.log --nohttpinterface --bind_ip 127.0.0.1
root   5788  0.0  0.1   61312   6520  -  IsJ  12Jan17  0:00.00 /usr/sbin/sshd
root   5792  0.0  0.0   16624   2320  -  SsJ  12Jan17  0:06.03 /usr/sbin/cron -s
root  61010  0.0  0.0   23600   3400  0  SJ    1:59PM  0:00.02 tcsh
root  61409  0.0  0.0   18768   2164  0  R+J   2:13PM  0:00.00 ps -aux
Am I misunderstanding the output above?
how should I establish databse connection?
 
Yeah, sorry. It looked like it was some appliance, not an application.
 
Back
Top