I have developed a Java application that uses ArangoDB as backend database (Used ArangoDB Java-Driver/Interface to access ArangoDB).
Everything is good until my ArangoDB and Application resides on same machine.
Once i moved ArangoDB to remote machine(Dedicated Server), my application is unable to access it :(
I have given my remote machine details(ArangoDB Server) in some properties file and feeding that file location to ArangoConfigure Constructor while creating ArangoDriver Object. But still i'm unable to access ArangoDB :(
Small snippet of my code is below:
protected static ArangoConfigure getConfiguration() {
//ArangoConfigure configure = new ArangoConfigure();
ArangoConfigure configure = new
ArangoConfigure("/Volumes/Official/ZLabs/arangodb.properties");
configure.init();
return configure; }
protected static ArangoDriver getArangoDriver(ArangoConfigure
configuration) { return new ArangoDriver(configuration); }
Please help me in this regard.
Awaiting your response.
Thanks & Best Regards,
- Mahi
解决方案
If the Aranngodb Java driver fails to open or parse /Volumes/Official/ZLabs/arangodb.properties it issues a log message.
If arangodb properties looks like that:
port=8529
host=192.168.22.17
user=root
password=OpenSesame
enableCURLLogger=false
You start walking up the OSI model to debug TCP connection problems to evade possible connection issues due to firewals, routing etc.
One uses the commonly available telnet command to test the availability of the server:
telnet 192.168.22.17 8529
Trying 192.168.22.17...
If it sits there forever, you most probably have a firewall filtering you away, you finaly will get:
telnet: Unable to connect to remote host: Connection timed out
If it immediately exits with:
telnet: Unable to connect to remote host: Connection refused
It seems the server doesn't answer.
On the server side you then can check whether the service has bound the port (8529) you're trying to connect:
netstat -alpnt |grep 8529
tcp 0 0 0.0.0.0:8529 0.0.0.0:* LISTEN 19912/arangod
If you instead see it binding 127.0.0.1:8529 you won't be able to connect it remotely and need to change arangod.conf like this:
[server]
endpoint = tcp://0.0.0.0:8529
And then restart ArangoDB. Then, you should be able to see something like this:
telnet 192.168.22.17 8529
Trying 192.168.22.17...
Connected to 192.168.22.17.
Escape character is '^]'.
GET / HTTP/1.0
HTTP/1.1 301 Moved Permanently
Location: /_db/_system/_admin/aardvark/index.html
Content-Type: text/html
Server: ArangoDB
Connection: Close
Content-Length: 197
MovedMoved
This page has moved to /_db/_system/_admin/aardvark/index.html.