a serious failure, likely to prevent normal program execution
warning
log.warning("...")
a potential problem
info
log.info("...")
informational messages
config
log.config("...")
static configuration messages, meant to assist in debugging problems associated with particular configurations
fine
log.fine("...")
tracing information
finer
log.finer("...")
fairly detailed tracing message
finest
log.finest("...")
highly detailed tracing message
all
all messages should be logged
6.5 当出现内存耗没、或日志写的太快时,如果解决?
答:用top命令来查询一下全部进程的使用情况,发现有问题的进程,kill -9 processId。 6.6 当out of memory时,出现死锁进程,如果解决?
答: 首先用ps –ef|grep java查看进程命令,看系统内存使用情况。如果是存在死锁进程,可以通过kill -9 PID,来杀死它,然后重启。如果系统内存很小,可以对$RESION_HOME/bin/httpd.sh内的参数进行调整。 6.7 当resin启动时,如何指定java的内存大小?
1.Window下内存设置: -J"-server -Xms500m -Xmx1000m”
2.Linux配置: resin3/bin/httpd.sh 中的args。 6.8 Kill了指定的java进程后,resin它又自动的重启,怎么kill那?
答: 在httpd.sh文件中,有一个自动重启的perl脚本。可以通过ps –ef|grep java,来找出谁在调用java进程,发现perl进程在调用java,使用 ps –ef|grep perl,查找出来,先kill掉perl进程。然后再kill java进程。 6.9 查看resin是否是自动重启?
答: httpd.sh –h,中一个-no-auto-restart : disable automatic server restart,默认是自动重启的,可以指定这个启动参数,使得resin不自动重启。ps –ef|grep perl,看看这个进程是否是在启动状态。是否是让应用是否重启,可以根据具体情况来设定。更多信息,可以看wrapper.pl文件,搜索 keepalive或auto-restart关键字,看它的初始参数值。 6.10 Resin不能启动,报java不能发现?
答:首先,检查java是否安装和是否在用户下的.bash_profile中进行了配置。
其次,如果安装和配置正确,再检查用户是否正确。如果用户是通过su to Change the effective user id and group id to that of USER. 例如:su –foo。这时执行shell命令:source或者. .bash_profile。 6.11 如何查看resin的命令参数解释?
答:查看命令参数httpd.sh –h, man httpd.sh,vi http.sh, 6.12 如何配置session的超时时间? using session-config and session-timeout to control the number of sessions
<web-app id='/dir'>
<session-config>
<!-- 2 hour timeout -->
<session-timeout>120</session-timeout>
<session-max>4096</session-max>
</session-config>
</web-app> 6.13 Resin正常启动,DB中有用户,报用户不存在?
答:resin.conf中,一个conf只能配置一个<jndi-name>名称,并且这个名称必须是唯一的。否则, 前面的将覆盖前面的,所以导致不能登陆。 6.14 程序的建立连接数多时,系统死锁?
答:原因是resin.conf中,最大连接数配置的太少。这是可以调节到一个比较大的值。缺省为128个连接。
<max-connections> configures the maximum number of open connections allowed for Resin's database pool. Sites can use <max-connections> to throttle the number of database connections for an overloaded server. When max-connections is reached andan application calls getConnection, Resin will wait connection-wait-time or until a connection is freed before allocating a new connection. default 128 6.15 服务器上的resin启动不了?
答:首先要查看,log/ stderr.log,看看是什么原因。例如:resin-2.1.17用root用户启动过,那么就会在logs/access.log日志,当重新启 动时,当向access.log文件中写东西时,将报错,因为是不同的用户建立的这个文件,需要首先删除这个文件。 7 总结和展望
a) 简单的总结前面知识
b) 今后的提高部分 8 参考资料
1.http://caucho.com 9 术语和附录