<a id="howto-replicators-manage"></a>

# How to manage replicators

<a id="howto-replicators-view"></a>

## View replicators

CLI

To list all replicators in the current project, run:

```none
lxc replicator list
```

To view the configuration for a specific replicator, run:

```none
lxc replicator show <replicator_name>
```

To view the current state and job information for a specific replicator, run:

```none
lxc replicator info <replicator_name>
```

API

To list all replicators in the current project, send the following request:

```none
lxc query --request GET /1.0/replicators?project=<project_name>
```

To display detailed information about each replicator, use [Recursion](https://canonical.com/lxd/docs/latest/rest-api/index.html.md#rest-api-recursion):

```none
lxc query --request GET /1.0/replicators?project=<project_name>&recursion=1
```

See [`GET /1.0/replicators`](/lxd/latest/api/#/replicators/replicators_get) and [`GET /1.0/replicators?recursion=1`](/lxd/latest/api/#/replicators/replicators_get_recursion1) for more information.

To view the configuration of a specific replicator, send the following request:

```none
lxc query --request GET /1.0/replicators/<name>?project=<project_name>
```

See [`GET /1.0/replicators/{name}`](/lxd/latest/api/#/replicators/replicator_get) for more information.

To view the current state and job information for a specific replicator, send the following request:

```none
lxc query --request GET /1.0/replicators/<name>/state?project=<project_name>
```

See [`GET /1.0/replicators/{name}/state`](/lxd/latest/api/#/replicators/%7Bname%7D/state/replicator_state_get) for more information.

UI

Click Clustering in the navigation sidebar, then select Replicators from the expanded drop-down list.

To view the configuration for a specific replicator, click on the replicator’s name.

<a id="howto-replicators-modify"></a>

## Configure a replicator

See [Replicator configuration](https://canonical.com/lxd/docs/latest/reference/replicator_config/index.html.md#ref-replicator-config) for all available configuration options.

CLI

To edit the entire configuration of a replicator at once in your default text editor, run:

```none
lxc replicator edit <replicator_name>
```

You can also update a single configuration option for a replicator:

```none
lxc replicator set <replicator_name> <key>=<value>
```

To unset a configuration key, run:

```none
lxc replicator unset <replicator_name> <key>
```

API

To edit the entire configuration of a replicator, send the following request:

```none
lxc query --request PUT /1.0/replicators/<name>?project=<project_name> --data "<replicator_configuration>"
```

See [`PUT /1.0/replicators/{name}`](/lxd/latest/api/#/replicators/replicator_put) for more information.

You can also update a single configuration option for a replicator:

```none
lxc query --request PATCH /1.0/replicators/<name>?project=<project_name> --data '{"config": {"<key>": "<value>"}}'
```

See [`PATCH /1.0/replicators/{name}`](/lxd/latest/api/#/replicators/replicator_patch) for more information.

UI

To edit a replicator, click on the pencil icon at the end of that replicator’s row, then set configuration options in the side panel.

Alternatively, click on a replicator name to view its detail page, then click on the Edit button in the header.

<a id="howto-replicators-rename"></a>

## Rename a replicator

CLI

```none
lxc replicator rename <replicator_name> <new_name>
```

API

```none
lxc query --request POST /1.0/replicators/<name>?project=<project_name> --data '{"name": "<new_name>"}'
```

See [`POST /1.0/replicators/{name}`](/lxd/latest/api/#/replicators/replicator_post) for more information.

UI

To rename a replicator, click on a replicator name to view its detail page. Then click on the replicator name in the header, enter the new name, and click Save.

<a id="howto-replicators-delete"></a>

## Delete a replicator

CLI

```none
lxc replicator delete <replicator_name>
```

API

```none
lxc query --request DELETE /1.0/replicators/<name>?project=<project_name>
```

See [`DELETE /1.0/replicators/{name}`](/lxd/latest/api/#/replicators/replicator_delete) for more information.

UI

To delete a replicator, click on the trash can icon at the end of that replicator’s row.

Alternatively, click on a replicator name to view its detail page, then click on the Delete button in the header.

## Related topics

How-to guides:

* [How to set up replicators](https://canonical.com/lxd/docs/latest/howto/replicators_create/index.html.md#howto-replicators-setup)
* [How to perform disaster recovery with replicators](https://canonical.com/lxd/docs/latest/howto/disaster_recovery_replicators/index.html.md#howto-replicators-dr)

Reference:

* [Replicator configuration](https://canonical.com/lxd/docs/latest/reference/replicator_config/index.html.md#ref-replicator-config)
