生产环境中jboss会自己无缘无故的shutdown,查了官方有篇文章不错,故记录下
http://community.jboss.org/wiki/MysteriousShutdowns
Mysterious JBoss Shutdowns
Many users have said that they experience mysterious JBoss Shutdowns. Here are some troubleshooting tips to find out where they are comming from.
Look at the logs
The logs can tell you alot of information about shutdowns. The shutdown Logs wiki shows you what the log files look like for different scenarios.
What can it be
Most shut downs are due to occurrences, such as users logging off while running jboss, someone accidentally hitting ctrl-c, or other simple answers, but sometimes it is due to inadvertent signals sent to the jvm that causes it to shut down.
Running JBoss as a Service?
Some users have reported JBoss experiencing clean shutdowns while running as a service. It turns out that the Sun JVM monitors for SIGHUP and interprets it as a signal to shut down, so this can occur anytime the console user logs out of the system. So if you are running JBoss as a service and you get mysterious shutdowns, it probably is an OS signal. The solution is to add -Xrs as a jvm parameter as explained below. You may want to visit Running JBoss as a Windows Service for more information.
Signals coming from the Operating system
If you have ruled everything else out, it probably is an errant signal coming from the OS.
Solution 1 - Use of Xrs to reduce signals to the JVM
-Xrs Reduces use of operating-system signals by the Java virtual machine (JVM). This option is available beginning with J2SE 1.3.1. In J2SE 1.3.0, the Shutdown Hooks facility was added to allow orderly shutdown of a Java application. The intent was to allow user cleanup code (such as closing database connections) to run at shutdown, even if the JVM terminates abruptly. You can reference the following url, that gives you a table of the operating systems and the associated interrupts that Xrs will stop the vm from listening to. Revelations on Java signal handling
Sun's JVM catches signals to implement shutdown hooks for abnormal JVM termination. The JVM uses SIGHUP, SIGINT, and SIGTERM to initiate the running of shutdown hooks.
The JVM uses a similar mechanism to implement the pre-1.2 feature of dumping thread stacks for debugging purposes. Sun's JVM uses SIGQUIT to perform thread dumps.
Applications embedding the JVM frequently need to trap signals like SIGINT or SIGTERM, which can lead to interference with the JVM's own signal handlers. To address this issue, the -Xrs command-line option has been added beginning in J2SE 1.3.1. When -Xrs is used on Sun's JVM, the signal masks for SIGINT, SIGTERM, SIGHUP, and SIGQUIT are not changed by the JVM, and signal handlers for these signals are not installed.
Solution 2 - Use of a utility to intercept signals
Use a utility that will intercept all of the Signals, log them and drop them. Attached to this wiki is an experimental project that produces a sar that will do this. Please keep in mind that after deploying this, the only way to shut JBoss down is through JMX. You must have JMX enabled or you will not be able to shut the instance down.
分享到:
相关推荐
3. 关闭 JBoss,可以通过执行 `%JBoss_HOME%\bin\shutdown.bat -S` 命令。 4. 配置 JBoss 的端口,例如将 HTTP 服务监听端口改为 80,需编辑 `jbossweb-tomcat41.sar\META-INF\jboss-service.xml` 文件。 JBoss 的...
- bin目录:包含了启动和关闭服务器的脚本,如run.jar和shutdown.jar。 - client目录:包含与JBoss客户端通信所需的Java库(JARs)。 - docs目录:存放JBoss服务器的文档和示例。 - lib目录:JBoss启动时加载的一般...
正常关闭 JBOSS 的方法是另外打开一个控制台窗口,执行 JBoss\bin 目录下的 shutdown.bat 批处理文件。 六、部署 WAR 文件 JBOSS 支持热部署,也就是 WAR 文件部署到服务器上后不需要重新启动 JBOSS。WAR 文件的...
关闭 JBoss 服务器可以使用 `/opt/jboss/bin/shutdown.sh` 脚本文件,该脚本文件将停止 JBoss 服务器的运行。例如: `./shutdown.sh -S` 这将停止 JBoss 服务器的运行。 退出 SSH 会话 在退出 SSH 会话之前,...
JBOSSCP=${JBOSSCP:-"$JBOSS_HOME/bin/shutdown.jar:$JBOSS_HOME/client/jnet.jar"} JBOSSSH=${JBOSSSH:-"$JBOSS_HOME/bin/run.sh"} # 其他脚本逻辑... ``` 通过以上步骤,我们可以成功地将JBoss配置为开机自启动...
* 键入:shutdown –S 或者 shutdown --server=url。 知识点八:管理 Jboss Jboss 通过一个基于 Web 的控制台管理,你只需在浏览器中键入:jmx-console 即可。查看或更改某一服务的配置,只需简单的点击链接。 ...
5. **停止服务器**:同样在bin目录下,使用对应的停止脚本(如shutdown.bat或shutdown.sh)安全关闭服务器。 6. **JBoss中的部署**:你可以将应用打包为WAR、EAR或JAR文件,放在deploy目录下,服务器会自动检测并...
2. 关闭JBoss应用服务器:可以直接关闭命令行窗口,或者在另一个命令行窗口中运行`shutdown ?username=用户名-password=密码`命令。 三、修改JBoss应用服务器连接的数据库和端口 JBoss连接数据库的配置通常位于`{...
./shutdown.sh ./run.sh ``` 5. **验证修改结果:** - 使用浏览器访问新端口,例如http://localhost:8088,检查是否能够成功访问JBoss管理控制台或者部署的应用程序。 #### 可能遇到的问题及解决办法 1. **...
- **推荐做法**: 使用`shutdown.bat`脚本并带上参数`-S`来终止JBoss服务。避免直接关闭控制台窗口,以防下次启动出现异常。 - **创建快捷方式**: 可以为`shutdown.bat`创建一个快捷方式,便于操作。 **1.5 安装为...
1. bin:启动和关闭 JBoss 的脚本(run.bat 为 Windows 系统下的启动脚本,shutdown.bat 为 Windows 系统下的关闭脚本)。 2. client:客户端与 JBoss 通信所需的 Java 库(JARs)。 3. docs:配置的样本文件...
/path/to/jboss/bin/jboss-cli.sh --connect --command=:shutdown else echo "JBoss is not running." fi sleep 5 # 确保服务器完全关闭 echo "Starting JBoss..." # 启动JBoss /path/to/jboss/bin/standalone....
./standalone.sh --shutdown ``` **6. 部署Java Web应用** 部署Java Web应用程序通常涉及将WAR或EAR文件放入`$JBOSS_HOME/standalone/deployments`目录。当你把文件放在这里时,JBoss AS会自动检测并部署应用。例如...
- **停止服务器**:使用`shutdown.sh`或`shutdown.bat`脚本命令停止JBoss服务器。 - **运行为Windows服务**:对于Windows操作系统,可以将JBoss配置为系统服务,方便管理和自动启动。 #### 三、服务器结构与配置 -...
同样在`bin`目录下,有对应的停止脚本,如`shutdown.sh`或`shutdown.bat`,执行该脚本可以安全地关闭JBoss服务器。 #### 6. JBoss中的部署 应用部署通常是在`deploy`目录下放置`.war`或`.ear`文件,JBoss会自动...
jboss-service.bat install -r "JBoss AS" -n "MyJBossService" -u "DOMAIN_USER" -p "DOMAIN_PASSWORD" --startmode auto --stopmode shutdown -p "%JBOSS_HOME%" ``` 这会创建一个名为"MyJBossService"的新...