I. Overview 1. This series of articles mainly introduces the installation and configuration of tomcat clusters in Linux, including Linux, vsftpd, jdk, tomcat, apache, jkconnector and other related knowledge, it also includes common commands in Linux. As a java programmer, these technologies are our basic skills in Linux.
Based on the existing network structure, Server Load balancer provides a cheap and effective method to expand server bandwidth and increase throughput, enhance network data processing capabilities, and improve network flexibility and availability. Cluster mainly solves the following problems:
1. High Reliability: with the cluster management software, when the master server fails, the backup server can automatically take over the work of the master server and switch over in time to achieve uninterrupted services for users.
2. High-performance computing: it fully utilizes the resources of every computer in the cluster to implement parallel processing of complex operations. It is usually used in scientific computing, such as genetic analysis and chemical analysis.
3. Server Load balancer: distributes the load pressure to each computer in the cluster according to a certain algorithm to relieve the pressure on the master server and reduce the hardware and software requirements on the master server.
What is a cluster? A group of independent computer systems constitute a loosely coupled multi-processor system. They communicate with each other through a network. Applications can transmit messages through the network shared memory to implement distributed computers. What is Server Load balancer? Start with the cluster. A cluster is a group of computers connected together. From the outside, it is a system. Each node can be a computer composed of different operating systems or hardware. For example, a cluster that provides Web Services is a large Web server. However, cluster nodes can also provide services separately. 2, configure the environment Linux: Red Hat Enterprise Linux Server release 5JDK: java version 1.7.0 _ 21 Tomcat: apache-tomcat-7.0.22Apache: httpd-2.2.17.tar.gzJkconnector: jakarta-tomcat-connectors-1.2.15-src.tar.gz: google it yourself, pay attention to the Linux version. If none of them can be found, I advise you not to read this article. 3. in Linux, tomcat cluster principle the Tomcat server establishes a connection with the client program through the Connector component. The Connector component is responsible for receiving client requests and sending Tomcat server response results to the customer. By default, Tomcat configures two connectors in server. xml:
<! -- Define a non-ssl Coyote HTTP/1.1
Connector on port 8080 -->
<Connection port = "8080"
MaxThreads = "150"
MinSpareThreads = "25"
MaxSpareThreads = "75"
EnableLookups = "false"
RedirectPort = "8443"
AcceptCount = "100"
Debug = "0"
ConnectionTimeout = "20000"
DisableUploadTimeout = "true"/>
<! -- Define a Coyote/JK2 AJP 1.3
Connector on port 8009 -->
<Connection port = "8009"
EnableLookups = "false"
RedirectPort = "8443" debug = "0"
Protocol = "AJP/1.3" type = "codeph" text = "/codeph"/>
The first connector listens to port 8080 and establishes an HTTP connection. This connector is used to access the Web application of the Tomcat server through a browser.
The second connector listens to port 8009 and is responsible for establishing connections with other HTTP servers. This connector is used when Tomcat is integrated with other HTTP servers.
The Web Client can access JSP components on the Tomcat server in two ways.
Reflects two ways for Web customers to access JSP components on the Tomcat server
In the figure, Web Client 1 directly accesses the JSP component on the Tomcat server. The accessed URL is http: // localhost: 8080/index. jsp. Web Client 2 accesses JSP components on the Tomcat server through the HTTP server. Assume that the HTTP port used by the HTTP server is the default port 80, then the URL accessed by Web Client 2 is http: // localhost: 80/index. jsp or http: // localhost/index. jsp.
Next, we will introduce how Tomcat communicates with the HTTP server.
Tomcat provides a dedicated JK plug-in to communicate with the HTTP server. The JK plug-in should be placed on the HTTP server of the other party. When the HTTP server receives a user request, it uses the JK plug-in to filter the URL. The JK plug-in determines whether to forward the customer request to the Tomcat server based on the pre-configured URL ing information.
Assume that all "/*. jsp URLs are all processed by the Tomcat server. In the example in Figure 22-1, the JK plug-in forwards the request to the Tomcat server, and the Tomcat server runs the index. jsp, then send the response result to the HTTP server, and then the HTTP server sends the response result to Web Client 2.
Tomcat provides different JK plug-ins for different HTTP servers. This chapter uses the following JK plug-ins:
Integration with Apache HTTP Server in Windows: mod_jk_2.0.46.dll
Integration with Apache HTTP Server under Linux (RedHat): mod_jk.so-ap2.0.46-rh72 .. 46-rh72 integration with IIS server: isapi_redirect.dll here we mainly introduce inheritance with RedHat 4. installation and configuration steps (1) install linux and putty (2) install vsftpd and LeapFTP, perform related configuration (3) jdk installation and configuration (4) tomcat installation and configuration (5) Apache installation and configuration (if GCC is not installed on Linux, install GCC first) (6) jkconnector installation and configuration (7) integrated configuration 5. References (1) Online, Ladies and Gentlemen (2) "laruence's Linux private house dish ......