Home United States USA — software Using Docker Swarm (Legacy) with Oracle – Developer.com

Using Docker Swarm (Legacy) with Oracle – Developer.com

379
0
SHARE

Create a Docker Swarm cluster of three nodes, and then subsequently run Oracle Database on the cluster.
Docker Swarm (legacy standalone version) is a clustering software for Docker, using which a cluster (or pool) of Docker hosts may be represented as a single host interface to external clients. Docker Swarm is integrated with Docker Engine 1.12, but Docker 1.12 has issues with some of the other software that makes use of Docker Engine, such as Docker Compose not being supported in the Docker 1.12 Swarm mode, Kubernetes 1.2 and 1.3 not being supported with Docker 1.12, and OpenShift Origin having some issues with Docker 1.12. Although the Docker 1.12 integrated Swarm mode is preferred, Docker Swarm legacy standalone may still be used to avoid the aforementioned issues.
With Docker Swarm, a cluster of Docker hosts is exposed as a single “virtual” host. Docker Swarm provides distributed Docker. Swarm may be installed by using one of the two available mechanisms: Docker image for Swarm or Swarm executable binaries. Using the Docker image is the recommended method and has benefits such as not requiring installing the Swarm binaries, a single Docker run command for installing Swarm, and an isolated Docker container running Swarm without the need to set environment variables. Docker Swarm has the following components:
The Swarm manager manages the nodes in the Swarm cluster and provides a single interface or virtual host for the Swarm cluster to external clients. In this tutorial, we shall create a Docker Swarm cluster of three nodes and subsequently run Oracle Database on the cluster.
We have used Ubuntu instances created from AMI Ubuntu Server 14.04 LTS (HVM), SSD Volume Type – ami-fce3c696. We have created four Amazon EC2 instances; one for the Swarm master and the Swarm manager, which also is the Docker client machine, and three for the three nodes in the Swarm cluster. Add the “default” security group to each of the Ubuntu instances; the default security group allows all inbound/outbound traffic on an Amazon EC2 host. The following software is required for this tutorial:
Obtain the Public IP Address of each of the Amazon EC2 instances and SSH Login to each of the Ubuntu instances. For example, the following command logs in to the Ubuntu instance with Public IP 54.174.46.34, which we have used as the Swarm master node.
Install Docker on each Ubuntu host. Start Docker and verify status on each Ubuntu instance with the following commands:
Similarly, log in to the other Ubuntu instances and install Docker.
The four Ubuntu instances are shown in an Amazon EC2 panel.
Figure 1: Four Ubuntu instances, shown in an Amazon EC2 panel
Create a Docker Swarm cluster using the Docker image “swarm” with the following command on the Swarm master node. First, log in to the node if not already logged in.
A Swarm cluster gets created and a Cluster ID gets output. Copy the Cluster ID; we shall need it when configuring the individual nodes in the cluster.
Figure 2: Creating a Swarm cluster
Swarm cluster exposes port 2375.
A Docker Swarm manager manages the Swarm cluster. Install the Swarm manager on any of the nodes in the cluster. We have installed the Swarm manager on the Swarm master node, which is the machine on which we installed Swarm using the Docker image. The command to start the Swarm manager has the following syntax:
The swarm_port may be set to any available port. We have used port 2376. The is the ID generated with the previous command to create a Swarm cluster. Using swarm port 2376 and the cluster ID for the Swarm cluster, run the following command to start the Swarm manager.
Swarm manager gets started and listens for HTTP on address :2375.
Figure 3: Swarm manager listening for HTTP
In this section, we shall start a Swarm agent on each of the three nodes to join the nodes with the Swarm cluster.

Continue reading...