Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add notes on maintaining Docker based instances #660

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/pages/kb/open-source/admin-guide/maintenance.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -31,6 +35,11 @@ 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;

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

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.
Expand All @@ -39,6 +48,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:
Expand All @@ -47,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:
Expand Down