connect remotely to mongoDB server

558 views Asked by At

I have installed MongoDB on a fresh Centos7 server. I have installed MongoDB accroding to this tutrial: https://www.liquidweb.com/kb/how-to-install-mongodb-on-centos-7/

The installation was completed succsessfully, when I write mongo on the shell this is the output:

[root@centos-512mb-nyc3-01 ~]# mongo

MongoDB shell version: 2.6.12

connecting to: test

Server has startup warnings:

2016-12-31T18:37:11.734+0000 [initandlisten]

2016-12-31T18:37:11.734+0000 [initandlisten] ** WARNING: Readahead for /var/lib/mongo is set to 4096KB

2016-12-31T18:37:11.734+0000 [initandlisten] ** We suggest setting it to 256KB (512 sectors) or less

2016-12-31T18:37:11.734+0000 [initandlisten] ** http://dochub.mongodb.org/core/readahead.

I want to connect remotly to mongo via RoboMongo or NodeJS app. but when I have tried mongo mongodb://138.197.80.108/ I get network unreachable.

There is something that I need to do to connect remotly to mongo?

Thanks :)

BTW - I havn't set any password\user

1

There are 1 answers

0
Itzik.B On

I have bind machine's IP address according to: https://www.mkyong.com/mongodb/mongodb-allow-remote-access/

and added port 27017 to the fire wall tables.