> For the complete documentation index, see [llms.txt](https://ayakaleaf-pro.ayaka.space/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ayakaleaf-pro.ayaka.space/on-premises/ja/she-ding/overleaf-toolkit/redis.md).

# Redis

### パスワード認証を有効にする

外部の Redis サービスを使用していてパスワードを指定する必要がある場合は、次の設定を行うことでこれを行えます: `OVERLEAF_REDIS_PASS` および `REDIS_PASSWORD` の環境変数を **config/variables.env** ファイルに設定し、次の `bin/up -d` コマンドを実行して再作成します **sharelatex** コンテナ内

ローカルの Redis インスタンスを実行している場合は、次を設定する必要があります: **redis** サービスをパスワード認証で起動するように構成する必要があります。上記の環境変数を設定した後、次の追加手順も完了する必要があります:

作成してください **docker-compose.override.yml** のファイルを **config/** ディレクトリに、次の内容で:

{% code title="config/docker-compose.override.yml" %}

```yaml
services:
    redis:
        コマンド: "redis-server --requirepass <YOUR-PASSWORD>"
```

{% endcode %}

{% hint style="warning" %}
AOF 永続化を有効にしている場合は、次を追加する必要があります: `--appendonly yes` に設定する必要があります `コマンド`.
{% endhint %}

実行 `bin/up -d` コンテナを再作成するために。

### Append-Only File 永続化を有効にする

(原文: <https://docs.overleaf.com/on-premises/configuration/overleaf-toolkit/redis#enabling-append-only-file-persistence>)

Redis AOF（Append-Only File）永続化は、サーバーが受け取ったすべての書き込み操作をログに記録することでデータの永続性を確保する堅牢な方法です。RDB スナップショットはデータセットのその時点のコピーを取得しますが、AOF はデータに加えられたすべての変更を完全に記録します。

{% hint style="info" %}
RDB を無効にするかどうかは任意です。通常は両方の永続化方式を一緒に使うことが推奨されます。本番環境で変更を加える前に、AOF と RDB を併用する利点と欠点を確認してください。
{% endhint %}

Redis で AOF 永続化を有効にする方法については、こちらをご覧ください: <https://redis.io/docs/latest/operate/oss_and_stack/management/persistence/#how-i-can-switch-to-aof-if-im-currently-using-dumprdb-snapshotsarrow-up-right>

1. アップグレードのためのメンテナンス時間を確保してください。
2. を使用してインスタンスを停止し `bin/stop` をバックアップしてください **config/** および **data/** フォルダ。
3. 実行 `bin/up` インスタンスを起動するには
4. 次のコマンドを実行します `docker exec -it redis sh`
5. 次のコマンドを実行します `redis-cli` Redis のコマンドラインインターフェースを開くには
6. redis-cli で次のコマンドを実行します `config set appendonly yes`
7. これで、AOF の再書き込みがデータの永続化を完了するまで待つ必要があります。次を入力して確認できます: `INFO persistence` を redis-cli に入力し、次の状態になるまで待ちます `aof_rewrite_in_progress` および `aof_rewrite_scheduled` が `0`、さらに次を確認します: `aof_last_bgrewrite_status` が `ok`.
8. redis-cli を終了するには、次を入力します `exit` そして Enter キーを押します
9. redis コンテナを終了するには、次を入力します `exit` そして Enter キーを押します
10. 次のコマンドを実行します `ls ./data/redis` そして次が表示されることを確認します **appendonly.aof** ファイル
11. 次を編集します **config/overleaf.rc** ファイルを確認し、次を変更します `REDIS_AOF_PERSISTENCE` の環境変数を `false` から `true`
12. 実行 `bin/up -d` そしてアプリケーションが正常に動作することを確認します（プロジェクトエディタと履歴ペインが機能します）。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://ayakaleaf-pro.ayaka.space/on-premises/ja/she-ding/overleaf-toolkit/redis.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
