---
title: dhconfig routing
sidebar_label: Routing
---

The `routing` (or `datarouting`) configuration data type of the [`dhconfig`](./overview.md) tool is used to work with the data routing configuration.

```text
dhconfig routing [import|export|validate|help] [arguments]
```

> [!NOTE]
> Many Deephaven processes [respond dynamically](../data-routing-overview.md#data-routing-configuration-changes-are-dynamic) to data routing configuration changes.

As with other `dhconfig` configuration data types, the `--help` argument provides detailed information on the available actions and arguments, as well as usage examples. Use `--help` whenever you need more information about the available actions. For example, if you want information about the `import` action, you can run:

```bash
dhconfig routing import --help
```

Which prints the following:

```text
usage: dhconfig routing import [--configfile <arg>] [--diskprops] [--etcd] [-f <arg>] [-h] [-k <arg> | -user <arg>] [-pf
       <arg>]  [-v]
Import data routing configuration from a file.
```

A description of all the subcommand's options and some usage examples follows.

Due to the number of available actions and combinations, an exhaustive list of all possible commands is not provided here. Instead, we will give some usage examples and recommend that you use the `--help` argument as needed for more information.

## Examples

### `export`

Print the data routing configuration:

```bash
/usr/illumon/latest/bin/dhconfig routing export
```

Export data routing configuration to `/tmp/routing.yml`:

```bash
/usr/illumon/latest/bin/dhconfig routing export --file /tmp/routing.yml
```

```bash
/usr/illumon/latest/bin/dhconfig routing export /tmp/routing.yml
```

### `import`

> [!NOTE]
> Import actions require authentication, with `sudo`, `--key`, or `--user`.
>
> Unless the `--etcd` option is used, the authenticated user must be in the superusers group (`iris-superusers` by default) or in a group authorized for data routing service changes via by the `DataRoutingService.writers` property, which must be visible to the configuration server:
>
> ```
> DataRoutingService.writers=group1,group2
> ```

Import data routing configuration from `/tmp/routing.yml`:

```bash
sudo -u irisadmin /usr/illumon/latest/bin/dhconfig routing import --file /tmp/routing.yml
```

Import data routing configuration from `/tmp/routing.yml`, bypassing configuration server (requires `sudo`):

```bash
sudo -u irisadmin /usr/illumon/latest/bin/dhconfig routing import --file /tmp/routing.yml --etcd
```

| Argument          | Description                                                                                                               |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------- |
| `--file <arg>`    | Name of a file to import/update. Optional; defaults to property `DataRoutingService.configFile` or `routing_service.yml`. |
| `--ignore-errors` | Import even when non-fatal validation issues are detected. Use with caution.                                              |

> [!NOTE]
> A `whereLocationKey` filter that references `InternalPartition` must also account for the aggregate-key placeholder (`TableLocationKey.NULL_PARTITION`), otherwise DIS `truncate`/`delete` commands routed through that DIS will be rejected. `import` and `edit` will fail unless the filter includes a clause such as `InternalPartition == TableLocationKey.NULL_PARTITION || ...`, or unless `--ignore-errors` is supplied. See [the `whereLocationKey` section of the YAML reference](../yaml.md#query-language-filters) for details.

> [!NOTE]
> You cannot use `dhconfig routing` to validate or import both the main routing configuration file and additional, separately managed DIS files in a single command. If you need to work with both at once, use [`dhconfig dis`](./dis.md) with the `--routing-file` option.
>
> For example:
>
> ```bash
> dhconfig dis import --routing-file /tmp/routing.yml --file /tmp/dis1.yml --file /tmp/dis2.yml
> ```

### `validate`

Check `/tmp/routing.yml` for errors:

```bash
/usr/illumon/latest/bin/dhconfig routing validate --file /tmp/routing.yml
/usr/illumon/latest/bin/dhconfig routing validate --file /tmp/routing.yml --verbose
```

## Related documentation

- [dhconfig overview](./overview.md)
- [`dhconfig dis`](./dis.md)
