此内容没有您所选择的语言版本。
Chapter 29. Managing servers
The Servers view lets you run and manage servers in your Red Hat JBoss Developer Studio environment. The supported servers are:
- Red Hat JBoss Fuse Server — versions 6.2+ and 6.3
- Red Hat JBoss Enterprise Application Platform — version 6.4
For step by step instructions on how to publish a Camel project to Red Hat JBoss Fuse, see .
29.1. Adding a Server
Overview
For the tooling to manage a server, you need to add the server to the Servers list. Once added, the server appears in the Servers view, where you can connect to it and publish your Fuse Integration projects.
If adding a Red Hat JBoss Fuse 6.2+ or 6.3 server, it is recommended that you edit its installDir/etc/users.properties
file and add user information, in the form of user=password,role
, to enable the tooling to establish an SSH connection to the server.
Procedure
There are three ways to add a new server to the Servers view:
In the Servers view, click
No servers are available. Click this link to create a new server…
.NoteThis link appears in the Servers view only when no server has been defined. If you defined and added a server when you first created your project, the Servers view displays that server.
-
In the Servers view, right-click to open the context menu and select
. -
On the menu bar, select
.
In the Define a New Server dialog, to add a new server:
Expand the Red Hat JBoss Middleware node to expose the list of available server options:
- Click the server you want to add.
In the Server’s host name field, accept the default (
localhost
).NoteThe address of
localhost
is0.0.0.0
.- In the Server name field, accept the default, or enter a different name for the runtime server.
Click Runtime definition page:
to open the server’sNoteIf the server is not already installed on your machine, you can install it now by clicking Download and install runtime… and following the site’s download instructions. Depending on the site, you may be required to provide valid credentials before you can continue the download process.
- Accept the default for the installation Name.
- In the Home Directory field, enter the path where the server runtime is installed, or click to find and select it.
Next to Execution Environment, select the runtime JRE from the drop-down menu.
If the version you want does not appear in the list, click
and select the version from the list that appears. The JRE version you select must be installed on your machine.NoteJBoss Fuse 6.3 requires either JRE version 1.8 or 1.7.
- Leave the Alternate JRE option as is.
Click Configuration details page:
to save the server’s runtime definition and open itsAccept the default for SSH Port (
8101
).The runtime uses the SSH port to connect to the server’s Karaf shell. If this default is incorrect for your setup, you can discover the correct port number by looking in the server’s installDir
/etc/org.apache.karaf.shell.cfg
file.In the User Name field, enter the name used to log into the server.
For Red Hat JBoss Fuse, this is a user name stored in the Red Hat JBoss Fuse installDir
/etc/users.properties
file.NoteIf the default user has been activated (uncommented) in the
/etc/users.properties
file, the tooling autofills the User Name and Password fields with the default user’s name and password, as shown in [servCnfigDetails]. The default user is already activated in JBoss Fuse 6.2, but not in JBoss Fuse 6.0 or 6.1.If a user has not been set up, you can either add one to that file by using the format
user=password,role
(for example,joe=secret,Administrator
), or you can set one using the karafjaas
command set:-
jaas:realms
— to list the realms -
jaas:manage --index 1
— to edit the first (server) realm -
jaas:useradd <username> <password>
— to add a user and associated password -
jaas:roleadd <username> Administrator
— to specify the new user’s role -
jaas:update
— to update the realm with the new user information
If a
jaas
realm has already been selected for the server, you can discover the user name by issuing the commandJBossFuse:karaf@root>
jaas:users
.-
- In the Password field, enter the password required for User Name to log into the server.
Click
to save the server’s configuration details.The server runtime appears in the Servers view. For example:
Expanding the server node exposes the server’s JMX node:
29.2. Starting a Server
Overview
When you start a configured server, the tooling opens the server’s remote management console in the Terminal view. This allows you to easily manage the container while testing your application.
Procedure
To start a server:
- In the Servers view, select the server you want to start.
Click .
The Console view opens and displays a message asking you to wait while the container is starting, for example:
NoteIf you did not properly configure the user name and password for opening the remote console, a dialog opens asking you to enter the proper credentials. See Section 29.1, “Adding a Server”.
After the container has started up, the Terminal view opens to display the container’s management console; for example:
The running server appears in the Servers view:
The running server also appears in the JMX Navigator view under Server Connections:
NoteIf the server is running on the same machine as the tooling, the server also has an entry under Local Processes.
29.3. Connecting to a Running Server
Overview
After you start a configured server, it appears in the Servers view and in the JMX Navigator view under the Server Connections node. You may need to expand the Server Connections node to see the server.
To publish and test your Fuse project application on the running server, you must first connect to it. You can connect to a running server either in the Servers view or in the JMX Navigator view.
The Servers view and the JMX Navigator view are synchronized with regards to server connections. That is, connecting to a server in the Servers view also connects it in the JMX Navigator view, and vice versa.
Connecting to a running server in the Servers view
- In the Servers view, expand the server runtime to expose its JMX[Disconnected] node.
Double-click the JMX[Disconnected] node:
Viewing bundles installed on the connected server
- In either the Servers view or the JMX Navigator view, expand the server runtime tree to expose the Bundles node, and select it.
The tooling populates the Properties view with a list of bundles that are installed on the server:
Using the Properties view’s Search tool, you can search for bundles by their Symbolic Name or by their Identifier, if you know it. As you type the symbolic name or the identifier, the list updates, showing only the bundles that match the current search string.
NoteAlternatively, you can issue the
osgi:list
command in the Terminal view to see a generated list of bundles installed on the JBoss Fuse server runtime. The tooling uses a different naming scheme for OSGi bundles displayed by theosgi:list
command.In the
<build>
section of project’spom.xml
file, you can find the bundle’s symbolic name and its bundle name (OSGi) listed in themaven-bundle-plugin
entry. For more details, see the section called “Verifying the project was published to the server”.
29.4. Disconnecting from a Server
Overview
When you are done testing your application, you can disconnect from the server without stopping it.
The Servers view and the JMX Navigator view are synchronized with regards to server connections. That is, disconnecting from a server in the Servers view also disconnects it in the JMX Navigator view, and vice versa.
Disconnecting from a server in the Servers view
- In the Servers view, expand the server runtime to expose its JMX[Connected] node.
Right-click the JMX[Connected] node to open the context menu, and then select Disconnect.
29.5. Stopping a Server
Overview
You can shut down a server in the Servers view or in the server’s remote console in the Terminal view.
Using the Servers view
To stop a server:
- In the Servers view, select the server you want to stop.
- Click .
Using the remote console
To stop a server:
- Open the Terminal view that is hosting the server’s remote console.
- Type CTRL+D.
29.6. Deleting a Server
Overview
When you are finished with a configured server, or if you misconfigure a server, you can delete it and its configuration.
First, delete the server from the Servers view or from the JMX Navigator view. Next, delete the server’s configuration.
Deleting a server
- In the Servers view, right-click the server you want to delete to open the context menu.
- Select Delete.
- Click .
Deleting the server’s configuration
On the menu bar, select
. NoteOn Linux and Windows machines, select menu:[Window > Preferences].
- Expand the Server folder, and then select Runtime Environments to open the Server Runtime Environments page.
- From the list, select the runtime environment of the server that you previously deleted from the Servers view, and then click .
- Click .