Why orientDB connection to localhost of docker is refused

I did build orientDB and appserver on docker. They are running as well. This is list containers on docker:

core@localhost ~ $ docker  ps
CONTAINER ID        IMAGE                      COMMAND                CREATED
       STATUS              PORTS
NAMES
01abef0204a7        fxrialab/appserver:latest   /usr/sbin/httpd -D F   30 minute
s ago      Up 30 minutes       0.0.0.0:443->443/tcp, 0.0.0.0:80->80/tcp
appserver
f6d0631bb092        fxrialab/orient:latest      /bin/sh -c cd /opt/o   30 minute
s ago      Up 30 minutes       0.0.0.0:2424->2424/tcp, 0.0.0.0:2480->2480/tcp
appserver/db,orient
ebc1386250b9        fxrialab/data:latest        /usr/sbin/sshd -D      30 minute
s ago      Up 30 minutes       0.0.0.0:2200->22/tcp
data

Also i did create database on orientDB. I think orient is working fine. However when i login to my website. I got errors “Connection refused” like this:

  • Docker in debugging mode
  • Docker: understanding ENTRYPOINT and CMD instructions
  • Exposing local Docker containers on internet (There are two containers linked to each other).
  • How to share a host directory between multiple docker container?
  • How to install node_modules into Docker image and use later WITHOUT docker compose?
  • How to keep track of pip installed packages on one docker container to use them in another
  • Socket error #111: Connection refused

    • vendors/OrientDB/OrientDB.php:254
    OrientDBSocket->__construct(‘localhost’,’2424′,30)
    • apps/models/DB.php:11 OrientDB->__construct(‘localhost’,’2424′)

    I dont know what reason althought i did test fine on local when i enabled server.bat file. Ah, i using orientdb-1.7

    Thank for advance !

  • Can't log to graylog2 docker container via HTTP endpoint
  • How to find Kubernetes pod that's handling the request
  • Slow JDBC connection when using MySQL in Boot2Docker
  • Jenkins Amazon ECR Plugin login issue “Authorization Token has expired”
  • Haproxy in docker container unstable
  • Restart flask app in docker on changes
  • 3 Solutions collect form web for “Why orientDB connection to localhost of docker is refused”

    localhost is a synonim for ip address 127.0.0.1

    your binds are for 0.0.0.0

    I am not familiar with OrientDB, but I believe that what you are facing is ports access problem (server configuration), not software problem (in this case software is OrientDB). Most servers are configured to block all ports, unless specifically allowed – for security reasons, so that noone can connect to the server on those blocked ports.

    So, what is probably happening is that your local server is fine with using those ports, and remote server is secured and thus prevents connections.

    Docker is running a virtual machine with separate network interface for each containers. Thus if your appserver connects to localhost, it won’t see the orientdb.

    You need to update your configuration to lookup the proper environment variable for the link (see http://docs.docker.com/userguide/dockerlinks/) or just use the db host. Docker injects a hostname into /etc/hosts for each linked container.

    I’ve found cause of this issue, because im config HOST to connect is wrong. It’s not localhost because docker uses its own internal IP’s. In ssh type docker inspect orient then use global variables for config to access to IP & Port.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.