Java Reference
In-Depth Information
Restarting servers in a domain
A common requirement for the domain administrator is to restart the application serv-
er nodes, for example, when some server libraries are updated. The CLI provides
a handy shortcut for stopping and starting all the servers that are part of a server
group:
connect
/server-group=main-server-group:start-servers
/server-group=main-server-group:stop-servers
If you prefer a more granular approach, you can start the single server nodes as
shown in the following example, which shows how you can apply a conditional exe-
cution logic in your CLI scripts:
connect
if (result == "STARTED") of /host=master/
server-config=server-one:read-attribute(name=status)
/host=master/server-config=server-one:stop
end-if
if (result == "STARTED") of /host=master/
server-config=server-two:read-attribute(name=status)
/host=master/server-config=server-two:stop
end-if
/host=master/server-config=server-one:start
/host=master/server-config=server-two:start
In the if end-if section, we are checking for the server's status attribute. If the
status is "STARTED" , the application servers are stopped and then restarted.
Search WWH ::




Custom Search