# 複数のLDAPサーバーの使用

## 自動DockerまたはDocker Compose <a href="#auto-docker-or-docker-compose" id="auto-docker-or-docker-compose"></a>

DockerバージョンのKCMを使用する際、以下のように `docker-compose.yml` ファイル内の `guacamole` サービスの `environment` セクションで環境変数 `LDAP_SERVERS` を使用して、複数のLDAPサーバーを記載できます。

```
version: "3"
services:
    guacamole:
        image: keeper/guacamole:2
        restart: unless-stopped
        depends_on:
            - guacd
            - db
        environment:
            ACCEPT_EULA: "Y"
            GUACD_HOSTNAME: "guacd"
            LDAP_SERVERS: |
              - hostname: server1.example.net
                user-base-dn: OU=Users,DC=example,DC=net
                username-attribute: sAMAccountName
                search-bind-dn: CN=Guacamole,OU=Services,DC=example,DC=net
                search-bind-password: SomePassword!

              - hostname: server2.example.net
                user-base-dn: OU=Users,DC=example,DC=net
                username-attribute: sAMAccountName
                search-bind-dn: CN=Guacamole,OU=Services,DC=example,DC=net
                search-bind-password: SomePassword! 
                
```

{% hint style="info" %}
`LDAP_SERVERS` を使用すると、`guacamole` コンテナ内に `/etc/guacamole/ldap-servers.yml` が自動的に作成されます。
{% endhint %}

{% hint style="warning" %}
`docker-compose.yml` で `LDAP_SERVERS` を使用する際は、`ldap-servers.yml` ファイルをボリュームマウントしないでください (自動的に処理されます)。高度なインストールまたはDocker以外のインストールについては、[こちらのページ](/keeper-connection-manager/jp/authentication/authenticating-users-with-ldap/noldapsbno-linux-rpm.md)をご参照ください。
{% endhint %}


---

# 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://docs.keeper.io/keeper-connection-manager/jp/authentication/authenticating-users-with-ldap/using-multiple-ldap-servers.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.
