forked from phoenix/litellm-mirror
add doc for setting redis sentinel password
This commit is contained in:
parent
68fab2bf5d
commit
671ac7c043
2 changed files with 10 additions and 1 deletions
|
@ -130,6 +130,7 @@ litellm_settings:
|
|||
type: "redis"
|
||||
service_name: "mymaster"
|
||||
sentinel_nodes: [["localhost", 26379]]
|
||||
sentinel_password: "password" # [OPTIONAL]
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
|
@ -143,6 +144,7 @@ You can configure redis sentinel in your .env by setting `REDIS_SENTINEL_NODES`
|
|||
```env
|
||||
REDIS_SENTINEL_NODES='[["localhost", 26379]]'
|
||||
REDIS_SERVICE_NAME = "mymaster"
|
||||
REDIS_SENTINEL_PASSWORD = "password"
|
||||
```
|
||||
|
||||
:::note
|
||||
|
|
|
@ -18,7 +18,7 @@ import redis # type: ignore
|
|||
import redis.asyncio as async_redis # type: ignore
|
||||
|
||||
import litellm
|
||||
from litellm import get_secret
|
||||
from litellm import get_secret, get_secret_str
|
||||
|
||||
from ._logging import verbose_logger
|
||||
|
||||
|
@ -139,6 +139,13 @@ def _get_redis_client_logic(**env_overrides):
|
|||
if _sentinel_nodes is not None and isinstance(_sentinel_nodes, str):
|
||||
redis_kwargs["sentinel_nodes"] = json.loads(_sentinel_nodes)
|
||||
|
||||
_sentinel_password: Optional[str] = redis_kwargs.get(
|
||||
"sentinel_password", None
|
||||
) or get_secret_str("REDIS_SENTINEL_PASSWORD")
|
||||
|
||||
if _sentinel_password is not None:
|
||||
redis_kwargs["sentinel_password"] = _sentinel_password
|
||||
|
||||
_service_name: Optional[str] = redis_kwargs.get("service_name", None) or get_secret( # type: ignore
|
||||
"REDIS_SERVICE_NAME"
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue