[Docker] Testing Environment for clustered Wildfly using DNS (1)
As a engineer, making test environment is very annoying job because each case needs new environment. Moreover, the more annoying thing is that the environment is easily broken for other test, which means that I have to spend same time for same environment when I encount same issue. As aspect of this, Docker is the best for TEST. Docker quickly provide new pure test environment without much effort.
In this blog, I am going to set up basic test environment for clustered wildfly with dns and apache.
* Architecture
Detail information about docker images :
1) Centos 6.5
2) Wildfly 8.1.0.Final
3) Apache 2.2.15
3) Bind 9.8.2 (DNS)
There are 2 ways to set up this environment :
1) Using generated image files
2) Building image with Dockerfilec
In this blog, I will explain the first way because....it is easiser than second ^^;
*Using generated image files
Brief Flow :
Pull images from index repository(docker hub) -> Pull scripts&files from github -> Start DNS -> Start Apache ->Start Wildfly 1,2,3 |
0) Create directory
# mkdir /home/git |
1) Pull images from index repostitory (docker hub)
# docker pull ljhiyh/centos65:apache # docker pull ljhiyh/centos65:wildfly # docker pull ljhiyh/centos65:dns |
2) Pull scripts & files from github
# git clone https://github.com/Jooho/sample-docker.git |
3) Start DNS
# cd /home/git/sample-docker/dns # ./docker-start.sh |
4) Start Apache
# cd /home/git/sample-docker/httpd # ./docker-start.sh |
5) Start Wildfly
Master
# ./docker-start.sh -cmd=/bin/bash # su - # cd master # start.sh |
Slave1
# ./docker-start.sh -host=wildfly2 -ip=172.17.42.22 -cmd=/bin/bash # su - # cd slave # ./start.sh |
Slave2
# ./docker-start.sh -host=wildfly3 -ip=172.17.42.23 -cmd=/bin/bash # su - # cd slave # ./start.sh |
* Test
0) DNS
On wildfly1 vm:
bash-4.1# ping ws1.jhouse.org ...... |
1) Apache : mod_cluster manager
http://ws2.jhouse.org:6666/mod_cluster_manager
2) Wildfly : Admin console
http://wildfly1.jhouse.org:9990/
user : jboss password : !qaz2wsx