没有合适的资源?快使用搜索试试~ 我知道了~
Manning - JMX in Action.pdf
需积分: 3 17 下载量 167 浏览量
2009-07-29
09:24:13
上传
评论
收藏 4MB PDF 举报
温馨提示
试读
312页
Manning - JMX in Action.pdf good for you
资源推荐
资源详情
资源评论
Copyright (c) 2003 Manning Publications Co. All rights reserved.
Copyright (c) 2003 Manning Publications Co. All rights reserved.
Chapter 1: Resource management
and JMX
Distributed applications, devices, and services appear in many different arrangements in an
enterprise. At your company, you probably access data from your intranet services, from
computers distributed throughout the company network, and from services across the firewall out
on the Web. For example, you might access a calendar-sharing application or a financial
application to fill out expense sheets. Someone must maintain all these applications. Not only the
applications, but also the hardware that supports them must be maintained. Resource management
encompasses both applications and hardware. In fact, both application and hardware management
can be supported through the development of Java Management Extensions (JMX) resource
management software. This book will show how you can use JMX to manage and monitor all
your resources across an enterprise—both software and hardware.
Whether you’re familiar with JMX already or have purchased this book to find out what JMX
is all about, you need to understand why JMX exists today. In this chapter, you will learn the
basis for JMX, the definitions of some common JMX terms, and the essentials of JMX
architecture. Throughout our discussion, we’ll use as an example a bicycle shop web application
on the Internet: people come to this site to purchase bicycles and gear, and to access articles and
content related to bicycling.
1.1 Resource management
Resource management is a management concept that provides a plan and tools for the
management of enterprise applications and resources. For typical enterprises, resource
management means having tools that report the health of enterprise applications and hardware.
Based on the health of resources, IT employees can react to system failures and critical events.
Improved resource monitoring and management capabilities across an enterprise provide the
IT employee with insight into the health of enterprise applications, as well as a way to resolve
problems when they occur; the IT employee thus moves from a purely reactionary mode to a
more active role. For instance, if you’re made aware of the fact that resources are performing
below par, you can help avoid a catastrophic failure. In addition, you’ll be able to tune the
applications or devices remotely from a single management console.
The current management environment in many enterprises lacks the quick responsiveness
needed for today’s enterprise applications. In addition, many application-monitoring and -
management solutions are costly and difficult to implement. In this section, we’ll compare the
typical environments in place today with our vision of the perfect environment. (The disparity
between the two may surprise you.) Then, we’ll look at what you can achieve in terms of typical
development resources, effort, and support.
1.1.1 Today’s management environment
Today’s management solutions can be divided into two categories: network and application. The
most common tool used for networking (hardware) management is Simple Network Management
Copyright (c) 2003 Manning Publications Co. All rights reserved.
Protocol (SNMP). For applications like web sites, most enterprise developers must either use the
management tools that come built-in with the application (and the web servers that drive the
application) or write their own tools. As mentioned earlier, resource management includes both
application and hardware aspects.
Hardware and network management
Most network monitoring and management systems today use an SNMP solution to provide
monitoring and management capabilities for hardware. SNMP is a monitoring standard that has
been in wide use for several years. For the example Internet bike shop, you would use SNMP to
monitor the health and activity of the servers running your web site and back-end applications.
Information about managed devices is stored in a Management Information Base (MIB). The
MIB is a hierarchical representation of information about devices. A managed device can be
located on a MIB tree using an object name or object identifier. An example name might be
iso.identified-organization.dod.internet.private.enterprise.myenterprise.myvariables.myProduct or
something similar. An object identifier is set of numbers that represents the textual name. (For
more information about MIBs, read the SNMP specifications at http://www.ietf.org.)
Fortunately, many hardware vendors provide MIB definitions and SNMP hooks into their
devices. However, due to the difficulty of SNMP development, few applications have hooks into
SNMP.
SNMP development is not an easy task, and most developers are not trained to tackle it.
Unfortunately, SNMP does not easily provide monitoring and management for applications like
your bicycle store. For everyday Java developers, working with SNMP is not a suitable option.
Application management
When they’re creating applications, software companies often do not think about runtime
configuration and management; so, at deployment time, there is usually a scramble to figure out
how to maintain the system and be informed of critical events. Some companies develop their
own tools for management or build management consoles directly into their products. For many
companies, application management comes from the platform that hosts their application: the web
or application server.
When the bicycle shop web site and application were developed, you had to consider the
health of not only your application, but also the application server, web server, and database (as
well as any other software systems). Without a standard and consistent management platform,
you might have to write specific code in order to expose application properties, health, and
statistics. In fact, the manner in which you manage your application will likely change if you
purchase a different monitoring solution.
In today’s typical management environment, IT personnel will always be in a reactionary
mode when maintaining applications. Hardware and application management solutions are often
developed ad hoc at deployment time. In fact, currently it is difficult to develop a generic,
reusable management and monitoring solution for applications.
1.1.2 The ideal management environment
An ideal management environment would have a proactive capability for dealing with problems.
A management system would constantly monitor the health of both devices and applications. If a
device was down, the management system could discover an alternative device, reroute services
to the alternate, and notify the administrator of the problem. For instance, if the bicycle shop’s
Copyright (c) 2003 Manning Publications Co. All rights reserved.
web site was down or started to experience too much load, the management system could change
some of the services the application provides, notify participating services to find an alternate
service provider, and notify the administrator that problems exist. The management system could
even start secondary web sites and services to take the load off the initial application.
Ideal management systems not only would be aware of the health of the applications, but also
would have knowledge of application internals. For example, the management solution could
quickly produce reports comparing successful and failed bicycle shop transactions. On the system
management level, the number of threads executing could be changed at runtime. The
management system would make informed decisions and take action based on information it
gathered from applications and devices.
Unfortunately, an ideal management system would take too much time and development
resources to achieve. In addition to writing the management tools, you might need to write
custom interfaces for your applications and network resources. Such an environment also would
require many resources and constant configuration to ensure that systems were maximized in
availability and performance. Therefore, rather than build a perfect management environment,
you must create something that’s better than what exists today but that is feasible to construct and
maintain.
1.1.3 Management for the real world
A feasible solution would blend the current management capabilities and the ideal environment.
By gathering and combining information about the health of network devices and applications,
better decisions can be made and proactive management can occur either automatically or by IT
personnel. Let’s walk through the example bicycle shop web application, which has been built
with management in mind.
A proposed management solution
Suppose you are running the online bicycle shop we’ve mentioned previously: customers can
purchase bicycles and bike gear from your web site. In order to ensure that the customer’s
shopping experience is not interrupted, you have installed a secondary server to take queries if the
first server fails. In this environment, web servers, application servers, a database, and networking
hardware provide your web site services. The following items represent the major monitoring and
management needs for such an application and its environment:
Monitoring the system health of platforms and hardware—You need to know the health of
your web and application servers, as well as the hardware that hosts them. The networking
hardware exposes SNMP interfaces that report its health and any faults that occur. Likewise,
the web server is instrumented to report errors and has a mechanism that allows you to query
its health. The database is instrumented so that its performance can be queried, along with its
health and possible faults.
Configuring resources at the application level—You probably want to be able to make direct
contact with your bicycle shop services for configuration and management. When you wrote
your bicycle shop application, you had the foresight to instrument it to give you the
information you need to actively manage the system with a management tool built
specifically for your environment. For instance, you can connect to your bicycle shop server
process and change the number of items displayed on one page of the catalog. Your
management application can also query the environment services. If you query the database
and determine that the load on the database is too great, you can reduce the number of active
Copyright (c) 2003 Manning Publications Co. All rights reserved.
connections available in a connection pool. You can also reduce the number of threads that
are available to service requests from the outside world. Upon further queries, these resources
can be readjusted as the load decreases on database resources.
Collecting application statistics—In addition to configuring your bicycle shop applications,
you will also want to gather important statistics on transactions, inquiries, and so forth over
time. For instance, you would like to see a comparison of the number of visits to the catalog
verses the number of purchases made from the site. You would also like to collect the number
of attempts to break into the system by hostile attackers. In fact, you properly instrumented
the application to push this information into the management system.
Debugging options—Don’t overlook the amount of information being stored for analysis.
Fortunately, you had the foresight to realize that you will want to be able to turn logging
verbosity up or down when you debug possible problems with the bicycle shop application.
By exposing management APIs, you allow yourself to turn on debugging and change the
logging output to the console so that you can observe the functions of the application without
having to shut it down to make changes.
Monitoring server performance—Your web application needs to be monitored for health and
overall load. If the load is too great on the first server, you want to be able to shift some load
to the backup server. To avoid cases of failure, you need to be notified about critical events
via a pager or email.
Providing this solution
The monitoring and management framework described in this section covers the major areas of
many of today’s application management needs. However, achieving such a framework can be
costly and difficult. In the end, application administrators could be left with many different
management consoles and interfaces to all the different services and hardware.
1.2 Providing a Java solution: Java Management
Extensions
In the previous section, we described a monitoring and management environment that covers the
needs of enterprise applications. However, we also noted that building such an environment is
difficult and can leave administrators with many different tools in which to manage the system.
As this book will show, using Java Management Extensions, you can build a management
environment that’s less expensive and more flexible, in a shorter amount of time. JMX is a new
framework added to the Java language; it can provide a management solution that covers the
standards described in the previous section. JMX allows you to encapsulate all your resources
(hardware or software) with Java objects and expose them in a distributed environment. In
addition, JMX provides a mechanism for easily mapping existing management protocols such as
SNMP into its own management structures.
Let’s look at the management areas identified in the previous section and how JMX can
address them:
Platform health—As previously mentioned, using JMX, you can wrap non-Java resources
and hardware interfaces with Java objects in order to fit them into a JMX management
system. Using Java wrappers, you can interface to your web and application servers and
剩余311页未读,继续阅读
资源评论
osolina33
- 粉丝: 0
- 资源: 7
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功