Am instalat MongoDB pe VPS dar nu ma pot conecta remote cu MongoVUE

Am instalat MongoDB pe VPS, CentOS, ma pot conecta la el local de pe VPS dar nu remote cu MongoVUE remote, imi da eroarea:

Connection was refused
Unable to connect to server 89.44.47.85:27017: Object reference not set to an instance of an object…
Type: MongoDB.Driver.MongoConnectionException
Stack: at MongoDB.Driver.Internal.DirectMongoServerProxy.Connect(TimeSpan timeout, ReadPreference readPreference)
at MongoDB.Driver.MongoServer.Connect(TimeSpan timeout)
at MongoDB.Driver.MongoServer.Connect()
at MangoUI.MMongo.QSDlL5xzK686iCExThO(Object )
at MangoUI.MMongo.Open(Boolean mustWrite)

Am rulat netstat -tunap

tcp 0 0 0.0.0.0:27017 0.0.0.0:* LISTEN 12314/mongod

procesul e ok asculta pe portul care tb.

am deschis portul cu iptables desi nu cred ca era nevoie.

Inclin sa cred ca e tot firewall issue. poate SELinux? Incearca sa le faci disable temporar la firewall / Selinux si vezi daca te ajuta.

[root@adavidoaiei ~]# sestatus
SELinux status: disabled

am rulat si service iptables stop + chkconfig iptables off

[root@adavidoaiei ~]# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

  1. http://stopdisablingselinux.com/
  2. VPS de unde? are IP direct asignat sau e nevoie sa faci port forward? Are firewall in fata? (GCE, AWS)
    log-urile ce zic?
1 Like

Am IP public ma conectez prin SSH, FTP pe ip-ul respectiv, nu cred ca am firewall in fata, log-uri, sincer nu stiu in ce log-uri sa ma uit, e un server pe care ma joc/invat o sa ma uit la log-urile de mongodb poate aflu ceva.

Incearca si un ticket la host company legat de portul tau. Just in case…

1 Like
$>mongo 127.0.0.1:27017/dbName  -u dbUser -p dbPass --authenticationDatabase admin --verbose

Ce zice?

[root@adavidoaiei ~]# mongo 127.0.0.1:27017/test -u xx -p xx --authenticationDatabase admin --verbose
MongoDB shell version: 3.0.5
connecting to: 127.0.0.1:27017/test
2015-08-12T21:16:03.019+0400 D NETWORK creating new connection to:127.0.0.1:27017
2015-08-12T21:16:03.019+0400 D COMMAND [ConnectBG] BackgroundJob starting: ConnectBG
2015-08-12T21:16:03.019+0400 D NETWORK connected to server 127.0.0.1:27017 (127.0.0.1)
2015-08-12T21:16:03.019+0400 D NETWORK connected connection!
Server has startup warnings:
2015-08-12T20:02:20.700+0400 I CONTROL [initandlisten]
2015-08-12T20:02:20.700+0400 I CONTROL [initandlisten] ** WARNING: You are running in OpenVZ which can cause issues on versions of RHEL older than RHEL6.
2015-08-12T20:02:20.700+0400 I CONTROL [initandlisten]
2015-08-12T20:02:20.700+0400 I CONTROL [initandlisten] ** WARNING: soft rlimits too low. rlimits set to 1024 processes, 64000 files. Number of processes should be at least 32000 : 0.5 times number of files.
2015-08-12T20:02:20.700+0400 I CONTROL [initandlisten]

OK, deci merge. Ai vre-un Mongo local? sa testezi conxiune remote din consola?
Pe net se zice ca MongoVue nu merge cu MongoDB 3

testez, intr-adevar am pus ultima versiune de mongdb shit

Merge din linie de comanda am m-ai testat robomongo si nici ala nu merge

C:\Program Files\MongoDB\Server\3.0\bin>mongo 89.44.47.85:27017/test -u xx -p xx --authenticationDatabase admin --verbose
MongoDB shell version: 3.0.5
connecting to: 89.44.47.85:27017/test
2015-08-12T20:36:05.432+0300 D NETWORK creating new connection to:89.44.47.85:2
7017
2015-08-12T20:36:05.473+0300 D COMMAND [ConnectBG] BackgroundJob starting: Conn
ectBG
2015-08-12T20:36:05.535+0300 D NETWORK connected to server 89.44.47.85:27017 (8
9.44.47.85)
2015-08-12T20:36:05.536+0300 D NETWORK connected connection!
Server has startup warnings:
2015-08-12T20:02:20.700+0400 I CONTROL [initandlisten]
2015-08-12T20:02:20.700+0400 I CONTROL [initandlisten] ** WARNING: You are runn
ing in OpenVZ which can cause issues on versions of RHEL older than RHEL6.
2015-08-12T20:02:20.700+0400 I CONTROL [initandlisten]
2015-08-12T20:02:20.700+0400 I CONTROL [initandlisten] ** WARNING: soft rlimits
too low. rlimits set to 1024 processes, 64000 files. Number of processes should
be at least 32000 : 0.5 times number of files.
2015-08-12T20:02:20.700+0400 I CONTROL [initandlisten]

Incearca mongochef, il folosesc pe 3 si e ok

thanks merge @kleampa

Nu am avut rabdare @ct27stf sa ma uit la toata prezentarea de 40 min de SELinux dar am gasit un rezumat pe site-ul de la CentOS http://wiki.centos.org/HowTos/SELinux