Example syntax for the <server> element
The following example illustrates how to use the <server>
element of the <registry> element in
config.xml to set various server properties.
<registry roles="...,...,...,...">
<server env="..." serverid="..." roles="..." />
</registry>
Use the roles attribute to list the valid server roles for your
installation. However, the existence of the <server> element
is a legacy artifact. Guidewire discourages the use of the
<server> element. Instead, use JVM options to set these
values.
Using a JVM option to set server properties
Guidewire recommends that you set server system properties using a
-D JVM option from a command prompt at server startup. For
example, you can use JVM options to set the environment variable
(env) and the server ID and server roles
(serverid) at runtime using the syntax listed in the following
table. The option syntax varies by server type. Notice the entries for
serverid. The use of a starting # mark indicates that the
following text is a server role and not a server ID.
| Server type | Syntax | Example |
|---|---|---|
|
QuickStart (Jetty) |
|
gwb runServer -Denv=test2
|
|
Tomcat |
|
|
-Dgw.pc.serverid=testServer
For more information, see Start the application server from Guidewire Studio for PolicyCenter.
How PolicyCenter uses a -D JVM
option
The values of env and serverid are immutable while
the server is running.
PolicyCenter determines the value of a
-D option in the following manner, using
-Dserverid (on Jetty) as an example:
- If you specify a
-Dserverid=prodserverJVM option at the command prompt at server startup, PolicyCenter sets the value ofserveridfor that server toprodserver. - If you do not specify a
-DserveridJVM option at server start, PolicyCenter checks the server registry for aserveridvalue defined by aserverentry. If found, PolicyCenter uses that value. In the example, theserveridvalue isprodserver. - If you do not specify the JVM option, and no
serveridvalue defined by aserverentry exists, PolicyCenter setsserveridto the host name of the computer. Under some extreme security settings, this value is not available, in which case PolicyCenter sets theserveridtolocalhost.
serverid value. Viewing server information in PolicyCenter
PolicyCenter shows the serverid and
role values for each server in a PolicyCenter cluster on the Server Tools Cluster
Members and Components screens. You must log in as an administrative
user to access the Server Tools.
