---
title: "Locator Configuration for a Server"
url: https://docs.zeroc.com/ice/3.8/runtime/locators/locator-configuration-for-a-server
docs_index: https://docs.zeroc.com/llms.txt
---

> For an index of every page, see [llms.txt](https://docs.zeroc.com/llms.txt).

# Locator Configuration for a Server

This page is written for C++, C#, Java, Python, and Swift.

## Configuring an Object Adapter with a Locator

An [object adapter](https://docs.zeroc.com/ice/3.8/runtime/dispatch.md) must be able to obtain a [locator](https://docs.zeroc.com/ice/3.8/runtime/locators.md) proxy in order to register itself with a location service. Each object adapter can be configured with its own locator proxy by defining its [Locator](https://docs.zeroc.com/ice/3.8/property-reference/object-adapter-properties.md) property, as shown in the example below for the object adapter named `SampleAdapter`:

```config
SampleAdapter.Locator=IceGrid/Locator:tcp -h locatorhost -p 10000
```

Alternatively, a server may call `setLocator` on the object adapter prior to activation. If the object adapter is not explicitly configured with a locator proxy, it uses the [default locator](https://docs.zeroc.com/ice/3.8/runtime/locators/locator-configuration-for-a-client.md) as provided by its communicator.

Two other configuration properties influence an object adapter's interactions with a location service during activation:

- [AdapterId](https://docs.zeroc.com/ice/3.8/property-reference/object-adapter-properties.md) Configuring a non-empty identifier for the `AdapterId` property causes the object adapter to register itself with the location service. A locator proxy must also be configured.
- [ReplicaGroupId](https://docs.zeroc.com/ice/3.8/property-reference/object-adapter-properties.md) Configuring a non-empty identifier for the `ReplicaGroupId` property indicates that the object adapter is a member of a [replica group](https://docs.zeroc.com/ice/3.8/basics/terminology.md). For this property to have an effect, `AdapterId` must also be configured with a non-empty value.

We can use these properties as shown below:

```config
SampleAdapter.AdapterId=SampleAdapterId
SampleAdapter.ReplicaGroupId=SampleGroupId
SampleAdapter.Locator=IceGrid/Locator:tcp -h locatorhost -p 10000
```

## Registering a Process with a Locator

A location service, such as [IceGrid](https://docs.zeroc.com/ice/3.8/services/icegrid.md), requests a graceful shutdown of a server through the server's [Process facet](https://docs.zeroc.com/ice/3.8/administration/administrative-facility/process-facet.md). IceGrid enables the [administrative facility](https://docs.zeroc.com/ice/3.8/administration/administrative-facility.md) on the servers that it activates.

The communicator registers the `Process` facet with the location service when it creates the admin object, provided [Ice.Admin.ServerId](https://docs.zeroc.com/ice/3.8/property-reference/ice-admin-properties.md#ice.admin.serverid) is configured and the communicator has a default locator: it calls `setServerProcessProxy` on the locator registry with the server ID and a proxy for the `Process` facet. See [Registering the Process Facet with the Location Service](https://docs.zeroc.com/ice/3.8/administration/administrative-facility/process-facet.md#registering-the-process-facet-with-the-location-service) for details.

## See Also

- [Object Adapters](https://docs.zeroc.com/ice/3.8/runtime/dispatch.md)
- [Locators](https://docs.zeroc.com/ice/3.8/runtime/locators.md)
- [Locator Configuration for a Client](https://docs.zeroc.com/ice/3.8/runtime/locators/locator-configuration-for-a-client.md)
- [Locator Semantics for Servers](https://docs.zeroc.com/ice/3.8/runtime/locators/locator-semantics-for-servers.md)
- [The Process Facet](https://docs.zeroc.com/ice/3.8/administration/administrative-facility/process-facet.md)
- [Administrative Facility](https://docs.zeroc.com/ice/3.8/administration/administrative-facility.md)
- [Ice.Admin.\*](https://docs.zeroc.com/ice/3.8/property-reference/ice-admin-properties.md)
- [IceGrid](https://docs.zeroc.com/ice/3.8/services/icegrid.md)
