Skip to content

Commit 3db3d5d

Browse files
pat-sdelvh
andauthored
Document redis-cluster explicitly in config (#24717)
Co-authored-by: delvh <[email protected]>
1 parent 6d2c63f commit 3db3d5d

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

custom/conf/app.example.ini

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1425,7 +1425,7 @@ ROUTER = console
14251425
;; Batch size to send for batched queues
14261426
;BATCH_LENGTH = 20
14271427
;;
1428-
;; Connection string for redis queues this will store the redis connection string.
1428+
;; Connection string for redis queues this will store the redis or redis-cluster connection string.
14291429
;; When `TYPE` is `persistable-channel`, this provides a directory for the underlying leveldb
14301430
;; or additional options of the form `leveldb://path/to/db?option=value&....`, and will override `DATADIR`.
14311431
;CONN_STR = "redis://127.0.0.1:6379/0"
@@ -1697,8 +1697,9 @@ ROUTER = console
16971697
;; For "memory" only, GC interval in seconds, default is 60
16981698
;INTERVAL = 60
16991699
;;
1700-
;; For "redis" and "memcache", connection host address
1700+
;; For "redis", "redis-cluster" and "memcache", connection host address
17011701
;; redis: `redis://127.0.0.1:6379/0?pool_size=100&idle_timeout=180s`
1702+
;; redis-cluster: `redis+cluster://127.0.0.1:6379/0?pool_size=100&idle_timeout=180s`
17021703
;; memcache: `127.0.0.1:11211`
17031704
;; twoqueue: `{"size":50000,"recent_ratio":0.25,"ghost_ratio":0.5}` or `50000`
17041705
;HOST =
@@ -1730,14 +1731,15 @@ ROUTER = console
17301731
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
17311732
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
17321733
;;
1733-
;; Either "memory", "file", "redis", "db", "mysql", "couchbase", "memcache" or "postgres"
1734+
;; Either "memory", "file", "redis", "redis-cluster", "db", "mysql", "couchbase", "memcache" or "postgres"
17341735
;; Default is "memory". "db" will reuse the configuration in [database]
17351736
;PROVIDER = memory
17361737
;;
17371738
;; Provider config options
17381739
;; memory: doesn't have any config yet
17391740
;; file: session file path, e.g. `data/sessions`
17401741
;; redis: `redis://127.0.0.1:6379/0?pool_size=100&idle_timeout=180s`
1742+
;; redis-cluster: `redis+cluster://127.0.0.1:6379/0?pool_size=100&idle_timeout=180s`
17411743
;; mysql: go-sql-driver/mysql dsn config string, e.g. `root:password@/session_table`
17421744
;PROVIDER_CONFIG = data/sessions ; Relative paths will be made absolute against _`AppWorkPath`_.
17431745
;;
@@ -2371,7 +2373,7 @@ ROUTER = console
23712373
;QUEUE_LENGTH = 1000
23722374
;;
23732375
;; Task queue connection string, available only when `QUEUE_TYPE` is `redis`.
2374-
;; If there is a password of redis, use `redis://127.0.0.1:6379/0?pool_size=100&idle_timeout=180s`.
2376+
;; If there is a password of redis, use `redis://127.0.0.1:6379/0?pool_size=100&idle_timeout=180s` or `redis+cluster://127.0.0.1:6379/0?pool_size=100&idle_timeout=180s` for `redis-clsuter`.
23752377
;QUEUE_CONN_STR = "redis://127.0.0.1:6379/0?pool_size=100&idle_timeout=180s"
23762378

23772379
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

docs/content/doc/administration/config-cheat-sheet.en-us.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ Configuration at `[queue]` will set defaults for queues with overrides for indiv
484484
- `DATADIR`: **queues/common**: Base DataDir for storing level queues. `DATADIR` for individual queues can be set in `queue.name` sections. Relative paths will be made absolute against `%(APP_DATA_PATH)s`.
485485
- `LENGTH`: **100**: Maximal queue size before channel queues block
486486
- `BATCH_LENGTH`: **20**: Batch data before passing to the handler
487-
- `CONN_STR`: **redis://127.0.0.1:6379/0**: Connection string for the redis queue type. Options can be set using query params. Similarly, LevelDB options can also be set using: **leveldb://relative/path?option=value** or **leveldb:///absolute/path?option=value**, and will override `DATADIR`
487+
- `CONN_STR`: **redis://127.0.0.1:6379/0**: Connection string for the redis queue type. For `redis-cluster` use `redis+cluster://127.0.0.1:6379/0`. Options can be set using query params. Similarly, LevelDB options can also be set using: **leveldb://relative/path?option=value** or **leveldb:///absolute/path?option=value**, and will override `DATADIR`
488488
- `QUEUE_NAME`: **_queue**: The suffix for default redis and disk queue name. Individual queues will default to **`name`**`QUEUE_NAME` but can be overridden in the specific `queue.name` section.
489489
- `SET_NAME`: **_unique**: The suffix that will be added to the default redis and disk queue `set` name for unique queues. Individual queues will default to **`name`**`QUEUE_NAME`_`SET_NAME`_ but can be overridden in the specific `queue.name` section.
490490
- `MAX_WORKERS`: **10**: Maximum number of worker go-routines for the queue.
@@ -756,10 +756,11 @@ and
756756
## Cache (`cache`)
757757

758758
- `ENABLED`: **true**: Enable the cache.
759-
- `ADAPTER`: **memory**: Cache engine adapter, either `memory`, `redis`, `twoqueue` or `memcache`. (`twoqueue` represents a size limited LRU cache.)
759+
- `ADAPTER`: **memory**: Cache engine adapter, either `memory`, `redis`, `redis-cluster`, `twoqueue` or `memcache`. (`twoqueue` represents a size limited LRU cache.)
760760
- `INTERVAL`: **60**: Garbage Collection interval (sec), for memory and twoqueue cache only.
761-
- `HOST`: **\<empty\>**: Connection string for `redis` and `memcache`. For `twoqueue` sets configuration for the queue.
761+
- `HOST`: **\<empty\>**: Connection string for `redis`, `redis-cluster` and `memcache`. For `twoqueue` sets configuration for the queue.
762762
- Redis: `redis://:[email protected]:6379/0?pool_size=100&idle_timeout=180s`
763+
- Redis-cluster `redis+cluster://:[email protected]:6379/0?pool_size=100&idle_timeout=180s`
763764
- Memcache: `127.0.0.1:9090;127.0.0.1:9091`
764765
- TwoQueue LRU cache: `{"size":50000,"recent_ratio":0.25,"ghost_ratio":0.5}` or `50000` representing the maximum number of objects stored in the cache.
765766
- `ITEM_TTL`: **16h**: Time to keep items in cache if not used, Setting it to -1 disables caching.
@@ -772,7 +773,7 @@ and
772773

773774
## Session (`session`)
774775

775-
- `PROVIDER`: **memory**: Session engine provider \[memory, file, redis, db, mysql, couchbase, memcache, postgres\]. Setting `db` will reuse the configuration in `[database]`
776+
- `PROVIDER`: **memory**: Session engine provider \[memory, file, redis, redis-cluster, db, mysql, couchbase, memcache, postgres\]. Setting `db` will reuse the configuration in `[database]`
776777
- `PROVIDER_CONFIG`: **data/sessions**: For file, the root path; for db, empty (database config will be used); for others, the connection string. Relative paths will be made absolute against _`AppWorkPath`_.
777778
- `COOKIE_SECURE`: **false**: Enable this to force using HTTPS for all session access.
778779
- `COOKIE_NAME`: **i\_like\_gitea**: The name of the cookie used for the session ID.
@@ -1184,7 +1185,7 @@ Task queue configuration has been moved to `queue.task`. However, the below conf
11841185

11851186
- `QUEUE_TYPE`: **channel**: Task queue type, could be `channel` or `redis`.
11861187
- `QUEUE_LENGTH`: **1000**: Task queue length, available only when `QUEUE_TYPE` is `channel`.
1187-
- `QUEUE_CONN_STR`: **redis://127.0.0.1:6379/0**: Task queue connection string, available only when `QUEUE_TYPE` is `redis`. If redis needs a password, use `redis://[email protected]:6379/0`.
1188+
- `QUEUE_CONN_STR`: **redis://127.0.0.1:6379/0**: Task queue connection string, available only when `QUEUE_TYPE` is `redis`. If redis needs a password, use `redis://[email protected]:6379/0` or `redis+cluster://[email protected]:6379/0`.
11881189

11891190
## Migrations (`migrations`)
11901191

0 commit comments

Comments
 (0)