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_MODEENV 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/oracleADD resources/* /u01/oracle/
ADD *.jar /u01/oracle/wlserver/common/templates/wls/
ADD configurations/ /configurations
ADD applications/ /applicationsUSER 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/.bashrcEXPOSE $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/amd64Server:
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