Health amp;Safety 写入dump文件失败 失败是什么原因

trackbacks-0
导出要用到MySQL的mysqldump工具,基本用法是:&&&
shell&&mysqldump&[OPTIONS]&database&[tables]&&&
如果你不给定任何表,整个数据库将被导出。&&&
通过执行mysqldump&--help,你能得到你mysqldump的版本支持的选项表。&&&
注意,如果你运行mysqldump没有--quick或--opt选项,mysqldump将在导出结果前装载整个结果集到内存中,如果你正在导出一个大的数据库,这将可能是一个问题。&&&
mysqldump支持下列选项:&&&
--add-locks&&&在每个表导出之前增加LOCK&TABLES并且之后UNLOCK&TABLE。(为了使得更快地插入到MySQL)。&&&--add-drop-table&&&在每个create语句之前增加一个drop&table。&&&--allow-keywords&&&允许创建是关键词的列名字。这由表名前缀于每个列名做到。&&&-c,&--complete-insert&&&使用完整的insert语句(用列名字)。&&&-C,&--compress&&&如果客户和服务器均支持压缩,压缩两者间所有的信息。&&&--delayed&&&用INSERT&DELAYED命令插入行。&&&-e,&--extended-insert&&&使用全新多行INSERT语法。(给出更紧缩并且更快的插入语句)&&&-#,&--debug[=option_string]&&&跟踪程序的使用(为了调试)。&&&--help&&&显示一条帮助消息并且退出。&&&--fields-terminated-by=...&&& &&&--fields-enclosed-by=...&&& &&&--fields-optionally-enclosed-by=...&&& &&&--fields-escaped-by=...&&& &&&--fields-terminated-by=...&&&这些选择与-T选择一起使用,并且有相应的LOAD&DATA&INFILE子句相同的含义。&&&LOAD&DATA&INFILE语法。&&&-F,&--flush-logs&&&在开始导出前,洗掉在MySQL服务器中的日志文件。&&&-f,&--force,&&&即使我们在一个表导出期间得到一个SQL错误,继续。&&&-h,&--host=..&&&从命名的主机上的MySQL服务器导出数据。缺省主机是localhost。&&&-l,&--lock-tables.&&&为开始导出锁定所有表。&&&-t,&--no-create-info&&&不写入表创建信息(CREATE&TABLE语句)&&&-d,&--no-data&&&不写入表的任何行信息。如果你只想得到一个表的结构的导出,这是很有用的!&&&--opt&&&同--quick&--add-drop-table&--add-locks&--extended-insert&--lock-tables。&&&应该给你为读入一个MySQL服务器的尽可能最快的导出。&&&-pyour_pass,&--password[=your_pass]&&&与服务器连接时使用的口令。如果你不指定“=your_pass”部分,mysqldump需要来自终端的口令。&&&-P&port_num,&--port=port_num&&&与一台主机连接时使用的TCP/IP端口号。(这用于连接到localhost以外的主机,因为它使用&Unix套接字。)&&&-q,&--quick&&&不缓冲查询,直接导出至stdout;使用mysql_use_result()做它。&&&-S&/path/to/socket,&--socket=/path/to/socket&&&与localhost连接时(它是缺省主机)使用的套接字文件。&&&-T,&--tab=path-to-some-directory&&&对于每个给定的表,创建一个table_name.sql文件,它包含SQL&CREATE&命令,和一个table_name.txt文件,它包含数据。&注意:这只有在mysqldump运行在mysqld守护进程运行的同一台机器上的时候才工作。.txt文件的格式根据--fields-xxx和--lines--xxx选项来定。&&&-u&user_name,&--user=user_name&&&与服务器连接时,MySQL使用的用户名。缺省值是你的Unix登录名。&&&-O&var=option,&--set-variable&var=option设置一个变量的值。可能的变量被列在下面。&&&-v,&--verbose&&&冗长模式。打印出程序所做的更多的信息。&&&-V,&--version&&&打印版本信息并且退出。&&&-w,&--where='where-condition'&&&只导出被选择了的记录;注意引号是强制的!&&&"--where=user='jimf'"&"-wuserid&1"&"-wuserid&1"&&
最常见的mysqldump使用可能制作整个数据库的一个备份:&&
mysqldump&--opt&database&&&backup-file.sql&&&
但是它对用来自于一个数据库的信息充实另外一个MySQL数据库也是有用的:&&&
mysqldump&--opt&database&|&mysql&--host=remote-host&-C&database&&&
由于mysqldump导出的是完整的SQL语句,所以用mysql客户程序很容易就能把数据导入了:&&&
shell&&mysqladmin&create&target_db_name&&&shell&&mysql&target_db_name&&&backup-file.sql&&就是&&shell&&mysql&库名&&&文件名&
================================几个常用用例:
1.导出整个数据库&mysqldump&-u&用户名&-p&数据库名&&&导出的文件名&&&&&mysqldump&-u&wcnc&-p&smgp_apps_wcnc&&&wcnc.sql2.导出一个表&mysqldump&-u&用户名&-p&数据库名&表名&&导出的文件名&mysqldump&-u&wcnc&-p&smgp_apps_wcnc&users&&wcnc_users.sql3.导出一个数据库结构&&mysqldump&-u&wcnc&-p&-d&--add-drop-table&smgp_apps_wcnc&&d:\wcnc_db.sql
&-d&没有数据&--add-drop-table&在每个create语句之前增加一个drop&table&
4.导入数据库&&常用source&命令&&进入mysql数据库控制台,&&如mysql&-u&root&-p&&&&&mysql&use&数据库
&&然后使用source命令,后面参数为脚本文件(如这里用到的.sql)&&mysql&source&d:\wcnc_db.sql
阅读(227994)
&re: MySQL的mysqldump工具的基本用法[未登录]
mysql使用source命令导入数据库编码问题
mysql&use 数据库名称(与你的网站数据库名相同)
set names utf8; (先确认编码 注意不是UTF-8)
source D:\123.sql
(要导入的数据库名称)
&re: MySQL的mysqldump工具的基本用法[未登录]
根据参数值书写mysqldump命令,如: E:\eis&mysqldump -uroot -p eis_db goodclassification -e --max_allowed_packet=1048576 --net_buffer_length=16384 &good3.sql之前2小时才能导入的sql现在几十秒就可以完成了。&&&&&&
&re: MySQL的mysqldump工具的基本用法[未登录]
天啊!!!作者是什么程序员啊!!!思路太不严谨了吧!!!&&&&&&
&re: MySQL的mysqldump工具的基本用法
mysqldump -u 用户名 -p 数据库名 & 导出的文件名不生效&&&&&&
&re: MySQL的mysqldump工具的基本用法
来看看 有用&&&&&&
&re: MySQL的mysqldump工具的基本用法
@凌琦这中命令在linux主机下可行的,在win下是不行的啊&&&&&&
&re: MySQL的mysqldump工具的基本用法[未登录]
@凌琦mysqldump -uusername -ppassword dataname&name.sql&&&&&&
&re: MySQL的mysqldump工具的基本用法
@lingcarzy在mysql的安装目录下&&&&&&
&re: MySQL的mysqldump工具的基本用法
@lingcarzy可以用额,我就在win&&&&&&
&re: MySQL的mysqldump工具的基本用法
@lennowhat happen~~&&&&&&
&re: MySQL的mysqldump工具的基本用法[未登录]
mysqldump&&&&&&
dfgdfgdfg&&&&&&
29303112345791112131415161718192122232425262728303112345678
留言簿(30)
随笔分类(179)
文章分类(39)
积分与排名
阅读排行榜
评论排行榜高频词,一定要记得哦!
n. 垃圾场;转储数据库v. 倾倒;倾卸;丢弃;摒弃;倾销,抛售;转储
The area was used as a dump.
这一区域被用做垃圾场。
toxic waste discovered on a council dump
市政垃圾场中发现的有毒垃圾
Sheets of tin lay rusting on a dump.
一张张锡板在垃圾堆上生锈。
It's a real dump!
这地方太脏了!
We worked in a dump of an office.
我们在又脏又乱的办公室里工作。
The ammunition dump was hit by a shell.
军火库被炮弹击中了。
搭配:[+ of snow]
There hasn't been a fresh dump of snow for a couple of days.
已经好多天没有下雪了。
She dumped her bag on the table.
她把包往桌子上一丢。
He got my haversack from the cab and dumped it at my feet.
他从出租车里拿出我的帆布背包,往我脚下一丢。
搭配:[+ objects, substance, container, bucket]
Helicopters dumped sand on the dikes to strengthen them.
直升机将沙子倾倒在堤坝上对其进行加固。
Firefighters continue to dump buckets of water on the flames.
消防队员继续将一桶桶水倒在火焰上。
We dumped our stuff at the hotel.
我们把自己的东西丢在旅馆里。
He can't cope and dumps his two teenage boys on them to be looked after.
他应付不过来,只能将他那两个十多岁的儿子交给他们代为照看。
搭配:[+ rubbish, old furniture, car, sewage]
the yellow bucket where we dumped used needles
那只我们用来丢弃废旧针头的黄桶
The getaway car was dumped on the motorway.
逃亡用的车被丢弃在高速公路上。
environmental issues, such as dumping toxic waste
诸如倾倒有毒废弃物之类的环境问题
搭配:[+ idea, policy]
Ministers believed it was vital to dump the poll tax before the election.
部长们认为在选举前废除人头税至关重要。
I suggested that we dump the two companies.
我建议我们放弃这两家公司。
搭配:[+ boyfriend, girlfriend]
He's just dumped his girlfriend.
他刚甩了他的女朋友。
He was dumped by his long-term lover after five years.
五年后他被相恋多年的恋人抛弃了。
The data is dumped into the main computer.
数据转储到主机里了。
搭配:[+ goods]
Companies dump their products, sell them below realistic market prices, in order to grab a bigger market share.
这些公司以低于实际市场的价格倾销商品,以夺得更大的市场份额。
搭配:[+ stocks, shares]
rumours that a major shareholder plans to dump stock on to the market
一位大股东计划向股市抛售股票的谣言
搭配:[wave +]搭配:[+ swimmer]
She was hit by a large wave and dumped while body-boarding in the surf.
她在用卧式冲浪板冲浪时被一道巨浪撞上并扑倒。
搭配:[+ bales of wool]
1.a coarse term for defecation
he took a shit
2.a piece of land where waste materials are dumped
3.(computer science) a copy of the contents of a com sometimes used in debugging programs
4.a place where supplies can be stored
an ammunition dump
1.throw away as refuse
No dumping in these woods!
2.sever all ties with, usually unceremoniously or irresponsibly
The company dumped him after many years of service
She dumped her boyfriend when she fell in love with a rich man
3.sell at artificially low prices
4.drop (stuff) in a heap or mass
The truck dumped the garbage in the street
5.fall abruptly
It plunged to the bottom of the well
6.knock down with force
He decked his opponent
只有登录后,才能查看此项,现在是否?
1.This furniture is about ready for the dump.
这家俱破烂不堪快要送垃圾场了。
2.The walled garden was used as a dump.
带围墙的花园被用作了垃圾场。
3.How can you live in this dump?
你怎么住在这个破地方?
4.There is a dump behind the house.
房子后面有一个垃圾场。
5.Don't dump that sand in the middle of the path.
不要把沙石乱倒在走道中央。
1.&to take a dump
2.& to dump waste
好文推荐:Health Checking
/ &Resin Documentation&&&&&&&&health checking
Resin Professional includes a powerful and configurable system for monitoring
application server health. The system is intentionally similar to the
Resin's &URL Rewrite& rules, based on a configurable set of checks, conditions,
and actions. The health checking system runs internal to Resin on a periodic
basis. Checks are generally always performed on the local Resin node, and if
actions are to be taken, they are performed against the local Resin node as
Configuration
Health configuration is an extension of the standard Resin configuration
file resin.xml.
Because Resin uses
to create and update Java
objects, each XML tag exactly matches either a Java class or a Java property.
As a result, the
JavaDoc and the JavaDoc of the various ,
to supplement the documentation as much as this reference.
health.xml
Resin version 4.0.16 and later includes health.xml as a standard
Resin configuration file alongside resin.xml and
app-default.xml.
health.xml is imported into resin.xml as a
child of &cluster& or &cluster-default&.
Example: importing health.xml into resin.xml
&resin xmlns=&/ns/resin&
xmlns:resin=&urn:java:com.caucho.resin&&
&cluster-default&
- Admin services
&resin:DeployService/&
&resin:if test=&${resin.professional}&&
&resin:AdminServices/&
&/resin:if&
- Configuration for the health monitoring system
&resin:if test=&${resin.professional}&&
&resin:import path=&${__DIR__}/health.xml& optional=&true&/&
&/resin:if&
&/cluster-default&
Example: simple health.xml
&cluster xmlns=&/ns/resin&
xmlns:resin=&urn:java:com.caucho.resin&
xmlns:health=&urn:java:com.caucho.health&
xmlns:ee=&urn:java:ee&&
&health:Restart&
&health:IfHealthFatal/&
&/health:Restart&
&/cluster&
health: namespace
health.xml introduces a new XML namespace, health:,
defined by xmlns:health=&urn:java:com.caucho.health&.
health: separates health objects from standard resin:
elements for clarity and performance.
The packages references by
health: are:
Health check naming
ee: namespace
The ee: namespace is used for naming objects, for example
ee:Named=&someName&, so that they may be referred to
by name later in the configuration. This is sometimes necessary as some health
conditions permit referencing a specific health check, as
demonstrated in the following example.
Example: referencing named objects
&cluster xmlns=&/ns/resin&
xmlns:resin=&urn:java:com.caucho.resin&
xmlns:health=&urn:java:com.caucho.health&
xmlns:ee=&urn:java:ee&&
&health:HttpStatusHealthCheck ee:Named=&pingJspCheck&&
&url&http://localhost:8080/test-ping.jsp&/url&
&/health:HttpStatusHealthCheck&
&health:Restart&
&health:IfHealthCritical healthCheck=&${pingJspCheck}&/&
&health:IfRechecked/&
&/health:Restart&
&/cluster&
In this example, an instance of HttpStatusHealthCheck is named
'pingJspCheck' and referred
to by name in the IfHealthCritical criteria using an EL expression.
Restart action will only trigger if the health status is CRITICAL
for this specific health check and no others.
Default names
All health checks classes are annotated with @Named, and
therefore have a default name that corresponds to their bean name.
For example
&health:CpuHealthCheck/& can be referred to by
${cpuHealthCheck} without the use of ee:Named.
Example: default health check name
&cluster xmlns=&/ns/resin&
xmlns:resin=&urn:java:com.caucho.resin&
xmlns:health=&urn:java:com.caucho.health&
xmlns:ee=&urn:java:ee&&
&health:CpuHealthCheck&
&warning-threshold&95&/warning-threshold&
&/health:CpuHealthCheck&
&health:DumpThreads&
&health:IfHealthWarning healthCheck=&${cpuHealthCheck}&/&
&/health:DumpThreads&
&/cluster&
Duplicate names
Duplicate health check names are not permitted.
Resin will fail to
startup due to invalid configuration in this case.
This can be caused by
configuring duplicate checks without using ee:Named, or
by configuring more than one check with the same name.
The following examples
demonstrate both illegal cases.
Example: illegal unnamed duplicate checks
&cluster xmlns=&/ns/resin&
xmlns:resin=&urn:java:com.caucho.resin&
xmlns:health=&urn:java:com.caucho.health&
xmlns:ee=&urn:java:ee&&
&health:HttpStatusHealthCheck&&
&url&http://localhost:8080/test1.jsp&/url&
&/health:HttpStatusHealthCheck&
&health:HttpStatusHealthCheck&&
&url&http://localhost:8080/test2.jsp&/url&
&/health:HttpStatusHealthCheck&
&/cluster&
In the preceding example, use of ee:Named is required.
Example: illegal duplicate names
&cluster xmlns=&/ns/resin&
xmlns:resin=&urn:java:com.caucho.resin&
xmlns:health=&urn:java:com.caucho.health&
xmlns:ee=&urn:java:ee&&
&health:HttpStatusHealthCheck& ee:Named=&healthCheck&&
&url&http://localhost:8080/test1.jsp&/url&
&/health:HttpStatusHealthCheck&
&health:CpuHealthCheck ee:Named=&healthCheck&&
&warning-threshold&95&/warning-threshold&
&/health:CpuHealthCheck&
&/cluster&
In the preceding example, the health check names must be different, regardless
of the type of check.
Default health configuration
If for any reason you are missing health.xml, for example you are upgrading from an
older version of Resin and don't have the health.xml import in resin.xml,
there's no need to worry.
Resin creates some checks by default regardless of
the presence of health.xml.
Furthermore, Resin will detect if no checks are
configured and setup default actions and conditions.
Standard health checks
The following health checks are considered critical to standard operation
and thus will be created by Resin regardless of the presence of
health.xml.
If you wish to disabled any of these standard health checks,
configure the check in health.xml and set the attribute
enabled=&false&.
Default actions
are configured besides the
standard checks mentioned above, Resin will assume the user is using health.xml
and will not setup any .
however health.xml is missing or empty, the following basic actions will be
&health:Restart&
&health:IfHealthFatal/&
&/health:Restart&
&health:HealthSystem&child of javadoc
Configures overall health checking frequency and recheck rules.
element is present in health.xml for clarity, but is not strictly required
since it will be created upon startup with default values.&health:HealthSystem& AttributesATTRIBUTEDESCRIPTIONTYPEDEFAULTenabledAll health checking enabled or disabledbooleantruestartup-delayThe time after startup before actions are triggered (checks still execute).15mperiodThe time between checks5mrecheck-periodThe time between rechecks30srecheck-maxThe number of rechecks before returning to the normal checking periodint10
Example: &health:HealthSystem& in health.xml
&cluster xmlns=&/ns/resin&
xmlns:resin=&urn:java:com.caucho.resin&
xmlns:health=&urn:java:com.caucho.health&
xmlns:ee=&urn:java:ee&&
&health:HealthSystem&
&enabled&true&/enabled&
&startup-delay&15m&/startup-delay&
&period&5m&/period&
&recheck-period&30s&/recheck-period&
&recheck-max&10&/recheck-max&
&/health:HealthSystem&
&/cluster&
Health checks
Health checks are status monitors which are executed on a periodic basis
by the health system to determine an individual health status.
Health checks
are d repeatedly evaluating the same data.
health system determines an overall Resin health status by aggregating the
results of all the configured health checks.
Health status
Every time a health check executes it produces a
following is a list of all health statuses and their generally implied
meaning.HealthStatusNAMEORDINAL VALUEDESCRIPTIONUNKNOWN0Health check has not yet executed or failed status is inconclusive.OK1Health check reported healthy status.
This does not imply recovery.WARNING2Health check reported warning threshold reached or critical is possible.CRITICAL3Health check repo action should be taken.FATAL4Health
restart expected.
The descriptions above should be understood to be entirely dependent on
health action and predicate configuration.
For example, a FATAL status does
not imply a restart will occur unless health:Restart is configured
with the health:IfHealthFatal predicate, as it is in the default
health.xml.
System checks
System checks are health checks that can only exist once per JVM due to
the nature of the data they sample.
Most system checks are
pre-configured in the default health.xml.
Note: System checks are singletons.
Configuring duplicate system checks
with different names will not result in the creation of duplicate system
The following is technically valid configuration, but results in
configuring the same system check twice.
Example: duplicate system checks
&cluster xmlns=&/ns/resin&
xmlns:resin=&urn:java:com.caucho.resin&
xmlns:health=&urn:java:com.caucho.health&
xmlns:ee=&urn:java:ee&&
&health:CpuHealthCheck ee:Named=&cpuCheck1&&
&warning-threshold&95&/warning-threshold&
&/health:CpuHealthCheck&
&health:CpuHealthCheck ee:Named=&cpuCheck2&&
&warning-threshold&99&/warning-threshold&
&/health:CpuHealthCheck&
&/cluster&
In this example, warning-threshold will be set to 95 and then
overrided to 99.
&health:ConnectionPoolHealthCheck&child of javadoc
Monitors the health of Resin database connection pools.
for additional information.&health:ConnectionPoolHealthCheck& AttributesATTRIBUTEDESCRIPTIONTYPEDEFAULTenabledCheck is enabled or disabledbooleantrue&health:ConnectionPoolHealthCheck& ConditionsHEALTHSTATUSCONDITIONWARNINGUpon exceeding .CRITICALUpon exceeding .
Example: &health:ConnectionPoolHealthCheck& in health.xml
&cluster xmlns=&/ns/resin&
xmlns:resin=&urn:java:com.caucho.resin&
xmlns:health=&urn:java:com.caucho.health&
xmlns:ee=&urn:java:ee&&
&health:ConnectionPoolHealthCheck/&
&/cluster&
&health:CpuHealthCheck&child of javadoc
Monitors CPU usage.
On multi-core machines, each CPU is checked
individually.&health:CpuHealthCheck& AttributesATTRIBUTEDESCRIPTIONTYPEDEFAULTenabledCheck is enabled or disabledbooleantruewarning-thresholdCPU usage warning thresholdint (percentage 0-100)95critical-thresholdCPU usage critical thresholdint (percentage 0-100)200 (disabled)&health:CpuHealthCheck& ConditionsHEALTHSTATUSCONDITIONWARNINGUpon exceeding warning-threshold on any CPU.CRITICALUpon exceeding critical-threshold on any CPU.
Example: &health:CpuHealthCheck& in health.xml
&cluster xmlns=&/ns/resin&
xmlns:resin=&urn:java:com.caucho.resin&
xmlns:health=&urn:java:com.caucho.health&
xmlns:ee=&urn:java:ee&&
&health:CpuHealthCheck&
&warning-threshold&95&/warning-threshold&
&critical-threshold&99&/critical-threshold&
&/health:CpuHealthCheck&
&/cluster&
&health:HealthSystemHealthCheck&child of javadoc
Monitors the health system itself by using a separate thread to detect if
health checking is frozen or taking too long.&health:HealthSystemHealthCheck& AttributesATTRIBUTEDESCRIPTIONTYPEDEFAULTenabledCheck is enabled or disabledbooleantruethread-check-periodThe polling frequency of the independent thread.1mfreeze-timeoutThe max time for no health checks to occur to declare the health system frozen15m&health:HealthSystemHealthCheck& ConditionsHEALTHSTATUSCONDITIONFATALIf health checking has not occurred within freeze-timeout.FATALIf health checking has not completed within an acceptable time,
calculated using startup-delay, period, and
recheck-period.
Example: &health:HealthSystemHealthCheck& in health.xml
&cluster xmlns=&/ns/resin&
xmlns:resin=&urn:java:com.caucho.resin&
xmlns:health=&urn:java:com.caucho.health&
xmlns:ee=&urn:java:ee&&
&health:HealthSystemHealthCheck&
&thread-check-period&1m&/thread-check-period&
&freeze-timeout&15m&/freeze-timeout&
&/health:HealthSystemHealthCheck&
&/cluster&
&health:HeartbeatHealthCheck&child of javadoc
Monitors for heartbeats from other members of the cluster.&health:HeartbeatHealthCheck& AttributesATTRIBUTEDESCRIPTIONTYPEDEFAULTenabledCheck is enabled or disabledbooleantrue&health:HeartbeatHealthCheck& ConditionsHEALTHSTATUSCONDITIONWARNINGIf no heartbeat has been received from a know member of the cluster.WARNINGIf a heartbeat has not been received in the last 180 seconds from a known member of the cluster.
Example: &health:HeartbeatHealthCheck& in health.xml
&cluster xmlns=&/ns/resin&
xmlns:resin=&urn:java:com.caucho.resin&
xmlns:health=&urn:java:com.caucho.health&
xmlns:ee=&urn:java:ee&&
&health:HeartbeatHealthCheck/&
&/cluster&
&health:JvmDeadlockHealthCheck&child of javadoc
Monitors for deadlocked threads, as determined by the JVM.&health:JvmDeadlockHealthCheck& AttributesATTRIBUTEDESCRIPTIONTYPEDEFAULTenabledCheck is enabled or disabledbooleantrue&health:JvmDeadlockHealthCheck& ConditionsHEALTHSTATUSCONDITIONFATALIf deadlocked threads are detected.
Example: &health:JvmDeadlockHealthCheck& in health.xml
&cluster xmlns=&/ns/resin&
xmlns:resin=&urn:java:com.caucho.resin&
xmlns:health=&urn:java:com.caucho.health&
xmlns:ee=&urn:java:ee&&
&health:JvmDeadlockHealthCheck/&
&/cluster&
&health:LicenseHealthCheck&child of javadoc
Checks for expiring Resin Pro license.&health:LicenseHealthCheck& AttributesATTRIBUTEDESCRIPTIONTYPEDEFAULTenabledCheck is enabled or disabledbooleantruewarning-periodLicense check warning period30D&health:LicenseHealthCheck& ConditionsHEALTHSTATUSCONDITIONWARNINGIf license expires in less than warning-period.
Example: &health:LicenseHealthCheck& in health.xml
&cluster xmlns=&/ns/resin&
xmlns:resin=&urn:java:com.caucho.resin&
xmlns:health=&urn:java:com.caucho.health&
xmlns:ee=&urn:java:ee&&
&health:LicenseHealthCheck&
&warning-period&30D&/warning-period&
&/health:LicenseHealthCheck&
&/cluster&
&health:MemoryPermGenHealthCheck&child of javadoc
Monitors the amount of free memory in the JVM PermGen memory pool.
a garbage collection if memory falls too low.
Note: This check does not apply to all JVM vendor implementations, and will
report UNKNOWN if there is no PermGen pool.&health:MemoryPermGenHealthCheck& AttributesATTRIBUTEDESCRIPTIONTYPEDEFAULTenabledCheck is enabled or disabledbooleantruememory-free-minThe critical minimum amount of free memory.1mfree-warningThe warning threshold percentage.double (percentage 0.0 - 100.0)0.01objectNameExplicitly set the MBean name to query for memory stats.
unset the health check will search available MBeans for the appropriate
memory stats MBean.javax.management.ObjectNameN/A&health:MemoryPermGenHealthCheck& ConditionsHEALTHSTATUSCONDITIONUNKNOWNIf there is no PermGen pool (JVM vendor dependent) or the appropriate MBean could not be determined.WARNINGIf free memory is below free-warning percentage after a GC.CRITICALIf free memory is below memory-free-min after a GC.
Example: &health:MemoryPermGenHealthCheck& in health.xml
&cluster xmlns=&/ns/resin&
xmlns:resin=&urn:java:com.caucho.resin&
xmlns:health=&urn:java:com.caucho.health&
xmlns:ee=&urn:java:ee&&
&health:MemoryPermGenHealthCheck&
&memory-free-min&1m&/memory-free-min&
&free-warning&0.01&/free-warning&
&/health:MemoryPermGenHealthCheck&
&/cluster&
&health:MemoryTenuredHealthCheck&child of javadoc
Monitors the amount of free memory in the JVM Tenured memory pool.
a garbage collection if memory falls too low.
This check will monitor
heap memory on JVMs where there is no tenured pool.
Note: memory-free-min will default to the value of
&server& &memory-free-min& if present in resin.xml.&health:MemoryTenuredHealthCheck& AttributesATTRIBUTEDESCRIPTIONTYPEDEFAULTenabledCheck is enabled or disabledbooleantruememory-free-minThe critical minimum amount of free memory.1mfree-warningThe warning threshold percentage.double (percentage 0.0 - 100.0)0.01objectNameExplicitly set the MBean name to query for memory stats.
unset the health check will search available MBeans for the appropriate
memory stats MBean.javax.management.ObjectNameN/A&health:MemoryTenuredHealthCheck& ConditionsHEALTHSTATUSCONDITIONUNKNOWNIf there is no PermGen pool (JVM vendor dependent) or the appropriate MBean could not be determined.WARNINGIf free memory is below free-warning percentage after a GC.CRITICALIf free memory is below memory-free-min after a GC.
Example: &health:MemoryTenuredHealthCheck& in health.xml
&cluster xmlns=&/ns/resin&
xmlns:resin=&urn:java:com.caucho.resin&
xmlns:health=&urn:java:com.caucho.health&
xmlns:ee=&urn:java:ee&&
&health:MemoryTenuredHealthCheck&
&memory-free-min&1m&/memory-free-min&
&free-warning&0.01&/free-warning&
&/health:MemoryTenuredHealthCheck&
&/cluster&
&health:TransactionHealthCheck&child of javadoc
Monitors the Resin transaction manager for commit failures.&health:TransactionHealthCheck& AttributesATTRIBUTEDESCRIPTIONTYPEDEFAULTenabledCheck is enabled or disabledbooleantrue&health:TransactionHealthCheck& ConditionsHEALTHSTATUSCONDITIONWARNINGIf there were commit failures since the last check.
Example: &health:TransactionHealthCheck& in health.xml
&cluster xmlns=&/ns/resin&
xmlns:resin=&urn:java:com.caucho.resin&
xmlns:health=&urn:java:com.caucho.health&
xmlns:ee=&urn:java:ee&&
&health:TransactionHealthCheck/&
&/cluster&
User checks
User checks are not pre-defined in health. an administrator must
configure them in health.xml as appropriate for an application.
User checks
the same check type can be configured in health.xml more
than once provided they have different names.
Example: duplicate user checks
&cluster xmlns=&/ns/resin&
xmlns:resin=&urn:java:com.caucho.resin&
xmlns:health=&urn:java:com.caucho.health&
xmlns:ee=&urn:java:ee&&
&!-- Http status check 1 for database with email to database admin --&
&health:HttpStatusHealthCheck ee:Named=&databaseCheck&&
&url&http://localhost:8080/databaseCheck.jsp&/url&
&/health:HttpStatusHealthCheck&
&health:SendMail&
&to&database_&/to&
&health:IfHealthCritical healthCheck=&${databaseCheck}&/&
&health:IfRechecked/&
&/health:SendMail&
&!-- Http status check 2 for application with email to application admin --&
&health:HttpStatusHealthCheck& ee:Named=&appCheck&&
&url&http://localhost:8080/applicationTest.jsp&/url&
&/health:HttpStatusHealthCheck&
&health:SendMail&
&to&app_&/to&
&health:IfHealthCritical healthCheck=&${appCheck}&/&
&health:IfRechecked/&
&/health:SendMail&
&/cluster&
&health:HttpStatusHealthCheck&child of javadoc
Monitors one or more URLs on the current Resin instance by making an HTTP
GET request and comparing the returned HTTP status code to a pattern.&health:HttpStatusHealthCheck& AttributesATTRIBUTEDESCRIPTIONTYPEDEFAULTenabledCheck is enabled or disabledbooleantrueping-hostThe server's ping host (for use where url is a URI)StringN/Aping-portThe server's ping port (for use where url is a URI)int80urlA URL or URI to be testedStringN/Asocket-timeoutThe socket connection timeout10sregexpThe HTTP status regular expressionjava.util.regex.Pattern200&health:HttpStatusHealthCheck& ConditionsHEALTHSTATUSCONDITIONCRITICALIf the HTTP GET request failed to connect or the status code
does not match the regexp.
Example: &health:HttpStatusHealthCheck& in health.xml
&cluster xmlns=&/ns/resin&
xmlns:resin=&urn:java:com.caucho.resin&
xmlns:health=&urn:java:com.caucho.health&
xmlns:ee=&urn:java:ee&&
&health:HttpStatusHealthCheck&
&ping-host&localhost&/ping-host&
&ping-port&8080&/ping-port&
&url&/custom-test-1.jsp&/url&
&url&/custom-test-2.jsp&/url&
&socket-timeout&2s&/socket-timeout&
&regexp&^2|^3&/regexp&
&/health:HttpStatusHealthCheck&
&/cluster&
In some clustered configurations it may be simpler to use the
&server-default& &ping-url& element rather than specifying
the host and port in the health check itself.
&ping-url& will
dynamically construct a URL using the current server host.
To enabled this,
configure HttpStatusHealthCheck with no &url& elements and add
&ping-url&to &server& or
&server-default&.
Example: &health:HttpStatusHealthCheck& using ping-url
&!-- resin.xml --&
&resin xmlns=&/ns/resin&&
&cluster id=&web-tier&&
&server-default&
&ping-url&/ping-test.jsp&ping-url&
&/server-default&
&/cluster&
&!-- health.xml --&
&cluster xmlns=&/ns/resin&
xmlns:resin=&urn:java:com.caucho.resin&
xmlns:health=&urn:java:com.caucho.health&
xmlns:ee=&urn:java:ee&&
&health:HttpStatusHealthCheck ee:Named=&serverHttpPingCheck&&
&socket-timeout&5s&/socket-timeout&
&regexp&200&/regexp&
&/health:HttpStatusHealthCheck&
&/cluster&
&health:ExprHealthCheck&child of javadoc
Evaluates user supplied EL expressions to a boolean.&health:ExprHealthCheck& AttributesATTRIBUTEDESCRIPTIONTYPEDEFAULTenabledCheck is enabled or disabledbooleantruefatal-testEL expression that will trigger FATAL if it evaluates to trueN/Acritical-testEL expression that will trigger CRITICAL if it evaluates to trueN/Awarning-testEL expression that will trigger WARNING if it evaluates to trueN/A&health:ExprHealthCheck& ConditionsHEALTHSTATUSCONDITIONFATALIf any fatal-test expression evaluates to trueCRITICALIf any critical-test expression evaluates to trueWARNINGIf any warning-test expression evaluates to true
Example: &health:ExprHealthCheck& in health.xml
&cluster xmlns=&/ns/resin&
xmlns:resin=&urn:java:com.caucho.resin&
xmlns:health=&urn:java:com.caucho.health&
xmlns:ee=&urn:java:ee&&
&health:ExprHealthCheck&
&critical-test&${mbean('java.lang:type=Threading').ThreadCount & 100}&/critical-test&
&/health:ExprHealthCheck&
&/cluster&
Health actions
Health actions perform a task, usually in response to specific conditions,
or as remediation for a health check status.
Like health checks, health actions
are configured in health.xml and executed by the health system on a periodic
Health actions are usually accompanied by one or more conditions,
or predicates, but this is not required.
All actions have the potential
to be executed once per period, determined by evaluation of
associated conditions.
A health action with no conditions will execute
once per period.
&health:ActionSequence&child of javadoc
Executes a sequence of child health actions in order.&health:ActionSequence& AttributesATTRIBUTEDESCRIPTIONTYPEDEFAULTNone
Example: &health:ActionSequence& in health.xml
&cluster xmlns=&/ns/resin&
xmlns:resin=&urn:java:com.caucho.resin&
xmlns:health=&urn:java:com.caucho.health&
xmlns:ee=&urn:java:ee&&
&health:ActionSequence&
&health:DumpThreads/&
&health:DumpHeap/&
&health:IfHealthCritical time=&5m&/&
&/health:ActionSequence&
&/cluster&
&health:CallJmxOperation&child of javadoc
Executes a JMX MBean operation with parameters.
Note: Calling a JMX operation can also be performed on-demand using the
jmx-call command line.&health:CallJmxOperation& AttributesATTRIBUTEDESCRIPTIONTYPEDEFAULTobjectNameThe JMX MBean nameStringN/AoperationThe method nameStringN/AoperationIndexUnique method index in case multiple methods match operationint-1paramMethod parameters that will be converted to the appropriate type.StringN/A
Example: &health:CallJmxOperation& in health.xml
&cluster xmlns=&/ns/resin&
xmlns:resin=&urn:java:com.caucho.resin&
xmlns:health=&urn:java:com.caucho.health&
xmlns:ee=&urn:java:ee&&
&health:CallJmxOperation&
&objectName&java.lang:type=Threading&/objectName&
&operation&resetPeakThreadCount&/operation&
&health:IfNotRecent time='5m'/&
&/health:CallJmxOperation&
&/cluster&
&health:DumpHeap&child of javadoc
Create a memory heap dump.
The heap dump will be logged to the internal log
database and to the resin log file using
com.caucho.health.action.DumpHeap as the class at
info level.
Note: Creating a heap dump can also be performed on-demand using the
heap-dump command line, and from /resin-admin.&health:DumpHeap& AttributesATTRIBUTEDESCRIPTIONTYPEDEFAULThprofCreates an HPROF format dump instead of human readable type.booleanfalsehprof-pathOutput path write HPROF files, if hprof = trueStringlog/heap.hprofhprof-path-formatSelects a format for generating dynamic path names using timestamp tokens.StringlogIf true, JMX dump is written to the server log in addition to
being stored in the internal Resin databasebooleantrue
Example: &health:DumpHeap& in health.xml
&cluster xmlns=&/ns/resin&
xmlns:resin=&urn:java:com.caucho.resin&
xmlns:health=&urn:java:com.caucho.health&
xmlns:ee=&urn:java:ee&&
&health:DumpHeap/&
&/cluster&
Example: &health:DumpHeap& in health.xml with hprof-path-format
&cluster xmlns=&/ns/resin&
xmlns:resin=&urn:java:com.caucho.resin&
xmlns:health=&urn:java:com.caucho.health&
xmlns:ee=&urn:java:ee&&
&health:DumpHeap&
&hprof&true&/hprof&
&hprof-path-format&${resin.home}/log/dump-%H:%M:%S.%s.hprof&/hprof-path-format&
&health:OnAbnormalStop/&
&/health:DumpHeap&
&/cluster&
&health:DumpHprofHeap&child of javadoc
Shortcut for &health:DumpHeap hprof='true'/&
&health:DumpJmx&child of javadoc
Health action to create a dump of all JMX attributes and values.
dump will be logged to the internal log database and to the resin log file
using com.caucho.health.action.DumpJmx as the class at
info level.
Note: Creating a JMX dump can also be performed on-demand using the
jmx-dump command line.&health:DumpJmx& AttributesATTRIBUTEDESCRIPTIONTYPEDEFAULTlogIf true, JMX dump is written to the server log in addition to
being stored in the internal Resin databasebooleanfalse
Example: &health:DumpJmx& in health.xml
&cluster xmlns=&/ns/resin&
xmlns:resin=&urn:java:com.caucho.resin&
xmlns:health=&urn:java:com.caucho.health&
xmlns:ee=&urn:java:ee&&
&health:DumpJmx/&
&/cluster&
&health:DumpThreads&child of javadoc
Create a thread dump.
The thread dump will be logged to the internal log
database and log file using com.caucho.health.action.DumpThreads
as the class at info level.
Note: Creating a thread dump can also be performed on-demand using the
thread-dump command line.&health:DumpThreads& AttributesATTRIBUTEDESCRIPTIONTYPEDEFAULTonly-activeOutput only currently active threads (RUNNABLE state)booleanfalselogIf true, JMX dump is written to the server log in addition to
being stored in the internal Resin databasebooleantrue
Example: &health:DumpThreads& in health.xml
&cluster xmlns=&/ns/resin&
xmlns:resin=&urn:java:com.caucho.resin&
xmlns:health=&urn:java:com.caucho.health&
xmlns:ee=&urn:java:ee&&
&health:DumpThreads&
&only-active&false&/only-active&
&/health:DumpThreads&
&/cluster&
&health:ExecCommand&child of javadoc
Execute an operating system shell command.&health:ExecCommand& AttributesATTRIBUTEDESCRIPTIONTYPEDEFAULTcommandThe command to execute, relative to dir if setStringN/AdirThe directory to execute fromjava.io.FileN/AtimeoutTimeout on execution of the command, after which it will be killed if not complete2senvA custom env variable, available to the command.Name/Value PairN/A (System variables are available by default)
Example: &health:ExecCommand& in health.xml
&cluster xmlns=&/ns/resin&
xmlns:resin=&urn:java:com.caucho.resin&
xmlns:health=&urn:java:com.caucho.health&
xmlns:ee=&urn:java:ee&&
&health:ExecCommand&
&dir&/tmp&/dir&
&command&remediation.sh&/command&
&timeout&2s&/timeout&
&name&resin_home&/name&
&value&${resin.home}&/value&
&name&password&/name&
&value&foo&/value&
&/health:ExecCommand&
&/cluster&
&health:FailSafeRestart&child of javadoc
A timed restart of Resin, normally used in conjunction with an
ActionSequence to gather shutdown information&health:FailSafeRestart& AttributesATTRIBUTEDESCRIPTIONTYPEDEFAULTtimeoutTime to force a restart if one has not yet occurred.N/A
Example: &health:FailSafeRestart& in health.xml
&cluster xmlns=&/ns/resin&
xmlns:resin=&urn:java:com.caucho.resin&
xmlns:health=&urn:java:com.caucho.health&
xmlns:ee=&urn:java:ee&&
&health:ActionSequence&
&health:FailSafeRestart timeout=&10m&/&
&health:DumpThreads/&
&health:DumpHeap/&
&health:StartProfiler active-time=&5m&/&
&health:Restart/&
&health:IfHealthCritical time=&5m&/&
&/health:ActionSequence&
&/cluster&
&health:PdfReport&child of javadoc
Health action to generate a PDF report from a PHP script.&health:PdfReport& AttributesATTRIBUTEDESCRIPTIONTYPEDEFAULTpathPath to a PDF generating .php fileString${resin.home}/doc/admin/pdf-gen.phpreportReport type keyStringSummaryperiodReport look back period of time7Dlog-pathPDF output directoryString${resin.logDirectory}
Example: &health:PdfReport& in health.xml
&cluster xmlns=&/ns/resin&
xmlns:resin=&urn:java:com.caucho.resin&
xmlns:health=&urn:java:com.caucho.health&
xmlns:ee=&urn:java:ee&&
&health:PdfReport&
&path&${resin.home}/doc/admin/pdf-gen.php&/path&
&report&Summary&/report&
&period&7D&/report&
&health:IfCron value=&0 0 * * 0&/&
&/health:PdfReport&
&/cluster&
&health:Restart&child of javadoc
Restart Resin.
Resin will exit with the reason HEALTH.&health:Restart& AttributesATTRIBUTEDESCRIPTIONTYPEDEFAULTNone
Example: &health:Restart& in health.xml
&cluster xmlns=&/ns/resin&
xmlns:resin=&urn:java:com.caucho.resin&
xmlns:health=&urn:java:com.caucho.health&
xmlns:ee=&urn:java:ee&&
&health:Restart/&
&/cluster&
&health:ScoreboardReport&child of javadoc
Produces a concise thread activity report for groups of related threads.
Note: A scoreboard report can also be produced using the
scoreboard command line.&health:ScoreboardReport& AttributesATTRIBUTEDESCRIPTIONTYPEDEFAULTlogOutput to server log in addition to pdf reportBooleanfalsetypeScoreboard report typeStringresingreedyIf false threads can be categoried into more than one groupBooleantrue
Example: &health:ScoreboardReport& in health.xml
&cluster xmlns=&/ns/resin&
xmlns:resin=&urn:java:com.caucho.resin&
xmlns:health=&urn:java:com.caucho.health&
xmlns:ee=&urn:java:ee&&
&health:ScoreboardReport&
&health:OnAbnormalStop/&
&/health:ScoreboardReport&
&/cluster&
&health:SendMail&child of javadoc
Send an email containing a summary of the current Resin health status.&health:SendMail& AttributesATTRIBUTEDESCRIPTIONTYPEDEFAULTtoA &TO:& a mail recipientStringN/AfromThe &FROM:& addressStringresin@localhostmailA
resource to use, see examplejavax.mail.SessionN/A
Without the mail parameter, the default behaviour for sending
mail is to contact an SMTP server at host 127.0.0.1 (the localhost) on port 25.
System properties can be used to configure a different SMTP server.
resin.xml - smtp server configuration
&system-property mail.smtp.host=&127.0.0.1&/&
&system-property mail.smtp.port=&25&/&
Example: &health:SendMail& in health.xml using system properties
&cluster xmlns=&/ns/resin&
xmlns:resin=&urn:java:com.caucho.resin&
xmlns:health=&urn:java:com.caucho.health&
xmlns:ee=&urn:java:ee&&
&health:SendMail&
&to&another_&/to&
&from&&/from&
&health:SendMail&
&/cluster&
Much more advanced SMTP options can be set by configuring a
resource to use for sending health alerts.
Example: &health:SendMail& in health.xml referencing a &mail& resource
&cluster xmlns=&/ns/resin&
xmlns:resin=&urn:java:com.caucho.resin&
xmlns:health=&urn:java:com.caucho.health&
xmlns:ee=&urn:java:ee&&
&mail name=&healthMailer&&
&smtp-host&&/smtp-host&
&smtp-port&25&/smtp-port&
&from&&/from&
&health:SendMail mail=&${healthMailer}&&
&health:SendMail&
&/cluster&
&health:Snapshot&child of javadoc
A specific sequence of health actions: thread dump, heap dump, jmx dump,
and pdf report.
This is intended to generate a permanent representation, or
&snapshot& of the system at a point in time that includes all the
information necessary to debug server issues.
It is usually intended to run
in response to a unexpected issue.&health:Snapshot& AttributesATTRIBUTEDESCRIPTIONTYPEDEFAULTlogOutput to server log in addition to pdf reportBooleanfalsepathPath to a PDF generating .php fileString${resin.home}/doc/admin/pdf-gen.phpreportReport type keyStringSummaryperiodReport look back period of time7D
Example: &health:Snapshot& in health.xml
&cluster xmlns=&/ns/resin&
xmlns:resin=&urn:java:com.caucho.resin&
xmlns:health=&urn:java:com.caucho.health&
xmlns:ee=&urn:java:ee&&
&health:Snapshot&
&health:OnAbnormalStop/&
&/health:Snapshot&
&/cluster&
&health:StartProfiler&child of javadoc
Starts a profiler session.
Results are logged to the internal database
and the Resin log file at INFO level.
Note: Starting the profiler can also be performed on-demand using the
profile command line, and from /resin-admin.&health:StartProfiler& AttributesATTRIBUTEDESCRIPTIONTYPEDEFAULTactive-timeThe amount of time to run the profiler5ssampling-rateThe sampling rate10msdepthThe stack trace depth (use smaller number (8) for smaller impact, larger for more information.)int16
Example: &health:StartProfiler& in health.xml
&cluster xmlns=&/ns/resin&
xmlns:resin=&urn:java:com.caucho.resin&
xmlns:health=&urn:java:com.caucho.health&
xmlns:ee=&urn:java:ee&&
&health:ActionSequence&
&health:FailSafeRestart timeout=&10m&/&
&health:DumpThreads/&
&health:DumpHeap/&
&health:StartProfiler active-time=&5m&/&
&health:Restart/&
&health:IfHealthCritical time=&5m&/&
&/health:ActionSequence&
&/cluster&
Health conditions
Health condition, or predicates, qualify an action to execute based
on a set of criteria.
The action/condition pattern is intentionally
similar to Resin's rewrite dispatch/condition pattern, so it should be
familiar to some users.
Health actions are evaluated every period.
Conditions prevent the execution of an action unless all condition evaluate to true.
A health action with no conditions will execute once per period.
than one condition is present for an action, the default combining condion
Basic conditions
Basic conditions evaluate some general criteria and return true if the
Basic conditions do not evaluate the status of a health
Instead they evaluate some general criteria like the time of day.
&health:IfCron&child of javadoc
Qualify an action to execute if the current time is in an active range configured by
cron-style times.
This can be used both to schedule regular actions or to
prevent restarts or other actions during critical times.&health:IfCron& AttributesATTRIBUTEDESCRIPTIONTYPEDEFAULTenable-atThe cron enable timesN/Adisable-at-atThe cron diable timesN/A
Example: &health:IfCron& in health.xml
&cluster xmlns=&/ns/resin&
xmlns:resin=&urn:java:com.caucho.resin&
xmlns:health=&urn:java:com.caucho.health&
xmlns:ee=&urn:java:ee&&
&health:Restart&
&health:IfCron&
&enable-at&0 0 * * *&/enable-at&
&disable-at&5 0 * * *&/disable-at&
&/health:IfCron&
&/health:Restart&
&/cluster&
&health:IfExpr&child of javadoc
Qualifies an action to execute based on the evaluation of an JSP EL
expression. Expression can include references to system properties, config
properties, and JMX mbean attributes.&health:IfExpr& AttributesATTRIBUTEDESCRIPTIONTYPEDEFAULTtestthe JSP-EL expression valueN/A
Example: &health:IfExpr& in health.xml
&cluster xmlns=&/ns/resin&
xmlns:resin=&urn:java:com.caucho.resin&
xmlns:health=&urn:java:com.caucho.health&
xmlns:ee=&urn:java:ee&&
&health:Restart&
&health:IfExpr&
&test&${mbean('java.lang:type=Threading').ThreadCount & 100}&/test&
&/health:IfExpr&
&/health:Restart&
&/cluster&
&health:IfNotRecent&child of javadoc
Qualifies an action to match at most an amount of time after the last execution.
This is usefull to prevent unecessary frequent execution of an action.&health:IfNotRecent& AttributesATTRIBUTEDESCRIPTIONTYPEDEFAULTtimeThe time before the action can execute again.N/A
Example: &health:IfNotRecent& in health.xml
&cluster xmlns=&/ns/resin&
xmlns:resin=&urn:java:com.caucho.resin&
xmlns:health=&urn:java:com.caucho.health&
xmlns:ee=&urn:java:ee&&
&health:HttpStatusHealthCheck ee:Named=&httpStatusCheck&&
&url&http://localhost:8080/test-ping.jsp&/url&
&/health:HttpStatusHealthCheck&
&health:DumpHeap&
&health:IfHealthCritical healthCheck=&${httpStatusCheck}&/&
&health:IfNotRecent time='5m'/&
&/health:DumpHeap&
&/cluster&
&health:IfRechecked&child of javadoc
Qualifies an action to match only after the required number of rechecks
have been performed.
Since rechecking is not a health check specific
condition, this predicate simply matches when recheck cycle count matches the
HealthSystem parameter recheck-max.&health:IfRechecked& AttributesATTRIBUTEDESCRIPTIONTYPEDEFAULTNone
Example: &health:IfRechecked& in health.xml
&cluster xmlns=&/ns/resin&
xmlns:resin=&urn:java:com.caucho.resin&
xmlns:health=&urn:java:com.caucho.health&
xmlns:ee=&urn:java:ee&&
&health:Restart&
&health:IfHealthFatal/&
&health:IfRechecked/&
&/health:Restart&
&/cluster&
&health:IfUptime&child of javadoc
Qualifies an action to match an amount of time after startup.&health:IfUptime& AttributesATTRIBUTEDESCRIPTIONTYPEDEFAULTlimitThe time after startup (at least)N/A
Example: &health:IfUptime& in health.xml
&cluster xmlns=&/ns/resin&
xmlns:resin=&urn:java:com.caucho.resin&
xmlns:health=&urn:java:com.caucho.health&
xmlns:ee=&urn:java:ee&&
&health:Restart&
&health:IfUptime limit=&12h&/&
&/health:Restart&
&/cluster&
Combining conditions
General condition or health check conditions can be combined or negated using
these conditions.
&health:And&child of javadoc
Qualifies an action to match if all of the child predicates match.
Note: &health:And& is implied and thus not strictly necessary except
when used in conjunction with more complex combining conditions.&health:And& AttributesATTRIBUTEDESCRIPTIONTYPEDEFAULTNone
Example: &health:And& in health.xml
&cluster xmlns=&/ns/resin&
xmlns:resin=&urn:java:com.caucho.resin&
xmlns:health=&urn:java:com.caucho.health&
xmlns:ee=&urn:java:ee&&
&health:Restart&
&health:And&
&health:IfHealthCritical health-check=&${memoryTenuredHealthCheck}&/&
&health:IfHealthCritical health-check=&${memoryPermGenHealthCheck}&/&
&/health:And&
&/health:Restart&
&/cluster&
&health:Nand&child of javadoc
Qualifies an action to match if all of the child predicates fail.&health:Nand& AttributesATTRIBUTEDESCRIPTIONTYPEDEFAULTNone
Example: &health:Nand& in health.xml
&cluster xmlns=&/ns/resin&
xmlns:resin=&urn:java:com.caucho.resin&
xmlns:health=&urn:java:com.caucho.health&
xmlns:ee=&urn:java:ee&&
&health:Restart&
&health:Nand&
&health:IfHealthCritical health-check=&${memoryTenuredHealthCheck}&/&
&health:IfHealthCritical health-check=&${memoryPermGenHealthCheck}&/&
&/health:Nand&
&/health:Restart&
&/cluster&
&health:Nor&child of javadoc
Qualifies an action to match if none of the child predicates match.&health:Nor& AttributesATTRIBUTEDESCRIPTIONTYPEDEFAULTNone
Example: &health:Nor& in health.xml
&cluster xmlns=&/ns/resin&
xmlns:resin=&urn:java:com.caucho.resin&
xmlns:health=&urn:java:com.caucho.health&
xmlns:ee=&urn:java:ee&&
&health:Restart&
&health:Nor&
&health:IfHealthCritical health-check=&${memoryTenuredHealthCheck}&/&
&health:IfHealthCritical health-check=&${memoryPermGenHealthCheck}&/&
&/health:Nor&
&/health:Restart&
&/cluster&
&health:Not&child of javadoc
Qualifies an action to match if the child predicate is false.&health:Not& AttributesATTRIBUTEDESCRIPTIONTYPEDEFAULTNone
Example: &health:Not& in health.xml
&cluster xmlns=&/ns/resin&
xmlns:resin=&urn:java:com.caucho.resin&
xmlns:health=&urn:java:com.caucho.health&
xmlns:ee=&urn:java:ee&&
&health:Restart&
&health:IfHealthCritical health-check=&${memoryTenuredHealthCheck}&/&
&health:Not&
&health:IfCron&
&enable-at&0 7 * * *&/enable-at&
&disable-at&0 11 * * *&/disable-at&
&/health:IfCron&
&/health:Not&
&/health:Restart&
&/cluster&
&health:Or&child of javadoc
Qualifies an action to match if any of the child predicates match.&health:Or& AttributesATTRIBUTEDESCRIPTIONTYPEDEFAULTNone
Example: &health:Or& in health.xml
&cluster xmlns=&/ns/resin&
xmlns:resin=&urn:java:com.caucho.resin&
xmlns:health=&urn:java:com.caucho.health&
xmlns:ee=&urn:java:ee&&
&health:Restart&
&health:Or&
&health:IfHealthCritical health-check=&${memoryTenuredHealthCheck}&/&
&health:IfHealthCritical health-check=&${memoryPermGenHealthCheck}&/&
&/health:Or&
&/health:Restart&
&/cluster&
Health check conditions
All health check conditions evaluate some aspect of the results of a health
All optionally accept the parameter health-check, which
can reference a specific named health check.
In absence of this
parameter, overall aggregated Resin health will be used.
&health:IfHealthOk&child of javadoc
Qualifies an action to match if health status is OK.&health:IfHealthOk& AttributesATTRIBUTEDESCRIPTIONTYPEDEFAULThealth-checkThe target health checkN/A (Overall Resin health will be used if absent)timeThe minimum amount of time since the status startedN/A
Example: &health:IfHealthOk& in health.xml
&cluster xmlns=&/ns/resin&
xmlns:resin=&urn:java:com.caucho.resin&
xmlns:health=&urn:java:com.caucho.health&
xmlns:ee=&urn:java:ee&&
&health:Restart&
&health:Not&
&health:IfHealthOk health-check=&${memoryTenuredHealthCheck}&/&
&/health:Not&
&/health:Restart&
&/cluster&
&health:IfHealthWarning&child of javadoc
Qualifies an action to match if health status is WARNING.&health:IfHealthWarning& AttributesATTRIBUTEDESCRIPTIONTYPEDEFAULThealth-checkThe target health checkN/A (Overall Resin health will be used if absent)timeThe minimum amount of time since the status startedN/A
Example: &health:IfHealthWarning& in health.xml
&cluster xmlns=&/ns/resin&
xmlns:resin=&urn:java:com.caucho.resin&
xmlns:health=&urn:java:com.caucho.health&
xmlns:ee=&urn:java:ee&&
&health:Restart&
&health:IfHealthWarning health-check=&${memoryTenuredHealthCheck}&/&
&/health:Restart&
&/cluster&
&health:IfHealthCritical&child of javadoc
Qualifies an action to match if health status is CRITICAL.&health:IfHealthCritical& AttributesATTRIBUTEDESCRIPTIONTYPEDEFAULThealth-checkThe target health checkN/A (Overall Resin health will be used if absent)timeThe minimum amount of time since the status startedN/A
Example: &health:IfHealthCritical& in health.xml
&cluster xmlns=&/ns/resin&
xmlns:resin=&urn:java:com.caucho.resin&
xmlns:health=&urn:java:com.caucho.health&
xmlns:ee=&urn:java:ee&&
&health:Restart&
&health:IfHealthCritical health-check=&${memoryTenuredHealthCheck}&/&
&/health:Restart&
&/cluster&
&health:IfHealthFatal&child of javadoc
Qualifies an action to match if health status is FATAL.&health:IfHealthFatal& AttributesATTRIBUTEDESCRIPTIONTYPEDEFAULThealth-checkThe target health checkN/A (Overall Resin health will be used if absent)timeThe minimum amount of time since the status startedN/A
Example: &health:IfHealthFatal& in health.xml
&cluster xmlns=&/ns/resin&
xmlns:resin=&urn:java:com.caucho.resin&
xmlns:health=&urn:java:com.caucho.health&
xmlns:ee=&urn:java:ee&&
&health:Restart&
&health:IfHealthFatal health-check=&${memoryTenuredHealthCheck}&/&
&/health:Restart&
&/cluster&
&health:IfHealthUnknown&child of javadoc
Qualifies an action to match if health status is UNKNOWN.&health:IfHealthUnknown& AttributesATTRIBUTEDESCRIPTIONTYPEDEFAULThealth-checkThe target health checkN/A (Overall Resin health will be used if absent)timeThe minimum amount of time since the status startedN/A
Example: &health:IfHealthUnknown& in health.xml
&cluster xmlns=&/ns/resin&
xmlns:resin=&urn:java:com.caucho.resin&
xmlns:health=&urn:java:com.caucho.health&
xmlns:ee=&urn:java:ee&&
&health:Restart&
&health:IfHealthUnknown health-check=&${memoryTenuredHealthCheck}&/&
&/health:Restart&
&/cluster&
&health:IfMessage&child of javadoc
Qualifies an action to match the health result message to a regular expression.&health:IfMessage& AttributesATTRIBUTEDESCRIPTIONTYPEDEFAULThealth-checkThe target health checkN/A (Overall Resin health will be used if absent)regexpThe health message match regular expressionjava.util.regex.PatternN/A
Example: &health:IfMessage& in health.xml
&cluster xmlns=&/ns/resin&
xmlns:resin=&urn:java:com.caucho.resin&
xmlns:health=&urn:java:com.caucho.health&
xmlns:ee=&urn:java:ee&&
&health:Restart&
&health:IfHealthCritical/&
&health:IfMessage health-check=&${httpStatusCheck}& regexp=&Not Found&/&
&/health:Restart&
&/cluster&
&health:IfRecovered&child of javadoc
Qualifies an action to match upon recovery.
Recovery is defined as the
state change from FATAL, CRITICAL, or WARNING to OK.&health:IfRecovered& AttributesATTRIBUTEDESCRIPTIONTYPEDEFAULThealth-checkThe target health checkN/A (Overall Resin health will be used if absent)
Example: &health:IfRecovered& in health.xml
&cluster xmlns=&/ns/resin&
xmlns:resin=&urn:java:com.caucho.resin&
xmlns:health=&urn:java:com.caucho.health&
xmlns:ee=&urn:java:ee&&
&health:SendMail&
&to&admin@yourdomain&/to&
&health:IfRecovered health-check=&${cpuHealthCheck}&/&
&/health:SendMail&
&/cluster&
&health:IfHealthEvent&child of javadoc
Causes an action to fire in response to a matching health event.
usually used in combination with
&health-event& attribute.&health:IfHealthEvent& AttributesATTRIBUTEDESCRIPTIONTYPEDEFAULTregexpA regular expression the event must match.java.util.regex.Patternrequired
Example: &health:IfHealthEvent& in health.xml
&cluster xmlns=&/ns/resin&
xmlns:resin=&urn:java:com.caucho.resin&
xmlns:health=&urn:java:com.caucho.health&
xmlns:ee=&urn:java:ee&&
&health:JmxMeter&
&name&JVM|Thread|JVM Blocked Count&/name&
&objectName&resin:type=JvmThreads&/objectName&
&attribute&BlockedCount&/attribute&
&/health:JmxMeter&
&health:AnomalyAnalyzer&
&meter&JVM|Thread|JVM Blocked Count&/meter&
&health-event&caucho.thread.anomaly.jvm-blocked&/health-event&
&/health:AnomalyAnalyzer&
&health:DumpThreads&
&health:IfHealthEvent regexp=&caucho.thread&/&
&health:IfNotRecent time=&15m&/&
&/health:DumpThreads&
&/cluster&
Lifecycle conditions
Lifecycle conditions evaluate the current state of Resin, qualifying actions
to execute only during a Resin lifecycle state change.
&health:OnStart&child of javadoc
Qualifies an action to match only when Resin is starting.&health:OnStart& AttributesATTRIBUTEDESCRIPTIONTYPEDEFAULTNone
Example: &health:OnStart& in health.xml
&cluster xmlns=&/ns/resin&
xmlns:resin=&urn:java:com.caucho.resin&
xmlns:health=&urn:java:com.caucho.health&
xmlns:ee=&urn:java:ee&&
&health:SendMail&
&health:OnStart/&
&/health:SendMail&
&/cluster&
&health:OnStop&child of javadoc
Qualifies an action to match only when Resin is stopping.&health:OnStop& AttributesATTRIBUTEDESCRIPTIONTYPEDEFAULTNone
Example: &health:OnStop& in health.xml
&cluster xmlns=&/ns/resin&
xmlns:resin=&urn:java:com.caucho.resin&
xmlns:health=&urn:java:com.caucho.health&
xmlns:ee=&urn:java:ee&&
&health:SendMail&
&health:OnStop/&
&/health:SendMail&
&/cluster&
&health:OnAbnormalStop&child of javadoc
Qualifies an action to match only when Resin is stopping with an non-OK
exit code.&health:OnAbnormalStop& AttributesATTRIBUTEDESCRIPTIONTYPEDEFAULTnormal-exit-codeAdd an OK one that will not trigger this condition.[OK,MODIFIED,WATCHDOG_EXIT]
Example: &health:OnAbnormalStop& in health.xml
&cluster xmlns=&/ns/resin&
xmlns:resin=&urn:java:com.caucho.resin&
xmlns:health=&urn:java:com.caucho.health&
xmlns:ee=&urn:java:ee&&
&health:PdfReport snapshot='true'&
&health:OnAbnormalStop/&
&/health:PdfReport
&/cluster&
&health:OnRestart&child of javadoc
Qualifies an action to match only when Resin is restarted by the watchdog.
This generally only occurs during an error condition.
will fire during this event also.&health:OnRestart& AttributesATTRIBUTEDESCRIPTIONTYPEDEFAULTNone
Example: &health:OnRestart& in health.xml
&cluster xmlns=&/ns/resin&
xmlns:resin=&urn:java:com.caucho.resin&
xmlns:health=&urn:java:com.caucho.health&
xmlns:ee=&urn:java:ee&&
&health:SendMail&
&health:OnRestart/&
&/health:SendMail&
&/cluster&
Copyright &
Caucho Technology, Inc. All rights reserved.&Resin ® is a registered trademark. Quercustm, and Hessiantm are trademarks of Caucho Technology.Cloud-optimized Resin Server is a Java EE certified Java Application Server, and Web Server, and Distributed Cache Server (Memcached).Leading companies worldwide with demand for reliability and high performance web applications , CNET, DZone and many more are powered by Resin.&&&&&&

我要回帖

更多关于 heapdump 失败 的文章

 

随机推荐