How do I connect via console to a server running on localhost only?

81 views
Skip to first unread message

William

unread,
Sep 22, 2016, 6:31:40 PM9/22/16
to OrientDB
Can anyone confirm this behavior... I'm not sure if it's a bug or if I'm just doing something wrong...

I noticed yesterday that when I fire up the server.sh application, the default behavior is to listen on an outward facing port on my machine...

2016-09-22 16:08:35:815 INFO  OrientDB Studio available at http://<MY ACTUAL IP ADDRESS>:2480/studio/index.html [OServer]

Since our cybersecurity department at my organization frowns upon firing up servers that listen to outward facing ports, I modified the <listeners> section in config/orientdb-server-config.xml file

        <listeners>
            <listener protocol="binary" socket="default" port-range="2424-2430" ip-address="0.0.0.0"/>
            <listener protocol="http" socket="default" port-range="2480-2490" ip-address="0.0.0.0">

so that the ip-address field is "127.0.0.1"

I can connect Studio to the database using 127.0.0.1:2480 or localhost:2480 and everything works fine.  I verified that http://my-machine-name:2480/ will correctly fail too.  I hit a problem though when I try to use the console application.  

I get the following behaviour in console.sh:

$ console.sh

OrientDB console v.2.2.10 (build 2.2.x@rc32d4ee06d4c38e27eb66931d027eb54854872ff; 2016-09-15 08:47:27+0000) www.orientdb.com
Type 'help' to display all the supported commands.
Installing extensions for GREMLIN language v.2.6.0

orientdb> connect REMOTE:localhost/myDatabase admin admin

Connecting to database [REMOTE:localhost/myDatabase] with user 'admin'...
Error: com.orientechnologies.orient.core.exception.OStorageException: Cannot create a connection to remote server address(es): [<SYSTEM IP ADDRESS>:2424]
DB name="myDatabase"

Based on what I can see in the documentation I would think that this should work.  I've tried using REMOTE:localhost/myDatabase and REMOTE:127.0.0.1/myDatabase but the result is the same... OrientDB appears to completely ignore my instructions and runs with its default and tries to connect to my machine's real IP address.

Is this a bug or is there something that I am missing?

-William












Ivan Mainetti

unread,
Sep 22, 2016, 7:06:19 PM9/22/16
to OrientDB
Hi,
in the listener configuration ip-address you need to insert the allowed source ip, for example if you want to allow only connection from your machine you need to insert your actual ip of net interface not the loopback one (127.0.0.1).
Hope this is clear.

Ivan

William

unread,
Sep 22, 2016, 7:39:22 PM9/22/16
to OrientDB
Sorry, I'm not sure I'm following you.  I changed the only listener ip address locations that I can find in the entire configuration directory to 127.0.0.1... it's only on the two lines in orientdb-server-config.xml as I referenced...  but console ignores that. 

Can you provide more detail?  Is there a different file that I need to edit?  Is there a new element that needs to be added to the configuration XML file?

Thanks!
-William

Luca Garulli

unread,
Sep 22, 2016, 7:45:49 PM9/22/16
to OrientDB
Hi William,

This was a bug I fixed yesterday: the console converted the localhost to the public IP. It's fixed in v2.2.x branch.

Have you read the issue and its comments?

Best Regards,

Luca Garulli
Founder & CEO

Want to share your opinion about OrientDB?
Rate & review us at Gartner's Software Review


--

---
You received this message because you are subscribed to the Google Groups "OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orient-database+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ivan Mainetti

unread,
Sep 22, 2016, 7:46:30 PM9/22/16
to OrientDB
here's the default configuration:
<listeners>
            <listener protocol="binary" socket="default" port-range="2424-2430" ip-address="0.0.0.0"/>
            <listener protocol="http" socket="default" port-range="2480-2490" ip-address="0.0.0.0">

now, if I understood what you're trying to do, you need to  replace the 0.0.0.0 with your ip address to allow only that particular ip to connect to the server.

William

unread,
Sep 23, 2016, 11:55:42 AM9/23/16
to OrientDB
Hi Luca,

I just looked for the issue but was unable to find it in either the list of open or closed issues. This is the correct place to look, right?  

I believe I did find the commit though. :) 

Thanks!
-William

Luca Garulli

unread,
Sep 23, 2016, 1:27:17 PM9/23/16
to OrientDB
You found it!

Best Regards,

Luca Garulli
Founder & CEO

Want to share your opinion about OrientDB?
Rate & review us at Gartner's Software Review


--
Reply all
Reply to author
Forward
0 new messages