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
01abef0204a7        fxrialab/appserver:latest   /usr/sbin/httpd -D F   30 minute
s ago      Up 30 minutes>443/tcp,>80/tcp
f6d0631bb092        fxrialab/orient:latest      /bin/sh -c cd /opt/o   30 minute
s ago      Up 30 minutes>2424/tcp,>2480/tcp
ebc1386250b9        fxrialab/data:latest        /usr/sbin/sshd -D      30 minute
s ago      Up 30 minutes>22/tcp

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:

  • Can Windows Containers be hosted on linux?
  • Elastic Beanstalk local environment (with Docker) connection refused
  • pip install django-allauth UnicodeDecodeError
  • Running Jenkins slave on different OS than master (and host)
  • Node.js modules not building in Docker
  • How do I expose port from Container to host?
  • Socket error #111: Connection refused

    • vendors/OrientDB/OrientDB.php:254
    • 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 !

  • Which Docker images will run on Kubernetes?
  • How to use GC in Docker Registry without accessing container
  • docker-machine, docker-compose and google cloud
  • Configure appveyor for Docker
  • Ubuntu/UFW: How to tell Docker not to expose all ports?
  • Docker created with docker-compose not visible from outside server
  • 3 Solutions collect form web for “Why orientDB connection to localhost of docker is refused”

    localhost is a synonim for ip address

    your binds are for

    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.