Oracle Fusion Middleware Deployments Using Docker Swarm Part I
This is the first in a series of blogs that describe how to build a Fusion Middleware (FMW) Cluster that runs as a number of Docker images that run in docker containers. These containers are coordinated using Docker Swarm and can be deployed to a single host machine or multiple hosts. This simplifies the task of building FMW clusters and also makes it easier to scale them in and out (adding or subtracting host machines) as well as up and down (using bigger or smaller host machines).
This blog uses Oracle Service Bus as an FMW product but the principles are applicable to other FMW products.
In this entry we will explain the concepts of using Docker Swarm 1.12 to create a Fusion Middleware Cluster. We will explain how to set up a minimal Linux machine to run a docker engine and prepare it to start building out a Fusion Middleware Cluster running on Swarm. In future entries we will cover creating a database docker image that we will use to support Fusion Middleware. Other entries will explain how to create a docker image to run Fusion Middleware and create a cluster in swarm mode by defining swarm services for the database, WebLogic Admin Server and WebLogic managed servers.
FMW deployments can be complex to setup and configure. The Enterprise Deployment Guide for SOA Suite 12.2.1 has a lots of steps to follow within its 382 pages. This is taken care of for you when you subscribe to FMW on the cloud, such as Oracle SOA Cloud Service. However many companies still run their FMW deployments in on premise systems and are not yet ready to move to the Oracle Cloud Machine, which provides a private cloud environment that looks just like the public cloud.
Docker provides a lightweight container in which to run software. Multiple docker images can be coordinated by Docker Swarm to form a cluster. Each image runs in a docker container which virtualizes the resources used by the image, making it possible for multiple images to execute on a single machines or for images to to be distributed across multiple machines. In either case Swarm helps to manage the cluster of machines.
There are a number of blog entries that explain how to use FMW with docker but most of them only use the developer install, which can run in a single docker container. A more normal FMW installation has a separate database and multiple managed servers. There a few blog entries that describe using this, but they use old versions of docker and there are now better ways of implementing this. We use the latest versions of docker and swarm to show to create FMW clusters running on docker swarm in a configuration that is production ready.
Over this and the next few blog entries I have partnered with my colleague Shuxuan Nie to describe how to run a highly FMW deployment on top of Docker. We have used Oracle Service Bus as an example FMW deployment but the principles can be applied to any FMW deployment.
Holding a masters degree in computer science from Beijing University of Aeronautics and Astronautics Shuxuan Nie is a senior principal devops engineer working on Oracle's forthcoming Adaptive Intelligence Applications Cloud Service (AIA). Prior to joining Oracle, Shuxuan worked as a systems architect at Australian based Oracle partner Rubicon Red. There she specialized in helping customers build highly available FMW environments on both physical hardware and VMs. She also contributed to Rubicon Reds Myst platform provisioning and continuous delivery tool. In her current position she works with Oracle Container Cloud Service (which provides docker in the cloud) to provide deployment environments for the AIA cloud service.
A graduate of Bristol University Antony Reynolds is a Product Strategy Director in Oracle’sIntegration Products group where he works with Oracle Integration Cloud Service (ICS). In addition to working with ICS he also helps customers upgrade to the latest SOA Suite releases, working closely with some of the largest users of SOA Suite in the world. A blogger and author of several books on Oracle SOA Suite Antony was attracted to Docker by its lightweight container model and power of abstraction.
FMW and WebLogic rely on a database and an Admin Server. This leads us to require the following Docker containers to implement FMW on Docker. Each docker container runs a docker image. The beauty of Docker is that these containers can be deployed together on a single machine or distributed across multiple machines without any changes to their configuration.
We could deploy all the containers on a single machine as shown below.
Alternatively we can distribute them across several machines.
Of course we could choose a combination of the two.
Note that from the docker containers perspective each thinks it is running in its own physical machine, although it is actually running in a docker container on a physical or virtual machines and may be sharing that machine with other running docker containers.
Initially we deployed all the containers on a single machine, once we had that working then we deployed our contains to multiple machines.
We are used to running FMW on multiple virtual machines. This is used extensively on Oracle Exalogic for example, as well as the large number of customers who run FMW on Oracle Virtual Machine (OVM) or Dell’s VMWare. The problem with VMs is that each virtual machine has a whole operating system that is running on top of the VM hypervisor. This includes the kernel and file system which makes a VM a relatively heavyweight container.
In contrast to a Virtual Machine a Docker Container just abstracts the CPU, memory, network and file system of the underlying operating system. It does not run a separate kernel, instead deferring most of the execution to the underlying machine,m physical or virtual. This results in a lighter weight container that still has the benefits of isolation and abstraction that a VM provides. This is why people are excited about using docker containers to host services, particularly micro services, that would be too expensive to dedicate a VM to.
A docker image is a specific set of binaries and configuration that is targeted to run inside a docker container. This could be an Oracle database, a WebLogic managed server or a WebLogic admin server.
So let's translate FMW / WebLogic deployment terms onto docker concepts. Note that this is a conceptual mapping, but is not an exact equivalent.
Docker engine can run multiple docker containers on a single host.
Docker swarm clusters can be used to run multiple instances of an image, providing a great platform to run an FMW cluster on top of.
Manages the swarm cluster and decides on which docker engine to run a particular container. Note that this function is split between Weblogic Console and Node Manager in WebLogic.
Binaries and Domain Configuration
A docker image represents a set of code and associated configuration packaged up for execution in a docker container.
A running image instance, parameters can be used to customize the instance, so that the same image can be used to run an Admin server or a Managed Server.
Managed WebLogic Server in a Cluster
A swarm service is a generic service. A WebLogic Admin Server would be a Swarm Service with a single instance. A Managed Server would be a Swarm Service that allowed multiple instances.
Note that although FMW allows multiple servers to be targeted at a single machine, docker achieves this through two level, a docker container runs a single server, but a docker engine can run multiple containers.. This is not as limiting as it sounds because a docker container is much lighter than a VM and so it is easy to run multiple docker containers on a docker engine running on a single VM or physical machine with minimal overhead on top of the requirements of the WebLogic server.
Oracle Fusion Middleware is the name for Oracle’s middleware products. These are powerful proprietary middleware products that are used by customers throughout the world to; run applications and portals, integrate systems, provide business analytics and secure their environments, amongst other things.
Although many of these products are available in free developer editions they still require acknowledgement of the Oracle license and as such cannot be distributed as part of a docker image. These products can also be large, often requiring several gigabytes of download before being installed. These factors when combined have led Oracle and others to provide dockerfiles to create docker images that install and configure Oracle products into provided base images. The software to be installed must be provided separately from the dockerfiles. The created docker images can then stored in a company specific docker repository. These docker images can then be used in the same way as any other docker image. This is the approach that will be followed in this document.
We built on a headless and minimum rpm installed Oracle Linux 7 VM that has a download footprint of only 1GB. The instructions provided are applicable to other OL 7 and RHEL 7 environments. With minimal changes the same instructions should also apply to other Linux releases such as Ubuntu. The image is configured and set up with a docker environment.
The VM is used as our base platform to run docker.
Because of licensing restrictions we are unable to provide a VM for download. However if you are an Oracle employee then please contact us and we will point you at a downloadable image.
If you don’t use the provided image then the following is needed of an OL 7 image.
yum -y install yum-utils
yum-config-manager --enable ol7_addons
yum-config-manager --enable ol7_UEKR4
yum-config-manager --disable ol7_UEKR3_latest
yum install wget unzip net-tools
root@docker-base ~]# yum install btrfs-progs
root@docker-base ~]# mkfs.btrfs /dev/sdb
[root@docker-base ~]# blkid /dev/sdb
/dev/sdb: UUID="fe6bf7a2-34fc-4800-af2b-da19d2d8db6d" UUID_SUB="e955087d-80b5-4051-bb28-ed71edb9cea4" TYPE="btrfs"
Description = Docker Image Store
What = UUID=<Your UUID Value>
Where = /var/lib/docker
Type = btrfs
WantedBy = multi-user.target
[root@docker-base ~]# mkdir /var/lib/docker
[root@docker-base ~]# systemctl enable var-lib-docker.mount
[root@docker-base ~]# systemctl start var-lib-docker.mount
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
# SELINUXTYPE= can take one of three two values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
The above change requires to reboot the system
[root@docker-base ~]# systemctl reboot
[root@docker-base ~]# yum install docker-engine
[root@docker-base ~]# systemctl start docker
[root@docker-base ~]# systemctl enable docker
[root@docker-base ~]# systemctl status docker
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
└─docker-network.conf, docker-sysconfig.conf, http-proxy.conf, var-lib-docker-mount.conf
Active: active (running) since Sun 2017-01-08 12:16:38 PST; 52min ago
Main PID: 871 (dockerd)
├─ 871 dockerd --selinux-enabled
└─1020 docker-containerd -l unix:///var/run/docker/libcontainerd/docker-containerd.sock --shim docker-containerd-shim --metrics-interval=0...
[root@docker-base ~]# docker info
Server Version: 1.12.2
Storage Driver: btrfs
Build Version: Btrfs v3.19.1
Library Version: 101
Logging Driver: json-file
Cgroup Driver: cgroupfs
Network: null host bridge overlay
Default Runtime: runc
Security Options: seccomp
Kernel Version: 4.1.12-61.1.24.el7uek.x86_64
Operating System: Oracle Linux Server 7.3
Total Memory: 4.133 GiB
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
In this entry we have introduced the concept of using Docker Swarm 1.12 to create a Fusion Middleware Cluster. We have explained how to set up a minimal Linux machine to run a docker engine and prepared it to start building out a Fusion Middleware Cluster running on Swarm. In our next entry we will cover creating a database docker image that we will use in later entries to support Fusion Middleware. Later entries will explain how to install Fusion Middleware and create a cluster in swarm mode by defining swarm services for the database, WebLogic Admin Server and WebLogic managed servers.