From 1597dac66ef80b0a22183df675f8038bd6bb5baa Mon Sep 17 00:00:00 2001 From: Ken Hibino Date: Fri, 6 May 2022 05:50:51 -0700 Subject: [PATCH] Update readme --- README.md | 54 +++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 41 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 78803ac..7567ecb 100644 --- a/README.md +++ b/README.md @@ -98,19 +98,47 @@ Here's the available flags: _Note_: Use `--redis-url` to specify address, db-number, and password with one flag value; Alternatively, use `--redis-addr`, `--redis-db`, and `--redis-password` to specify each value. -| Flag | Env | Description | Default | -| --------------------------------- | ------------------------- | ------------------------------------------------------------------- | ---------------- | -| `--port`(int) | `PORT` | port number to use for web ui server | 8080 | -| `---redis-url`(string) | `REDIS_URL` | URL to redis server | "" | -| `--redis-addr`(string) | `REDIS_ADDR` | address of redis server to connect to | "127.0.0.1:6379" | -| `--redis-db`(int) | `REDIS_DB` | redis database number | 0 | -| `--redis-password`(string) | `REDIS_PASSWORD` | password to use when connecting to redis server | "" | -| `--redis-cluster-nodes`(string) | `REDIS_CLUSTER_NODES` | comma separated list of host:port addresses of cluster nodes | "" | -| `--redis-tls`(string) | `REDIS_TLS` | server name for TLS validation used when connecting to redis server | "" | -| `--redis-insecure-tls`(bool) | `REDIS_INSECURE_TLS` | disable TLS certificate host checks | false | -| `--enable-metrics-exporter`(bool) | `ENABLE_METRICS_EXPORTER` | enable prometheus metrics exporter to expose queue metrics | false | -| `--prometheus-addr`(string) | `PROMETHEUS_ADDR` | address of prometheus server to query time series | "" | -| `--read-only`(bool) | `READ_ONLY` | use web UI in read-only mode | false | +| Flag | Env | Description | Default | +| --------------------------------- | ------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------- | +| `--port`(int) | `PORT` | port number to use for web ui server | 8080 | +| `---redis-url`(string) | `REDIS_URL` | URL to redis or sentinel server. See [godoc](https://pkg.go.dev/github.com/hibiken/asynq#ParseRedisURI) for supported format | "" | +| `--redis-addr`(string) | `REDIS_ADDR` | address of redis server to connect to | "127.0.0.1:6379" | +| `--redis-db`(int) | `REDIS_DB` | redis database number | 0 | +| `--redis-password`(string) | `REDIS_PASSWORD` | password to use when connecting to redis server | "" | +| `--redis-cluster-nodes`(string) | `REDIS_CLUSTER_NODES` | comma separated list of host:port addresses of cluster nodes | "" | +| `--redis-tls`(string) | `REDIS_TLS` | server name for TLS validation used when connecting to redis server | "" | +| `--redis-insecure-tls`(bool) | `REDIS_INSECURE_TLS` | disable TLS certificate host checks | false | +| `--enable-metrics-exporter`(bool) | `ENABLE_METRICS_EXPORTER` | enable prometheus metrics exporter to expose queue metrics | false | +| `--prometheus-addr`(string) | `PROMETHEUS_ADDR` | address of prometheus server to query time series | "" | +| `--read-only`(bool) | `READ_ONLY` | use web UI in read-only mode | false | + +### Connecting to Redis + +To connect to a **single redis server**, use either `--redis-url` or (`--redis-addr`, `--redis-db`, and `--redis-password`). + +Example: + +```sh +$ ./asynqmon --redis-url=redis://:mypassword@]localhost:6380/2 + +$ ./asynqmon --redis-addr=localhost:6380 --redis-db=2 --redis-password=mypassword +``` + +To connect to **redis-sentinels**, use `--redis-url`. + +Example: + +```sh +$ ./asynqmon --redis-url=redis-sentinel://:mypassword@localhost:5000,localhost:5001,localhost:5002?master=mymaster +``` + +To connect to a **redis-cluster**, use `--redis-cluster-nodes`. + +Example: + +```sh +$ ./asynqmon --redis-cluster-nodes=localhost:7000,localhost:7001,localhost:7002,localhost:7003,localhost:7004,localhost:7006 +``` ### Integration with Prometheus