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:

  • How to visually see the browser being automated on Multihost docker on windows 10 and Linux ?
  • How pass/set environment variables into HHVM?
  • Adding portMappings to Dockerrun.aws.json with Single container configuartion
  • Docker build time arguments
  • How to add jdbc driver to weblogic server running on docker container?
  • Why install docker on ubuntu should be `sudo apt-get install docker.io`?
  • 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 !

  • How do I run celery status/flower without the -A option?
  • How to back up docker swarm mode service configuration for disaster recovery
  • docker : When creating a machine, VT-X/AMD is enabled yet
  • Consul not deregistering zombie services
  • Upgrade of docker gitlab image to 8.6 breaks gitlab
  • Run commands on Docker container from Emacs
  • 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.