From 7d4e636313828e7dcc1aee543959e6b179a8d7a2 Mon Sep 17 00:00:00 2001 From: Andrew Nguonly Date: Wed, 22 Jan 2025 12:14:24 -0800 Subject: [PATCH] docs: Add note about how to share Postgres instance for self-hosted deployments (#3139) ### Screenshot ![image](https://github.com/user-attachments/assets/1caa7581-9dda-4ffc-9fee-ffb0f72487ea) --- docs/docs/how-tos/deploy-self-hosted.md | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/docs/docs/how-tos/deploy-self-hosted.md b/docs/docs/how-tos/deploy-self-hosted.md index d2e3158ed..fce2d09e9 100644 --- a/docs/docs/how-tos/deploy-self-hosted.md +++ b/docs/docs/how-tos/deploy-self-hosted.md @@ -25,8 +25,20 @@ If you would like to deploy LangGraph Cloud on Kubernetes, you can use this [Hel You will eventually need to pass in the following environment variables to the LangGraph Deploy server: -- `REDIS_URI`: Connection details to a Redis instance. Redis will be used as a pub-sub broker to enable streaming real time output from background runs. -- `DATABASE_URI`: Postgres connection details. Postgres will be used to store assistants, threads, runs, persist thread state and long term memory, and to manage the state of the background task queue with 'exactly once' semantics. +- `REDIS_URI`: Connection details to a Redis instance. Redis will be used as a pub-sub broker to enable streaming real time output from background runs. The value of `REDIS_URI` must be a valid [Redis connection URI](https://redis-py.readthedocs.io/en/stable/connections.html#redis.Redis.from_url). + + !!! Note "Shared Redis Instance" + Multiple self-hosted deployments can share the same Redis instance. For example, for `Deployment A`, `REDIS_URI` can be set to `redis://:/1` and for `Deployment B`, `REDIS_URI` can be set to `redis://:/2`. + + `1` and `2` are different database numbers within the same instance, but `` is shared. **The same database number cannot be used for separate deployments**. + +- `DATABASE_URI`: Postgres connection details. Postgres will be used to store assistants, threads, runs, persist thread state and long term memory, and to manage the state of the background task queue with 'exactly once' semantics. The value of `DATABASE_URI` must be a valid [Postgres connection URI](https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING-URIS). + + !!! Note "Shared Postgres Instance" + Multiple self-hosted deployments can share the same Postgres instance. For example, for `Deployment A`, `DATABASE_URI` can be set to `postgres://:@/?host=` and for `Deployment B`, `DATABASE_URI` can be set to `postgres://:@/?host=`. + + `` and `database_name_2` are different databases within the same instance, but `` is shared. **The same database cannot be used for separate deployments**. + - `LANGSMITH_API_KEY`: (If using [Self-Hosted Lite](../concepts/deployment_options.md#self-hosted-lite)) LangSmith API key. This will be used to authenticate ONCE at server start up. - `LANGGRAPH_CLOUD_LICENSE_KEY`: (If using [Self-Hosted Enterprise](../concepts/deployment_options.md#self-hosted-enterprise)) LangGraph Platform license key. This will be used to authenticate ONCE at server start up. - `LANGCHAIN_ENDPOINT`: To send traces to a [self-hosted LangSmith](https://docs.smith.langchain.com/self_hosting) instance, set `LANGCHAIN_ENDPOINT` to the hostname of the self-hosted LangSmith instance.