RocketChat / Rocket.Chat

The communications platform that puts data protection first.
https://rocket.chat/
Other
40.39k stars 10.51k forks source link

connecting to mongodb outside of server #11826

Closed asadi110 closed 6 years ago

asadi110 commented 6 years ago

I'm not able connect to mongodb from outside of server . i'm set mongo ip bind to 0.0.0.0 and my computer ip but no change and mongodb compass not recognize my serverand show this message : MongoDB not running on the provided host and port m1

madguy02 commented 6 years ago

@asadi110 are you trying to connect to the meteor mongo?

pkgodara commented 6 years ago

@asadi110 Are you sure about the port? Mine is being connected on 3001, so try that if you didn't alter config.

madguy02 commented 6 years ago

@asadi110 yes,@pkgodara if the meteor mongo is used then it should be 3001 if the app is running at 3000 @asadi110 27017 is not the meteor mongo you are trying to access, so please change the port to the next consecutive port. @asadi110 please close the issue once you solve it .. thanks

asadi110 commented 6 years ago

@pkgodara @madguy02 thanks for replying.I install rc from snap on ubuntu with no alter config. port 3001 not connect.

meysam@SRV-Payam:~$ netstat -ntl Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 0.0.0.0:22 0.0.0.0: LISTEN tcp 0 0 0.0.0.0:3000 0.0.0.0: LISTEN tcp 0 0 127.0.0.1:27017 0.0.0.0: LISTEN tcp6 0 0 :::22 ::: LISTEN meysam@SRV-Payam:~$

s1 s2

madguy02 commented 6 years ago

Can you do a ps auxww|grep mongo|grep meteor @asadi110

asadi110 commented 6 years ago

@madguy02 s3 meysam@SRV-Payam:~$ ps auxww|grep mongo root 20595 0.0 0.0 4504 780 ? Ss Aug16 0:00 /bin/sh /snap/rocketchat-server/1317/bin/startmongo root 20611 2.2 3.1 701988 128360 ? Sl Aug16 102:46 mongod --bind_ip 127.0.0.1 --pidfilepath /var/snap/rocketchat-server/common/mongod.pid --smallfiles --journal --dbpath=/var/snap/rocketchat-server/common --replSet rs0 meysam 22925 0.0 0.0 12944 960 pts/2 S+ 10:07 0:00 grep --color=auto mongo meysam@SRV-Payam:~$ ps auxww|grep mongo|grep meteor meysam@SRV-Payam:~$

geekgonecrazy commented 6 years ago

with snaps mongo is started up binding only to 127.0.0.1

If you want to connect externally you will have to connect over ssh. Most mongo clients support this. Every mongo client i've ever used does.

Basically set ssh information and then server at 127.0.0.1

Going to go ahead and close because this is more of support then a bug.