Tomcat management and monitoring tools

 

This link: https://blog.csdn.net/weixin_34364071/article/details/86753232
Focus on the field of high-quality Java technology number, please pay attention

Original: Hou Shucheng Tomcat that thing

Powerful features strongly recommend a Tomcat management monitoring tool

Start Tomcat is completed, some time will always open the browser http: // localhost: 8080 /

To verify whether your Tomcat starts successfully, see the ROOT application in the yellow three-legged cat, you can rest assured: no problem starting the service. If the request is unsuccessful, it must be where the problem is, this default was a result of abnormal start comes with the app does not start successfully. Further analysis to see the log.

In addition to the ROOT application, Tomcat Manager also provides default this application.

On Manager can function

1. Deployment

Application Management deployed (start and stop the application, re-deployment)

The deployment of war

By deploying context.xml form

Set Session expired

2. Diagnostic memory leaks, etc.

3. Display JVM memory information

4. Connector thread state

What else?

We see, Tomcat Manager provides this, and is more commonly used, but it is a limited number of basic functions.

Used such as Weblogic, WebSphere, friends and other open-source GlassFish J2EE application server will be found that compared with the Tomcat Manager, they both offer a more full-featured so-called " management console ."

The management console can do, it is richer than the above Manager offers more. For example, the most common one: 8080 This port is not enough, we want to add a port to respond to other requests, or when configuring ajp request processing, we would like to add a Connector, this time in the J2EE management console, add direct operation you can, step by step.

Even application deployment, you can select a pre-compiled JSP (JSP pre-compiler, speed up your application), create a data source and so on.

Connector for the creation of this operation, you need to how to do within Tomcat?

Open the server.xml, 8080 a copy of this configuration, change to change port, change change BIO / NIO processing restart Tomcat. Examples of when the need to restart (knock blackboard, where test sites oh), and a management console processing class. Essentially Connector as a component of the Container does not affect each other, in fact, no need to restart Tomcat can do, but this creation process Connector, we need programmatically, to Marshaller / Unmarshaller the contents of the configuration file. Direct Container operation content, but also can be achieved through JMX.

You say you deploy an application that is well equipped with what Servlet, which Listener? Web.xml there is no init-param, go have a look at it?

Sorry, you need to open the application to configure their own point of view.

Management Console ideas, the general will of the current application specific configuration information listed for easy management.

Of course, there are many differences ...

In fact, before Tomcat 6, so there is a product called "Tomcat Admin" application, application server management functionality comparable to the console, but later no longer provided. Alas.

Having said that, of course, we are not a Tomcat began to despise. After all, as a pure Web Container, and non-commercial products, it can be considered good.

In order to use with a better, more comprehensive functions Tomcat management tool, we can not provide official set our sights on a huge third party open source sea, buried their heads to find it?

The official wiki also in the way we mean:

PSI Probe is advanced manager and monitor web application for Apache Tomcat.

This is a Tomcat management and monitoring tools, formerly known as Lambda Probe. Since the Lambda Probe 2006 is no longer updated, so PSI Probe regarded its version of a Fork and has been updated since.

Very easy to use, download the corresponding github (https://github.com/psi-probe/psi-probe) war file deployment can be.

Time of the visit, and Manager, just as you use the configuration in the tomcat-users.xml users to access.

After you log looks like this:

Powerful features strongly recommend a Tomcat management monitoring tool

Through the above long list tab, you can feel than the Manager application functionality to be strong now. Even some of the features can be tied "management console" of experience.

Look at this piece of application deployment

Powerful features strongly recommend a Tomcat management monitoring tool

In addition to the deployment of this function, but also includes general features of J2EE application server contains " JSP pre-compiler " response to speed up the application. There are work options emptied.

See page directly log

Powerful features strongly recommend a Tomcat management monitoring tool

For the log file can be modified in real time the different log levels, to print the log.

Powerful features strongly recommend a Tomcat management monitoring tool

Connector current configuration may be listed, each request received, and the like Connector

Powerful features strongly recommend a Tomcat management monitoring tool

More features, download discover it! Have fun!

Behind the PSI is how to achieve functions?

Our previous article wrote, memory in a kind of "Tomcat in privileged applications " is a direct access to some of the internal components of the Tomcat, PSI is to set itself as a privileged applications, while for operations within Tomcat, PSI through the Wrapper forms for different versions of Tomcat create an Adapter

Powerful features strongly recommend a Tomcat management monitoring tool

Wrapper here is that we are familiar with Tomcat component of the Wrapper, PSI inherited the Spring of DispatherServlet, after the adoption of this Servlet Wrapper, and then get its parent component Context, Host, Engine.

/** * Main dispatcher servlet. Spring default dispatcher servlet had to be superseded to handle * "privileged" application context features. The actual requirement is to capture passed Wrapper * instance into ContainerWrapperBean. Wrapper instance is our gateway to Tomcat. */@WebServlet public class ProbeServlet extends DispatcherServlet implements ContainerServlet {

Sign up in the Servlet in the Spring of Initializer

// Set probe servletServletRegistration.Dynamic probe = servletContext.addServlet( "probe", ProbeServlet. class);

So to get these components, applications deployed in the operation, acquisition Connector and so, in fact, own Tomcat and the same.

So if you want to develop management tools, this is a realization of ideas.

One kind of JMX MBean through.

PSI is through this line of thinking.

 

Guess you like

Origin www.cnblogs.com/lcword/p/11787494.html