# サーバー間通信 - Mesh

Diarkis のサーバーは、互いに通信することで他のサーバーから情報を取得や同期を実施したり、特定の操作を実行することができます。

## Mesh 設定

設定は各 HTTP/TCP/UDP サーバーにて実施します。

各サーバーで [diarkisexec.SetupDiarkis()](https://docs.diarkis.io/docs/server/v1.0.0-rc1/diarkis/diarkisexec/index.html) を実行する際に JSON ファイルのパスを指定し、以下のように MARS サーバーのアドレスおよび設定を記述します。パスや JSON ファイルのキーが空の場合はデフォルトの設定となります。

```json
{
  "nic": "eth0",
  "marsAddress": "mars.base.svc.cluster.local",
  "marsPort": "6779",
  "marsAddressCacheTTL": 60,
  "retryInterval": 1000,
  "reliableRetryTimeout": 3000
}
```

<table><thead><tr><th width="234">キー</th><th width="119">デフォルト</th><th></th></tr></thead><tbody><tr><td>nic</td><td>"eth0"</td><td>アドレスを取得するインターフェース名。アドレスが未指定の場合に利用します。</td></tr><tr><td>marsAddress</td><td>"127.0.0.1"</td><td>バインドする UDP サーバーのアドレス</td></tr><tr><td>marsPort</td><td>"6779"</td><td>UDP サーバーがバインドするためのポート。UDP サーバーは、指定されたポートから始まる利用可能なポートを自動的に探します。</td></tr><tr><td>marsAddressCacheTTL</td><td>60</td><td>MARS アドレス・キャッシュの TTL</td></tr><tr><td>retryInterval</td><td>1000</td><td>Mesh パケットの再試行間隔（ミリ秒）</td></tr><tr><td>reliableRetryTimeout</td><td>3000</td><td>Mesh パケットのタイムアウト（ミリ秒）</td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.diarkis.io/diarkis-server/mesh.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
