In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces how to use JMX to monitor the internal and external status of the application, the article is very detailed, has a certain reference value, interested friends must read it!
Java Management API (JMX) is required to manage WebLogic servers. With this API, you can search the application server for administrative beans (mbeans) and through them you can query both configuration information and runtime monitoring information. In addition, this API can also be used to change the configuration of the server. In fact, this API is already in use on the console and other management tools to do their work and provide reporting data.
This API is a powerful monitoring tool. Let's look at an example. In this application, there is most static content, some of your personalized JSP pages, a registration system, a data system based on JMS (Java Messaging Services,Java messaging Service), and a small payment application system. Where is it good for us to use JMX in this application? On static pages, you can access information for FileServlet and see how much time is spent serving static content. The time may be less than you might expect, because the browser automatically caches some of the content on the client side. Most requests for static content will be HEAD requests to check for changes. For dynamic pages, each servlet in the system is calculated separately. This data does not well reflect the user's experience (because there is a delay between the request they send and the return of the page), but it tells the average time spent on one request per servlet and how many requests have been completed. Our registration system is an entity bean, while the payment system is a stateless session bean returned by an external service. Both bean can be monitored, and this monitoring information can be used to help us optimize the size of the cache and pool. Our data can also help determine whether we have the information we need or how many users are using the data. Throughput can also be calculated using the attributes of topic of JMS and mbean of type queue. In addition, all JDBC connections can be monitored, and from their mbeans you can see how many connection pools are contended, for example, this will help you determine whether more database client authorization is needed.
The second use of mbeans in WebLogic servers is for configuration information. By configuring mbeans, the configuration of all resources is included in the runtime. These mbeans are essentially representations of the information contained in the config.xml file. All the contents of the application deployed on the server listening port are included in these interfaces. Most individual properties are directly related; however, the collection of properties that describe a deployment unit is complex and is grouped in the weblogic.Deployer class for convenience. It is possible to access them directly, but actions other than looking at the configuration and not changing it are not recommended. The rest of the properties are arbitrary, but be careful, but if a component (such as a JDBC pool) is redeployed or the server is restarted, most of these properties actually only change the behavior of the runtime. These configurable mbeans applications range from deciding to use resources for a particular application to adjusting feedback values based on monitoring mbeans.
As you can see, there's a lot of information-- but if you're not familiar with both JMS and WebLogic servers, how do you get started? It's actually not that difficult. As long as you can use JNDI and read JavaDocs, you will find it quite easy to manipulate mbeans. The code example you see below will show you how to get the mbean home interface of the local server and the JDBC pool.
MBeanHome home = (MBeanHome) new
InitialContext () lookup (MBeanHome.LOCAL_JNDI_NAME)
Set pools = home.getMBeansByType ("JDBCConnectionPool")
The above code shows the configuration mbean for the JDBC (Java DataBase Connectivity,Java database connection) pool. If you want to monitor connection pools regardless of their configuration, simply change the type of mbean by adding "Runtime". From this mbean you can determine important information, such as whether there is a connection leak-you can even get a stack trace to find the exact location of the connection.
What if you don't want to do any Java programming and use the JMX mbean system as if you were in a script file? Fortunately, we have a command-line tool that allows you to view and change mbean-weblogic.Admin directly from the command line. In addition to the PINGing server, getting the JNDI list, resetting the connection pool, and shutting down the server, it gives a hierarchical structure for accessing the mbean directly. You will see such a weblogic.Admin instruction in the following code example.
Java weblogic.Admin-username system-password [password]-url [url] GET
-pretty-type JDBCConnectionPool
This code gives an easy-to-read description of the mbeans compared to the type descriptor that adds attributes to the mbean. Similarly, there is a SET command that changes the properties of any mbean in the system.
The above is all the contents of the article "how to use JMX to monitor the status of applications both inside and outside". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.