Sunday Dec 20, 2015

Implement Oracle WebCenter 11g as Docker Containers

This post shows you how to create Docker Images with Oracle WebCenter installed. Download the entire project directory from GitHub here.

Docker offers a container-based virtualization platform for applications and I have been playing with it for a few weeks now to see how I can create a base image with all the Oracle Software installed. Consequently, I wanted to port the WebLogic Admin Server and Managed Servers as Docker containers. As patches become available, I would then update my base image and distribute it. Once a new image is available, the idea is to create new containers for the WebLogic Admin Server and Managed Servers while retaining existing configuration and data. Here is how I did it.

I have used a Ubuntu 15.10 virtual machine for this exercise. You will need plenty of disk space on your virtual machine as Docker creates an intermediate image after every instruction. The instructions for setting up Docker can be found on their website here.

Once the environment is setup and ready to go, the next step is to identify a Docker build context directory and create the necessary folder structure. 

mkdir ~/webcenter
cd ~/webcenter
mkdir jdk wls rcu wcc wcp

After the directories are setup, all the necessary installers should be downloaded. The installers come as a ZIP archive and most of them will have to be extracted in those directories. If you have downloaded the project files from GitHub, you can find the instructions to download and extract the files under the respective directory. You can also click on a directory below to see the instructions. At the end you should have a directory structure shown below. 

./webcenter
 - Dockerfile.11.1.1.9.0
 - domain
  - docker_domain_admin.jar
 - jdk
  - jdk-7u91-linux-x64.tar.gz
 - rcu
  - rcuHome
  - readme_fmw_ps7.htm
 - scripts
  - add_server.py
  - start_server.sh
 - wcc
  - 22060967
  - Disk1
  - Disk2
  - ECM_22249978
  - readme_fmw_ps7.htm
 - wcp
  - 21950042
  - Disk1
  - Disk2
  - Disk3
  - Disk4
  - readme_fmw_ps7.htm
 - wls
  - p20780171_1036_Generic.zip
  - silent.xml
  - wls1036_generic.jar

Create or edit the Dockerfile in your context directory. For this post, the Dockerfile is named as Dockerfile.11.1.1.9.0. 

FROM oraclelinux:6
MAINTAINER Justin Paul

ENV _SCRATCH /tmp/scratch
ENV ORA_HOME /u01/app/oracle
ENV JDK_HOME ${ORA_HOME}/product/jdk
ENV FMW_HOME ${ORA_HOME}/product/fmw
ENV ADM_HOME ${ORA_HOME}/admin

COPY jdk ${_SCRATCH}/jdk/
COPY wls ${_SCRATCH}/wls/
COPY rcu ${_SCRATCH}/rcu/
COPY wcc ${_SCRATCH}/wcc/
COPY wcp ${_SCRATCH}/wcp/
COPY domain ${_SCRATCH}/domain/
COPY scripts ${_SCRATCH}/scripts/

RUN yum update -y -q && \
 yum install -y -q binutils compat-libcap1 compat-libstdc++-33 \
 compat-libstdc++-33.i686 gcc gcc-c++ glibc glibc-devel glibc-devel.i686 \
 libaio libaio-devel libgcc libgcc.i686 libstdc++ libstdc++.i686 \
 libstdc++-devel libXext libXtst libXi openmotif openmotif22 redhat-lsb \
 sysstat zlib zlib.i686 libX11 libX11.i686 unzip xorg-x11-utils xorg-x11-xauth && \
 groupadd -g 1000 oinstall && \
 useradd -u 1000 -g 1000 -m oracle && \
 mkdir -p ${ORA_HOME} && \
 chown -R oracle:oinstall ${_SCRATCH} && \
 chown -R oracle:oinstall ${ORA_HOME}

USER oracle

RUN mkdir -p ${JDK_HOME} && \
 tar xzf ${_SCRATCH}/jdk/jdk-7u91-linux-x64.tar.gz -C ${JDK_HOME} --strip-components=1 && \
 mkdir -p ${FMW_HOME} && \
 ${JDK_HOME}/bin/java -jar ${_SCRATCH}/wls/wls1036_generic.jar \
 -mode=silent -silent_xml=${_SCRATCH}/wls/silent.xml && \
 mv ${_SCRATCH}/rcu/rcuHome ${FMW_HOME}/ && \
 echo "inventory_loc=${FMW_HOME}/oraInventory" > ${_SCRATCH}/oraInst.loc && \
 echo "inst_group=oinstall" >> ${_SCRATCH}/oraInst.loc && \
 ${_SCRATCH}/wcp/Disk1/runInstaller -silent -invPtrLoc ${_SCRATCH}/oraInst.loc \
 -responseFile ${_SCRATCH}/wcp/Disk1/stage/Response/sampleResponse_wls.rsp \
 -jreLoc ${JDK_HOME} -waitforcompletion -force -novalidation \
 MIDDLEWARE_HOME=${FMW_HOME} ORACLE_HOME=${FMW_HOME}/Oracle_WC1 && \
 ${_SCRATCH}/wcc/Disk1/runInstaller -silent -invPtrLoc ${_SCRATCH}/oraInst.loc \
 -responseFile ${_SCRATCH}/wcc/Disk1/stage/Response/sampleResponse_wls.rsp \
 -jreLoc ${JDK_HOME} -waitforcompletion -force -novalidation \
 MIDDLEWARE_HOME=${FMW_HOME} ORACLE_HOME=${FMW_HOME}/Oracle_ECM1 && \
 mkdir -p ${ADM_HOME}/tools/templates && \
 mkdir -p ${ADM_HOME}/tools/scripts && \
 cp ${_SCRATCH}/domain/* ${ADM_HOME}/tools/templates && \
 cp -r ${_SCRATCH}/scripts/* ${ADM_HOME}/tools/scripts

RUN rm -rf ${_SCRATCH}

CMD /bin/bash

Run the following command to build your image. Use --no-cache=true if you do not want to cache intermediate images. 

cd ~/webcenter
docker build -t webcenter:11.1.1.9.0 -f ./Dockerfile.11.1.1.9.0 .

After the image(s) are built, we can start creating the containers. For the purpose of this post, we will keep the admin domain configuration on a shared volume. This volume will be mounted with RW permissions on the admin server container and with R permissions only on the managed server containers.

Run the following commands to create and start your admin server container. Use the -d flag instead of -i to force the container to run as a background process. 

mkdir -p ~/volume/aserver
docker run -i -P --name=adminserver \
-v ~/volume/aserver:/u01/app/oracle/admin/aserver:rw \
-t webcenter:11.1.1.9.0 /bin/sh /u01/app/oracle/admin/tools/scripts/start_server.sh \
adminserver

Find the IP Address of the newly created container using the docker inspect command. 

docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' adminserver

After the Admin Server is up and running, login to the Admin Console as weblogic [the password is welcome1]. Update the JDBC data sources for all services that you intend to use. They are setup with dummy values in the domain and these data sources should be configured before you can start and managed server. For example, if you intend to create the UCM managed server container, you must configure the CSDS data source to connect to a valid database.

After the Admin Server configuration is complete, start a managed server container using the following commands. Use the -d flag instead of -i to force the container to run as a background process. Replace abc.def.ghi.jkl with the IP Address of the Admin Server. 

docker run -i -P --name=ucm_mserver1 \
-v ~/volume/aserver:/u01/app/oracle/admin/aserver:ro \
-t webcenter:11.1.1.9.0 /bin/sh /u01/app/oracle/admin/tools/scripts/start_server.sh \
ucm t3://abc.def.ghi.jkl:7001

You can create containers for any managed servers supported by the domain. Replace SERVER_ID with one of [capture, ibr, ipm, irm, ssxa, ucm, urm, collaboration, portlet, spaces, utilities] to create a managed server container for that service. Also remember to replace abc.def.ghi.jkl with the IP Address of the Admin Server. 

docker run -d -P --name=SERVER_ID_1 \
-v ~/volume/aserver:/u01/app/oracle/admin/aserver:ro \
-t webcenter:11.1.1.9.0 /bin/sh /u01/app/oracle/admin/tools/scripts/start_server.sh \
SERVER_ID t3://abc.def.ghi.jkl:7001

If you wish to update the image with the latest patches, update the Dockerfile with the instructions to apply the patches and build the image again or create a new image. After the new image is created, recreate the admin server and managed server containers using the same commands as above. Make sure you use the right image, mount the correct shared volume and change the container names.

NOTE: Please note that these instructions should be used for development and evaluation purposes only, as such they are unsupported and should not be used on production environments.

Wednesday May 07, 2014

How to: Run Repository Creation Utility (RCU) on Solaris

Many of the Oracle Fusion Middleware components require the existence of schemas in a database prior to installation. These schemas are created and loaded in the database using the Repository Creation Utility (RCU). Repository Creation Utility is a graphical and CLI-based tool used to create and manage Oracle Fusion Middleware database schemas.

At this time, RCU is available for Windows and Linux platforms only.

If you want to run RCU on Solaris, edit the RCU executable, <RCU_HOME>/bin/rcu, and make the following changes:
  • Look for the “#Platform Checking” section, and comment out the "exit" statement
  • Look for the line which specifies the JRE_DIR and update it to point to a Solaris JRE or JDK
After making these changes, set the SQLPLUS_HOME variable to point to any ORACLE_HOME and export it before running RCU.

Now you will be able to run RCU on Solaris and create the database objects for Oracle Fusion Middleware.

NOTE: Please note that these instructions should be used for development and testing purposes only, as such it is unsupported and should not be used on production environments.
About

Welcome to my blog. I use this site to share my experience as well as tips and tricks on Oracle Fusion Middleware products.

Contributors

Search

Archives
« June 2016
SunMonTueWedThuFriSat
   
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
  
       
Today