> ## Documentation Index
> Fetch the complete documentation index at: https://clickhouse.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# user_* サーバー設定

> user_* 生成グループに含まれる ClickHouse サーバー設定。

これらの設定は ClickHouse サーバーを構成するもので、ClickHouse のソースコードから自動生成されています。

## user\_directories

以下の設定を含む設定ファイルのセクションです。

* 事前定義されたユーザーが記述された設定ファイルへのパス。
* SQL コマンドで作成されたユーザーが保存されるフォルダーへのパス。
* SQL コマンドで作成されたユーザーが保存され、レプリケートされる ZooKeeper ノードのパス。

このセクションが指定されている場合、[users\_config](https://clickhouse.com/docs/ja/reference/settings/server-settings/settings/users.md#users_config) と [access\_control\_path](https://clickhouse.com/docs/ja/reference/settings/server-settings/settings/access-control.md#access_control_path) のパスは使用されません。

`user_directories` セクションには任意の数の項目を含めることができ、項目の順序はその優先順位を示します (上にある項目ほど優先順位が高くなります) 。

**例**

```xml theme={null}
<user_directories>
    <users_xml>
        <path>/etc/clickhouse-server/users.xml</path>
    </users_xml>
    <local_directory>
        <path>/var/lib/clickhouse/access/</path>
    </local_directory>
</user_directories>
```

ユーザー、ロール、行ポリシー、クォータ、プロファイルはZooKeeper に保存することもできます：

```xml theme={null}
<user_directories>
    <users_xml>
        <path>/etc/clickhouse-server/users.xml</path>
    </users_xml>
    <replicated>
        <zookeeper_path>/clickhouse/access/</zookeeper_path>
    </replicated>
</user_directories>
```

`memory` セクションを定義することもできます。これは、情報をディスクに書き込まず、メモリ上にのみ保持することを意味します。`ldap` は、LDAP サーバー上に情報を保存することを意味します。

ローカルで定義されていないユーザー用のリモートユーザーディレクトリとして LDAP サーバーを追加するには、以下の設定を含む単一の `ldap` セクションを定義します。

| Setting | Description |
| - | - |
| `roles` | LDAP サーバーから取得した各ユーザーに割り当てる、ローカルで定義されたロールの一覧を含むセクション。ロールが指定されていない場合、ユーザーは認証後にいかなる操作も実行できません。一覧内のいずれかのロールが認証時点でローカルに定義されていない場合、認証の試行は、指定されたパスワードが正しくない場合と同様に失敗します。 |
| `server` | `ldap_servers` config セクションで定義された LDAP サーバー名の 1 つです。このパラメータは必須で、空にすることはできません。 |

**例**

```xml theme={null}
<ldap>
    <server>my_ldap_server</server>
        <roles>
            <my_local_role1 />
            <my_local_role2 />
        </roles>
</ldap>
```

## user\_files\_path

型

String

デフォルト値

/var/lib/clickhouse/user\_files/

再起動せずに変更可能

No

ユーザーファイルを格納するディレクトリです。[file()](https://clickhouse.com/docs/ja/reference/functions/table-functions/file.md)、[fileCluster()](https://clickhouse.com/docs/ja/reference/functions/table-functions/fileCluster.md) のテーブル関数で使用されます。

**例**

```xml theme={null}
<user_files_path>/var/lib/clickhouse/user_files/</user_files_path>
```

## user\_profile\_events\_per\_cpu

型 Bool デフォルト値 1 再起動せずに変更可能 Noスレッド数が多い場合の CPU 間での cache-line contention を避けるため、ユーザーごとの `ProfileEvents` カウンターを CPU ごとに分片化します。各ユーザーは `getNumCPUs() * num_events * sizeof(atomic)` 分のメモリを消費します (コア数の多いマシンでは数百 KiB) 。無効にすると、イベントごと・ユーザーごとに単一の共有 atomic にフォールバックし、スループットと引き換えにメモリ使用量を抑えます。

## user\_scripts\_path

型

String

デフォルト値

/var/lib/clickhouse/user\_scripts/

再起動せずに変更可能

No

ユーザースクリプトのファイルを格納するディレクトリです。[実行可能なユーザー定義関数](https://clickhouse.com/docs/ja/reference/functions/regular-functions/udf.md#executable-user-defined-functions) で使用されます。

**例**

```xml theme={null}
<user_scripts_path>/var/lib/clickhouse/user_scripts/</user_scripts_path>
```
