Docker Combat---Deploy Tomcat\weblogic cluster (ii)

Source: Internet
Author: User
Tags node server docker run

Install the Tomcat image ready-to-use JDK Tomcat and other software to launch a virtual machine under the home directory
Docker run-t-i-v/home:/opt/data--name mk_tomcat Ubuntu/bin/bash
This command mounts the local home directory to the/opt/data directory of the virtual machine, and if the virtual machine directory does not exist, it is automatically created with the basic configuration of Tomcat next, and the JDK environment variable is set so that the Tomcat program is placed in the/opt/ Apache-tomcat Edit the/etc/supervisor/conf.d/supervisor.conf file below to add the Tomcat entry

Quit! Use Docker commit ac6474aeb31d Tomcat new Tomcat folder, new Dockerfile
Docker build Tomcat Tomcat

Installing the WebLogic mirroring step is basically consistent with Tomcat, where the configuration file is affixed supervisor.conf
Dockerfile

Use of tomcat/weblogic images
1. Storage usage When Docker run is enabled, use the-v parameter
-V,--volume=[] Bind mount a volume (e.g. from the host:-v/host:/container, from Docker:-v/container)
Mapping the local disk to the inside of the virtual machine, it changes in real time between the host and the virtual machine container, so we update the program, upload the code only need to update the physical host's directory to be able, the data storage detailed use See my another post http://blog.csdn.net/ smallfish1983/article/details/38637839
2. Tomcat and WebLogic cluster implementation tomcat run-d-v-p 204:22-p 7003:8080-v/home/data:/opt/data--name tm1 tomcat/u as long as multiple containers are open Sr/bin/supervisord
Docker run-d-v-p 205:22-p 7004:8080-v/home/data:/opt/data--name tm2 Tomcat/usr/bin/supervisord
Docker run-d-v-p 206:22-p 7005:8080-v/home/data:/opt/data--name tm3 Tomcat/usr/bin/supervisord


Here's the WebLogic configuration. You know, WebLogic has a domain concept. If you want to deploy using a regular administrator +node, you'll need to write Supervisord in Administartor The advantages of the server and node server startup scripts are:
    • Can use WebLogic clustering, synchronization and other concepts
    • Deploy a clustered application that only needs to be installed once to the cluster
The disadvantages are:
    • Docker configuration is complicated.
    • There is no way to automatically expand the compute capacity of the cluster, if you want to add nodes, you need to create a node on administrator, then configure the Heart Container Supervisor startup script, and then start the container
Another way is to install all the programs on the Adminiserver, need to expand the time, to start multiple nodes, its advantages and disadvantages and the previous method is the opposite. (I'm currently using this approach to deploy development and test environments)
Docker run-d-v-p 204:22-p 7001:7001-v/home/data:/opt/data--name node1 Weblogic/usr/bin/supervisord
Docker run-d-v-p 205:22-p 7002:7001-v/home/data:/opt/data--name node2 Weblogic/usr/bin/supervisord
Docker run-d-v-p 206:22-p 7003:7001-v/home/data:/opt/data--name node3 Weblogic/usr/bin/supervisord

This allows the front end to use Nginx to do the load Balancer configuration is completed

Docker Combat---Deploy Tomcat\weblogic cluster (ii)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.