Telnet to weblogic managed server doesn't work on docker

I’m working with a weblogic image to create a multi-host environment with docker. I’ve gone through an article from oracle and created three docker machines machine1, machine2 and machine3. All the machines are part of a swarm network in which m1 is manager and other two are worker nodes. And then, I created a overlay network my-net.

docker network create --driver overlay --subnet=10.0.9.0/24 --attachable my-net

The machine1 has the Admin container attached to the swarm network.

docker run -d --name admin --env-file /DockerBaseImage/configurations/domain.properties -v /DockerBaseImage/configurations/:/configurations -v /DockerBaseImage/applications/:/applications -p 9005:8001 --net my-net 12212-baseimage

And the machine2 and machine3 has ManagedServer2 and ManagedServer3 respectively.

docker run -d --name ManagedServer1–env-file /DockerBaseImage/configurations/domain.properties -v /DockerBaseImage/configurations/:/configurations -v /DockerBaseImage/applications/:/applications --link admin:wlsadmin --env NM_NAME=Machine2 --env MS_NAME=ManagedServer2 -p 9002:7002 --net my-net 12212-baseimage createServer. sh

docker run -d --name ManagedServer2–env-file /DockerBaseImage/configurations/domain.properties -v /DockerBaseImage/configurations/:/configurations -v /DockerBaseImage/applications/:/applications --link admin:wlsadmin --env NM_NAME=Machine3 --env MS_NAME=ManagedServer3 -p 9002:7002 --net my-net 12212-baseimage createServer. sh

Now when I login to weblogic console I can see all the three servers running but, when I do
telnet machine2 9002 from machine1 I get connection refused message. What could I be doing wrong?

Dockerfile:

FROM oracle/weblogic:12.2.1.2-generic

ARG ADMIN_PASSWORD
ARG ADMIN_NAME
ARG DOMAIN_NAME
ARG ADMIN_PORT
ARG CLUSTER_NAME
ARG DEBUG_FLAG
ARG PRODUCTION_MODE

ENV ADMIN_HOST=“wlsadmin”
NM_PORT=“5556”
MS_PORT=“7002”
DEBUG_PORT=“8453”
CONFIG_JVM_ARGS=“-Dweblogic.security.SSL.ignoreHostnameVerification=true”

ENV DOMAIN_NAME=“${DOMAIN_NAME:-basedomain}”
DOMAIN_HOME=/domains/${DOMAIN_NAME:-basedomain}
ADMIN_NAME=“${ADMIN_NAME:-AdminServer}”
ADMIN_PORT=“${ADMIN_PORT:-8001}”
CLUSTER_NAME=“${CLUSTER_NAME:-DockerCluster}”
debugFlag=“${DEBUG_FLAG:-false}”
PRODUCTION_MODE=“${PRODUCTION_MODE:-prod}”
PATH=$PATH:/u01/oracle/oracle_common/common/bin:/u01/oracle/wlserver/common/bin:/domains/${DOMAIN_NAME:-basedomain}/bin:/u01/oracle

ADD resources/* /u01/oracle/
ADD *.jar /u01/oracle/wlserver/common/templates/wls/
ADD configurations/ /configurations
ADD applications/ /applications

USER root

RUN mkdir /domains/ &&
chown -R oracle /domains/

USER oracle
RUN /u01/oracle/wlst /u01/oracle/create-wls-domain.py &&
mkdir -p $DOMAIN_HOME/servers/AdminServer/security &&
echo “username=weblogic” > $DOMAIN_HOME/servers/AdminServer/security/boot.properties &&
echo “password=${ADMIN_PASSWORD:-weblogic1}” >> $DOMAIN_HOME/servers/AdminServer/security/boot.properties &&
echo “. $DOMAIN_HOME/bin/setDomainEnv.sh” >> /u01/oracle/.bashrc

EXPOSE $NM_PORT $ADMIN_PORT $MS_PORT $DEBUG_PORT

WORKDIR $DOMAIN_HOME

CMD [“startWLDomain.sh”]

Docker version:

Client:
Version: 1.13.1
API version: 1.26
Go version: go1.7.5
Git commit: 092cba3
Built: Wed Feb 8 06:44:54 2017
OS/Arch: linux/amd64

Server:
Version: 1.13.1
API version: 1.26 (minimum version 1.12)
Go version: go1.7.5
Git commit: 092cba3
Built: Wed Feb 8 06:44:54 2017
OS/Arch: linux/amd64
Experimental: false

netstat on machine2:

tcp6 0 0 :::9002 :::* LISTEN

netstat on managed server container:

tcp6 0 0 10.0.9.3:7002 :::* LISTEN

probably the telnet server is not installed or configured on the oracle image

But telnet to other ports like admin server and node manager ports work fine.

oh, you meant telnet to the weblogic ports… not telnet in general…

where do you config the port u need to connect to in the dockerfile or weblogic config…
(not a weblogic guy)…

exposed the port in dockerfile and createServer.sh script actually sets the port number for Managed Server in the config.

ok, got it… and if you docker inspect container_id (of server 2 or 3), you should see the port mapping…

sounds like the weblogic server didn’t get it setup… is there something in the weblogic server web UI to show that config setting?

Yup, I see the port mapping when I run docker inspect on the container.

Here are the settings from weblogic showing the servers are indeed running and can be contacted within the network.

Managed Server 1 config:

ok, on the telnet, what ip address of the container are you using? this is docker toolbox, right? so the ip address is of the virtual machine running the containers… (not localhost)

Yup, I’m using the ip address of the machine running the containers

just checking…

so you did this

$ docker-machine ip
and got something like this
192.168.99.100

Yeah, that’s correct.

cool… searching on this kind of problem, it seems many users had to open windows firewall ports for non-typical ports… 8001 is typical, 9002 is not