OpenCms Cluster Docker Image Is On Docker Hub Registry

OpenCms Cluster Docker Image Is On Docker Hub Registry

OpenCms Cluster Docker Image

In my first blog posts (Part 1 - Part V) and on this google drive page "OpenCms Docker Cloud" I was explaining about Docker, OpenCms and how to build an OpenCms All-In-One stack to easily install and run the latest OpenCms 9.0.1 version in a docker container and extend the installation to build a loadbalanced OpenCms environment.

In this blog post I'm going to show you how you can run our OpenCms Cluster Docker Image to build an (auto-) scalable OpenCms Cluster with Multi-Workplace and auto-scalability support everywhere, where docker rocks, on your laptop, on bare metal, in your private or your favorite public cloud.

The latest production ready version is based on OpenCms Cloud eXtensions (OCCX) implemented by my colleauge, business partner and mentor Stephan Hartmann (CEO at Metamesh) and consists of 2 docker images, the opencms-stack-mysql image and the opencms-stack-cluster image, which can be pulled from the Docker Hub Registry.

For more information about OpenCms Cloud eXtensions please see our OpenCms Elastic Cloud Cluster presentation from OpenCms Days 2013, where we are showing the basics and how to scale the whole thing on hybrid clouds (on Eucalyptus and Amazon Web Services) to build high trafic web sites at hyperscale with multi-workplace and multi-region support.

I assume you're familiar with Docker and you're already running the docker engine on your host, or in your Vagrant, VirtualBox, CoreOS, CentOS, Ubuntu or on your Atomic VM or host.

As mentioned above, first we need to pull our opencms-stack-cluster and opencms-stack-mysql images from docker hub registry on our host or VM with:

The above command will drop you into the opencms cluster container and you shall run the following sed command to change the hardcoded IP address of your VM or host where your MySQL container is running, in our case we are running both conatiners on the same host, but you can also run your MySQL container on any other host.

Use "ifconfig" to find the IP address of your host and run the following command to replace the hardcoded 10.0.0.16 MySQL IP address in opencms.properties file (replace <Your-DB-IP> with the IP of your docker VM / host):

Now that our first container is running, you shall commit this conatiner with the right IP address of your MySQL DB over your opencms-stack-cluster, to do that, open a new terminal, log into your VM and find the container ID of your running container with:

create a new file "hello_occx_world.txt" and switch back to the first workplace and do a reload, you might see the "hello_occx_world.txt" file there, funny? In fact, this is not possible with the standard and even with the closed sourced and obfuscated OpenCms Enterprise Enhancements modules!

Run a fleet of your OpenCms Docker Content Cloud!

If you'd like to run N containers, create a file "run-opencms-cluster" and paste the following lines into it:

and run N number of containers by sourcing the file "run-opencms-cluster" and list your containers:

To understand what is happening here, the Infinispan Data Grid Cache Platform distributes and synchronizes all changes between the cluster nodes, if one node fails, the other node becomes the coordinator, we don't have any master / slave design, all nodes are equal.

Beside the multi-workplace support, in the real live, you can place your servers in different regions, near to your users, to avoid high latency and scale your business by adding additional nodes on demand and porvide auto-scaling, which I'm going to show you in the next blog post using Fleet, Kubernetes and HOT Heat templates on OpenStack Icehouse, stay tuned.