此内容没有您所选择的语言版本。

Chapter 2. Installing a Broker as a Windows Service


Abstract

In this tutorial you will install a Red Hat JBoss A-MQ instance as a Windows service.

Goals

In this tutorial you will:
  • generate the service wrapper
  • configure the Java Wrapper Service for your system
  • install a broker instance as a Windows service
  • configure the broker's service to start up automatically

Prerequisites

This tutorial requires that you have Red Hat JBoss A-MQ installed on a Windows computer to which you have administrative privileges.

Procedure

To install JBoss A-MQ as a Windows service:
  1. Start JBoss A-MQ in console mode using the amq command.
  2. Once the console is started and the command prompt appears, enter features:install wrapper.
    The features:install command will locate the required libraries to provision the wrapper feature and deploy it into the run time.
  3. Generate the wrapper by entering wrapper:install -n JBossMQ -d JBossMQ -D "JBossMQ Broker".
    You should see the output shown in Example 2.1, “Wrapper Install Output”.

    Example 2.1. Wrapper Install Output

    Creating file: InstallDir\bin\FuseMQ-wrapper.exe Creating file: InstallDir\bin\JBossMQ-service.bat Creating file: InstallDir\etc\JBossMQ-wrapper.conf Creating file: InstallDir\lib\libwrapper.so Creating file: InstallDir\lib\karaf-wrapper.jar Creating file: InstallDir\lib\karaf-wrapper-main.jar Setup complete. You may wish to tweak the JVM properties in the wrapper config ration file: InstallDir\etc\JBossMQ-wrapper.conf before installing and starting the service. To install the service, run: C:> InstallDir\bin\JBossMQ-service.bat install Once installed, to start the service run: C:> net start "JBossMQ" Once running, to stop the service run: C:> net stop "JBossMQ" Once stopped, to remove the installed the service run: C:> InstallDir\bin\karaf-service.bat remove
  4. Open InstallDir\etc\JBossMQ-wrapper.conf in a text editor.
    The ServiceName-wrapper.conf file configures the Java Wrapper Service that JBoss A-MQ uses to create a Windows service.
  5. Change the line containing set.default.KARAF_HOME= to
    set.default.KARAF_HOME=InstallDir
    This tells the wrapper where the JBoss A-MQ installation is located so it can find the required libraries.
  6. Change the line containing set.default.KARAF_BASE to
    set.default.KARAF_BASE=InstallDir
    This tells the wrapper where to find the configuration and data files for the broker instance being used for the service.
  7. Change the line containing set.default.KARAF_DATA to
    set.default.KARAF_BASE=InstallDir\data
    This tells the wrapper where to find the configuration and data files for the broker instance being used for the service.
  8. Save the file.
  9. Open a command prompt.
  10. Change to the InstallDir directory.
  11. Install the broker as a Windows service by running bin\JBossMQ-service.bat install.
  12. From the Windows Start menu select Start Control Panel Administrative Tools Services.
    The Services window opens.
  13. Double click JBossMQ from the list of services.
    The JBossMQ Properties window opens.
  14. Specify that the service will start up when you login by selecting Automatic from the Startup Type drop-down list.
  15. Click OK.
  16. Open the context menu for the JBossMQ entry in the service list.
  17. Select Start to start the broker.

Further steps

You can stop the broker service by selecting Stop in the Service window's context menu.
To uninstall the broker as a Windows service use InstallDir\bin\JBossMQ-service.bat removes.
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.