Starting and Stopping JBoss

本文介绍了JBoss应用服务器的启动与停止流程。包括使用默认配置启动、指定配置文件启动及使用不同选项的方法。同时,也说明了如何通过命令行或使用shutdown.sh脚本来关闭JBoss。

Chapter 5. Starting and Stopping JBoss

 

After you have installed the JBoss distribution, it is wise to perform a simple startup test to validate that there are no major problems with your Java VM/operating system combination. To test your installation, move to the bin directory and execute the run.bat or run.sh script, as appropriate for your operating system. Your output should look like the following and contain no error or exception messages:

$ sh run.sh
=========================================================================

  JBoss Bootstrap Environment

  JBOSS_HOME: /tmp/jboss-4.0.4.GA

  JAVA: java

  JAVA_OPTS: -server -Xms128m -Xmx512m -Dsun.rmi.dgc.client.gcInterval=3600000 
             -Dsun.rmi.dgc.server.gcInterval=3600000 -Dprogram.name=run.sh

  CLASSPATH: /tmp/jboss-4.0.4.GA/bin/run.jar:/lib/tools.jar
            
=========================================================================

23:28:48,561 INFO  [Server] Starting JBoss (MX MicroKernel)
...
23:29:09,249 INFO  [Server] JBoss (MX MicroKernel) [4.0.4.GA (build: 
  CVSTag=JBoss_4_0_4_GA date=200605151000)] Started in 20s:679ms

If your output is similar to this (accounting for installation directory differences), you are now be ready to use JBoss.

Using run.sh without any arguments starts the server using the default server configuration file set. To start with an alternate configuration file set, you pass in the name of the directory under JBOSS_DIST/server that you want to use as the value to the -c command line option. For example, to start with the minimal configuration file set you would specify:

$ ./run.sh -c minimal
...
23:37:41,582 INFO  [Server] JBoss (MX MicroKernel) [4.0.4.GA (build: 
  CVSTag=JBoss_4_0_4_GA date=200605151000)] Started in 2s:212ms

The run script supports the following options:

usage: run.sh [options]
  -h, --help                  Show this help message
  -V, --version               Show version information
  --                          Stop processing options
  -D<name>[=<value>]          Set a system property
  -d, --bootdir=<dir>         Set the boot patch directory; Must be absolute or url
  -p, --patchdir=<dir>        Set the patch directory; Must be absolute or url
  -n, --netboot=<url>         Boot from net with the given url as base
  -c, --configuration=<name>  Set the server configuration name
  -B, --bootlib=<filename>    Add an extra library to the front bootclasspath
  -L, --library=<filename>    Add an extra library to the loaders classpath
  -C, --classpath=<url>       Add an extra url to the loaders classpath
  -P, --properties=<url>      Load system properties from the given url
  -b, --host=<host or ip>     Bind address for all JBoss services
  -g, --partition=<name>      HA Partition name (default=DefaultDomain)
  -u, --udp=<ip>              UDP multicast address
  -l, --log=<log4j|jdk>       Specify the logger plugin type

To shutdown the server, you simply issue a Ctrl-C sequence in the console in which JBoss was started. Alternatively, you can use the shutdown.sh command.

[bin]$ ./shutdown.sh -S

The shutdown script supports the following options:

A JMX client to shutdown (exit or halt) a remote JBoss server.

usage: shutdown [options] <operation>

options:
  -h, --help              Show this help message (default)
  -D<name>[=<value>]      Set a system property
  --                      Stop processing options
  -s, --server=<url>      Specify the JNDI URL of the remote server
  -n, --serverName=<url>  Specify the JMX name of the ServerImpl
  -a, --adapter=<name>    Specify JNDI name of the MBeanServerConnection to use
  -u, --user=<name>       Specify the username for authentication
  -p, --password=<name>   Specify the password for authentication

operations:
  -S, --shutdown          Shutdown the server
  -e, --exit=<code>       Force the VM to exit with a status code
  -H, --halt=<code>       Force the VM to halt with a status code

Use of the shutdown command requires a server configuration that contains jmx-invoker-service.xml service, so the shutdown command cannot be used with the minimal configuration.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值