From c7da45814503558ab1ebbba2f316b5ab9c718143 Mon Sep 17 00:00:00 2001 From: kobebigs Date: Thu, 8 Dec 2022 09:30:20 +0200 Subject: [PATCH 1/3] Add notes on maintaining Docker based instances --- src/pages/kb/open-source/admin-guide/maintenance.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/pages/kb/open-source/admin-guide/maintenance.md b/src/pages/kb/open-source/admin-guide/maintenance.md index e2b0e56b5..3df4560f6 100644 --- a/src/pages/kb/open-source/admin-guide/maintenance.md +++ b/src/pages/kb/open-source/admin-guide/maintenance.md @@ -17,12 +17,16 @@ The supervisor config can be found in: `/etc/supervisor/conf.d/redash.conf` if y There, you can see the names of Redash's processes (`redash_celery`, `redash_server` and `redash_celery_scheduled`), as well as the location of their logs. If no logs location is present, then the logs will be written to `/var/logs/supervisor`. +For Docker based instances, run `docker ps` to see the running Redash processes. + ## Restart - Restart all processes: `sudo supervisorctl restart all`. - Restart the Web server: `sudo supervisorctl restart redash_server`. - Restart Celery workers: `sudo supervisorctl restart redash_celery`. +If you use Docker, navigate to `/opt/redash` and run `docker-compose up -d` to restart all containers. You can also restart single processes using the container id or name. For instance, `docker restart redash_server_1` will restart the redash server. + ### Restarting Celery Workers & the Queries Queue In case you are handling a problem, and you need to stop the currently running queries and reset the queue, follow the steps below. @@ -31,6 +35,8 @@ In case you are handling a problem, and you need to stop the currently running q 2. Flush redis: `redis-cli flushall`. 3. Start celery: `sudo supervisorctl start redash_celery` +Using Docker based instances, you can flush redis by running `docker exec -it redash_redis_1 redis-cli flushall`. Restart container with `docker restart redash_redis_1`. + ## Changing the Number of Workers By default, Celery will start a worker per CPU core. Because most of Redash’s tasks are IO bound, the real limit for number of workers you can use depends on the amount of memory your machine has. It’s recommended to increase number of workers, to support more concurrent queries. @@ -39,6 +45,8 @@ By default, Celery will start a worker per CPU core. Because most of Redash’s 2. Edit the `[program:redash_celery]` section and add to the _command_ value, the param “-c” with the number of concurrent workers you need. 3. Restart supervisord to apply new configuration: `sudo /etc/init.d/redash_supervisord restart`. +You can change number of workers, when using docker by changing `WORKERS_COUNT` for the scheduler services in `docker-compose.yml` located at `/opt/redash/`. + ## DB ### Backup Redash’s DB: From aae6e38d4d1cd4c8a6db66e049facb916fce4824 Mon Sep 17 00:00:00 2001 From: kobebigs Date: Thu, 8 Dec 2022 10:02:55 +0200 Subject: [PATCH 2/3] add instructions on checking redis dump --- src/pages/kb/open-source/admin-guide/maintenance.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pages/kb/open-source/admin-guide/maintenance.md b/src/pages/kb/open-source/admin-guide/maintenance.md index 3df4560f6..abce133cd 100644 --- a/src/pages/kb/open-source/admin-guide/maintenance.md +++ b/src/pages/kb/open-source/admin-guide/maintenance.md @@ -35,7 +35,9 @@ In case you are handling a problem, and you need to stop the currently running q 2. Flush redis: `redis-cli flushall`. 3. Start celery: `sudo supervisorctl start redash_celery` -Using Docker based instances, you can flush redis by running `docker exec -it redash_redis_1 redis-cli flushall`. Restart container with `docker restart redash_redis_1`. +Using Docker based instances; +1. you can flush redis by running `docker exec -it redash_redis_1 redis-cli flushall`. Restart container with `docker restart redash_redis_1`. +2. check redis dump size: `docker exec -it redash_redis_1 la -la`. ## Changing the Number of Workers From 8a1546926670b119d174b969c782d278954f988a Mon Sep 17 00:00:00 2001 From: kobebigs Date: Thu, 8 Dec 2022 10:09:40 +0200 Subject: [PATCH 3/3] add instructions on accessing postgres - redash db --- src/pages/kb/open-source/admin-guide/maintenance.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pages/kb/open-source/admin-guide/maintenance.md b/src/pages/kb/open-source/admin-guide/maintenance.md index abce133cd..001d68a80 100644 --- a/src/pages/kb/open-source/admin-guide/maintenance.md +++ b/src/pages/kb/open-source/admin-guide/maintenance.md @@ -36,8 +36,9 @@ In case you are handling a problem, and you need to stop the currently running q 3. Start celery: `sudo supervisorctl start redash_celery` Using Docker based instances; + 1. you can flush redis by running `docker exec -it redash_redis_1 redis-cli flushall`. Restart container with `docker restart redash_redis_1`. -2. check redis dump size: `docker exec -it redash_redis_1 la -la`. +2. check redis dump size: `docker exec -it redash_redis_1 la -la`. ## Changing the Number of Workers @@ -57,6 +58,8 @@ Uncompressed backup: `sudo -u redash pg_dump > backup_filename.sql` Compressed backup: `sudo -u redash pg_dump redash | gzip > backup_filename.gz` +Access Redash DB (postgres) in docker using: `docker exec -it redash_postgres_1 psql -U postgres` + ## Version See current version: