2 Replies Latest reply on Feb 13, 2017 3:58 PM by Christos Iraklis Tsatsoulis

    Remote proxy server won't connect unless NoSQL DB hostname registered in DNS or /etc/hosts

    Christos Iraklis Tsatsoulis

      Hi all,

       

      I am trying to built an IoT demo, where data from my Raspberry Pi will be stored in NoSQL. And since I intend to use the Python & Node.js API's, I followed the documentation instructions to set up a proxy server in the Pi.

       

      Problem is, the proxy server (running in the Pi) is unable to find the NoSQL host, even if I use the host IP address (192.168.70.74):

       

      pi@raspberrypi:~ $export CLASSPATH="/usr/local/lib/python2.7/dist-packages/nosqldb/kvproxy/lib/*"

      pi@raspberrypi:~ $ java oracle.kv.proxy.KVProxy -port 7010 -helper-hosts 192.168.70.74:5000 -store kvstore

      Feb 06, 2017 11:09:28 AM oracle.kv.proxy.KVProxy <init>

      INFO: PS: Starting KVProxy server

      Feb 06, 2017 11:09:28 AM oracle.kv.proxy.KVProxy <init>

      INFO: PS: Connect to Oracle NoSQL Database kvstore nodes : 192.168.70.74:5000

      Exception in thread "main" oracle.kv.FaultException: Could not contact any RepNode at: [192.168.70.74:5000] (12.1.4.3.10)

      Fault class name: oracle.kv.KVStoreException

          at oracle.kv.KVStoreFactory.getStoreInternal(KVStoreFactory.java:227)
          at oracle.kv.KVStoreFactory.getStore(KVStoreFactory.java:122)
          at oracle.kv.KVStoreFactory.getStore(KVStoreFactory.java:59)
          at oracle.kv.proxy.KVProxy.<init>(KVProxy.java:125)
          at oracle.kv.proxy.KVProxy.startServer(KVProxy.java:161)
          at oracle.kv.proxy.KVProxy.main(KVProxy.java:151)

      Caused by: oracle.kv.KVStoreException: Could not contact any RepNode at: [192.168.70.74:5000]

          at oracle.kv.impl.util.TopologyLocator.getInitialTopology(TopologyLocator.java:246)
          at oracle.kv.impl.util.TopologyLocator.get(TopologyLocator.java:83)
          at oracle.kv.impl.api.RequestDispatcherImpl.<init>(RequestDispatcherImpl.java:330)
          at oracle.kv.KVStoreFactory.getStoreInternal(KVStoreFactory.java:214)
          ... 5 more

      Caused by: java.rmi.UnknownHostException: Unknown host: bigdatalite.localdomain; nested exception is:

          java.net.UnknownHostException: bigdatalite.localdomain
          at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:616)
          at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:216)
          at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:202)
          at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:130)
          at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:227)
          at java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:179)
          at com.sun.proxy.$Proxy0.getSerialVersion(Unknown Source)
          at oracle.kv.impl.util.registry.RemoteAPI.<init>(RemoteAPI.java:40)
          at oracle.kv.impl.rep.admin.RepNodeAdminAPI.<init>(RepNodeAdminAPI.java:67)
          at oracle.kv.impl.rep.admin.RepNodeAdminAPI.wrap(RepNodeAdminAPI.java:76)
          at oracle.kv.impl.util.TopologyLocator$3.run(TopologyLocator.java:313)
          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
          at java.util.concurrent.FutureTask.run(FutureTask.java:266)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
          at java.lang.Thread.run(Thread.java:745)

      Caused by: java.net.UnknownHostException: bigdatalite.localdomain

          at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:184)
          at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
          at java.net.Socket.connect(Socket.java:589)
          at oracle.kv.impl.util.registry.ClientSocketFactory.createTimeoutSocket(ClientSocketFactory.java:360)
          at oracle.kv.impl.util.registry.ClientSocketFactory.createSocket(ClientSocketFactory.java:347)
          at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:613)
          ... 15 more

       

       

      bigdatalite.localdomain is the hostname where NoSQL DB is running.

       

      I was able to find a workaround, by including the host's IP address in the Pi's /etc/hosts file, after which the connection works properly; nevertheless, it feels like a hack.

       

      I unearthed an old Stack Overflow question, where it is implied that the KVStore requires the hostname, but I could not locate such a requirement in the admin installation guide.

       

      So, is this expected behavior? And if yes, could someone point to the relevant section in the installation documentation?

       

      Many thanks in advance.

       

      Christos