Public | Automated Build

Last pushed: 2 years ago
Short Description
mod_cluster image: Apache HTTP Server and mod_cluster built from sources
Full Description

mod_cluster-dockerhub

mod_cluster toy dev image offering Apache HTTP Server and mod_cluster smart load balancer built from sources.
The Dockerfile comprises a smoke test that verifies whether the compiled server starts without segfaults.

Configuration

You can configure the mod_cluster parameters through following environment variables provided to docker run command:

  • MODCLUSTER_PORT listening port (default: 6666)
  • MODCLUSTER_ADVERTISE On/Off flag for ServerAdvertise (default: On)
  • MODCLUSTER_ADVERTISE_GROUP Advertise address and port (default: 224.0.1.105:23364)
  • MODCLUSTER_NET a Require ip value for the listener (default: 172.)
  • MODCLUSTER_MANAGER_NET a Require ip value for the mod_cluster manager on path /mcm (default: value of MODCLUSTER_NET variable)

The defaults could work in your Docker environment.

Example usage

Test run

docker pull karm/mod_cluster-master-dockerhub
docker run -d -P -i --name mod_cluster karm/mod_cluster-master-dockerhub
docker ps
+++ snip +++
curl 127.0.0.1:49157/mcm

To debug/inspect, one may use:

docker exec -i -t mod_cluster bash

Control configuration using environment variables

This example show how to run a container with host's network stack, disabled advertisement and moc_cluster-manager available only from localhost.

docker run -it --rm --net host --name mod_cluster \
    -e MODCLUSTER_ADVERTISE=Off \
    -e MODCLUSTER_NET=192.168. \
    -e MODCLUSTER_MANAGER_NET=127.0.0.1 \
    karm/mod_cluster-master-dockerhub
curl 127.0.0.1:6666/mcm

Use as a base image

One may base one's own images on this karm/mod_cluster-master-dockerhub as simply as with creating a Dockerfile:

FROM karm/mod_cluster-master-dockerhub:latest
MAINTAINER Your identity of choice <your email>

# Your own configuration located in the same directory as your Dockerfile
COPY mod_cluster.conf ${HTTPD_MC_BUILD_DIR}/conf/extra/mod_cluster.conf

# Your own entry point script located in the same directory as your Dockerfile
COPY docker-entrypoint.sh /

Note that HTTPD_MC_BUILD_DIR as well as other ENV constants are propagated to your Dockerfile.

Notes

  • 2015-08-31 - control run through environment variables
  • 2015-06-08 - master branch Docker image updated from Fedora 20 to Fedora 22. Enjoy!
  • 2015-05-07 - mod_cluster 1.3.1.Final released, Includes a fix for CVE-2015-0298 and more!
Docker Pull Command
Owner
karm
Source Repository

Comments (1)
digitraj81
a year ago

Hi Karm,

I am using mod_cluster in one UNIX machine and tomcat server in another unix machine.
Mod_cluster is registered by tomcat
Jun 23, 2016 8:38:56 AM org.jboss.modcluster.ModClusterService connectionEstablished
INFO: MODCLUSTER000012: Catalina connector will use /172.17.0.2

but when i am trying to connect application using load balancer i am getting

[Thu Jun 23 08:51:27.417396 2016] [:debug] [pid 1437:tid 140305676351232] mod_proxy_cluster.c(293): Created: worker for ajp://172.17.0.2:8009
[Thu Jun 23 08:51:27.417524 2016] [proxy:debug] [pid 1437:tid 140305676351232] proxy_util.c(1785): AH00924: worker ajp://172.17.0.2 shared already initialized
[Thu Jun 23 08:51:27.417613 2016] [proxy:debug] [pid 1437:tid 140305676351232] proxy_util.c(1832): AH00927: initializing worker ajp://172.17.0.2 local
[Thu Jun 23 08:51:27.417739 2016] [proxy:debug] [pid 1437:tid 140305676351232] proxy_util.c(1867): AH00930: initialized pool in child 1437 for (172.17.0.2) min=0 max=25 smax=25
[Thu Jun 23 08:51:27.417836 2016] [proxy:debug] [pid 1437:tid 140305676351232] proxy_util.c(1904): AH00932: ajp: worker for (172.17.0.2) has been marked for retry
[Thu Jun 23 08:51:27.417973 2016] [proxy:debug] [pid 1437:tid 140305676351232] proxy_util.c(2160): AH00942: ajp: has acquired connection for (172.17.0.2)
[Thu Jun 23 08:51:27.418051 2016] [proxy:debug] [pid 1437:tid 140305676351232] proxy_util.c(2213): [client 10.193.149.209:56591] AH00944: connecting ajp://172.17.0.2:0/ to 172.17.0.2:8009
[Thu Jun 23 08:51:27.418125 2016] [proxy:debug] [pid 1437:tid 140305676351232] proxy_util.c(2422): [client 10.193.149.209:56591] AH00947: connected / to 172.17.0.2:8009
[Thu Jun 23 08:51:27.418356 2016] [proxy:error] [pid 1437:tid 140305676351232] (111)Connection refused: AH00957: ajp: attempt to connect to 172.17.0.2:8009 (172.17.0.2) failed
[Thu Jun 23 08:51:27.418394 2016] [proxy:error] [pid 1437:tid 140305676351232] AH00959: ap_proxy_connect_backend disabling worker for (172.17.0.2) for 60s
[Thu Jun 23 08:51:27.418403 2016] [:debug] [pid 1437:tid 140305676351232] mod_proxy_cluster.c(1408): proxy_cluster_try_pingpong: can't connect to backend
[Thu Jun 23 08:51:27.418411 2016] [proxy:debug] [pid 1437:tid 140305676351232] proxy_util.c(2175): AH00943: ajp: has released connection for (172.17.0.2)
[Thu Jun 23 08:51:27.418424 2016] [:debug] [pid 1437:tid 140305676351232] mod_proxy_cluster.c(2438): proxy_cluster_isup: pingpong ajp://172.17.0.2:0/ failed