# Configuration Guide

# Starting and Stopping the Controller and Agents

This section describes how to start and stop WLOC Controllers and Agents.

- Starting an Agent
- Starting the Controller
- Accessing the WLOC Administration Console
- Stopping an Agent
- Stopping the Controller
- Running the Controller and Agents as Windows Services
- Unexpected Shutdowns

## Starting an Agent

To start an Agent:

1. Change to the directory where the Agent was created. The default directory is `BEA_HOME``\user_projects\agent1`.
2. Open a command window and run `.\bin\startAgent.sh` (UNIX or Linux) or `.\bin\startAgent`.`cmd` (Windows).

## Starting the Controller

To start a Controller:

1. Change to the directory where the Controller was created. The default directory is `BEA_HOME``\user_projects\controller`.
2. Open a command window and run `.\bin\startController.sh` (UNIX or Linux) or `.\bin\startController`.`cmd` (Windows).

## Accessing the WLOC Administration Console

The WLOC Administration Console starts when you start the Controller. You can access the console using a web browser.

- For HTTP connection, the URL is: `http://``hostname:port``/wloc-console`
- For HTTPS, the URL is: `https://``hostname:port``/wloc-console`

where

`hostname` is the host name or IP address

`port` is the port specified when the Controller was configured. The HTTP default is `9001`; the HTTPS default is `9002`.

The default user name and password for the WLOC Administration Console are WLOCBootUser and changeit.

## Stopping an Agent

To stop an Agent using the Administration Console, do one of the following:

- Select the Agents tab at the top of any console page to display a list of Agents. Select the Agent’s check box and click Shutdown.
- Right-click the name of the Agent in the Inventory pane and select Shutdown Agent from the context menu.

As an alternative to shutting down an Agent, you can disconnect it. The Controller cannot deploy services to a disconnected Agent.

## Stopping the Controller

To stop the Controller using the Administration Console:

1. Select the Controller tab at the top of any console page.
2. In the Controller page, select the Control tab.
3. Click Shutdown Controller.

Stopping the Controller also shuts down the Administration Console application.

## Running the Controller and Agents as Windows Services

WLOC provides scripts that allow you to set up the Controller and Agent(s) to run as Windows services.

Note: | To run a WLOC Agent as a Windows service, it must be run on a local disk drive. Running the Agent as a Windows service from a mapped drive is not supported.

To set up a Controller or Agent to run as a Windows service, open a Command Prompt window and enter one of the following commands:

- For the Controller, enter: `BEA_HOME/user_projects``/``controller``/bin/install_ControllerService.cmd`
- For an Agent, enter: `BEA_HOME/user_projects``/``agent``/bin/install_AgentService.cmd`

When the script completes, the service will be configured to start automatically upon system boot and run using the Local System account.

You can revert to running the Controller or Agent from a command line by removing the Windows service. Use one of the following commands:

- For the Controller, enter: `BEA_HOME/user_projects``/``controller``/bin/remove_ControllerService.cmd`
- For an Agent, enter: `BEA_HOME/user_projects``/`agent`/bin/remove_AgentService.cmd`

## Unexpected Shutdowns

The unexpected shutdown of a WLOC Agent does not impact the operation of the Controller. When the Agent is rebooted, it will attempt to reconnect to its managed resources. The Controller will poll for disconnected Agents periodically (once for every `heartbeat-interval` configured in `loc-controller-config.xml`) and re-establish the connection with the Agent when it becomes available.

If the Controller shuts down unexpectedly, the Agents to which it connects will continue to collect and locally store information from its managed resources. Once the Controller restarts and re-establishes connections with the Agents, they will then send that information to the Controller.