configure redis to use an appendonly file for celery task reliability

This commit is contained in:
sadnub 2021-06-06 22:54:52 -04:00
parent 59b0350289
commit 6650b705c4
6 changed files with 27 additions and 4 deletions

View File

@ -115,7 +115,10 @@ services:
redis-dev:
container_name: trmm-redis-dev
restart: always
command: redis-server --appendonly yes
image: redis:6.0-alpine
volumes:
- redis-data-dev:/data
networks:
dev:
aliases:
@ -247,6 +250,7 @@ volumes:
postgres-data-dev:
mongo-dev-data:
mesh-data-dev:
redis-data-dev:
networks:
dev:

View File

@ -1,6 +1,6 @@
#!/bin/bash
SCRIPT_VERSION="12"
SCRIPT_VERSION="13"
SCRIPT_URL='https://raw.githubusercontent.com/wh1te909/tacticalrmm/master/backup.sh'
GREEN='\033[0;32m'
@ -59,6 +59,7 @@ mkdir ${tmp_dir}/nginx
mkdir ${tmp_dir}/systemd
mkdir ${tmp_dir}/rmm
mkdir ${tmp_dir}/confd
mkdir ${tmp_dir}/redis
pg_dump --dbname=postgresql://"${POSTGRES_USER}":"${POSTGRES_PW}"@127.0.0.1:5432/tacticalrmm | gzip -9 > ${tmp_dir}/postgres/db-${dt_now}.psql.gz
@ -72,6 +73,8 @@ sudo tar -czvf ${tmp_dir}/nginx/etc-nginx.tar.gz -C /etc/nginx .
sudo tar -czvf ${tmp_dir}/confd/etc-confd.tar.gz -C /etc/conf.d .
sudo tar -czvf ${tmp_dir}/redis/etc-redis.tar.gz -C /var/lib/redis/appendonly.aof
sudo cp ${sysd}/rmm.service ${sysd}/celery.service ${sysd}/celerybeat.service ${sysd}/meshcentral.service ${sysd}/nats.service ${tmp_dir}/systemd/
if [ -f "${sysd}/daphne.service" ]; then
sudo cp ${sysd}/daphne.service ${tmp_dir}/systemd/

View File

@ -18,6 +18,7 @@ volumes:
postgres_data:
mongo_data:
mesh_data:
redis_data:
services:
# postgres database for api service
@ -38,7 +39,10 @@ services:
tactical-redis:
container_name: trmm-redis
image: redis:6.0-alpine
command: redis-server --appendonly yes
restart: always
volumes:
- redis_data:/data
networks:
- redis

View File

@ -1,6 +1,6 @@
#!/bin/bash
SCRIPT_VERSION="49"
SCRIPT_VERSION="50"
SCRIPT_URL='https://raw.githubusercontent.com/wh1te909/tacticalrmm/master/install.sh'
sudo apt install -y curl wget dirmngr gnupg lsb-release
@ -217,6 +217,10 @@ sudo rm -rf Python-3.9.2 Python-3.9.2.tgz
print_green 'Installing redis and git'
sudo apt install -y ca-certificates redis git
# apply redis configuration
sudo redis-cli config set appendonly yes
sudo redis-cli config rewrite
print_green 'Installing postgresql'
echo "$postgresql_repo" | sudo tee /etc/apt/sources.list.d/pgdg.list

View File

@ -1,6 +1,6 @@
#!/bin/bash
SCRIPT_VERSION="27"
SCRIPT_VERSION="28"
SCRIPT_URL='https://raw.githubusercontent.com/wh1te909/tacticalrmm/master/restore.sh'
sudo apt update
@ -189,6 +189,10 @@ sudo rm -rf Python-3.9.2 Python-3.9.2.tgz
print_green 'Installing redis and git'
sudo apt install -y ca-certificates redis git
# redis configuration
sudo tar -xzf ${tmp_dir}/redis/etc-redis.tar.gz -C /var/lib/redis
sudo redis-check-aof --fix /var/lib/redis/appendonly.aof
print_green 'Installing postgresql'
echo "$postgresql_repo" | sudo tee /etc/apt/sources.list.d/pgdg.list

View File

@ -1,6 +1,6 @@
#!/bin/bash
SCRIPT_VERSION="122"
SCRIPT_VERSION="123"
SCRIPT_URL='https://raw.githubusercontent.com/wh1te909/tacticalrmm/master/update.sh'
LATEST_SETTINGS_URL='https://raw.githubusercontent.com/wh1te909/tacticalrmm/master/api/tacticalrmm/tacticalrmm/settings.py'
YELLOW='\033[1;33m'
@ -307,5 +307,9 @@ if [[ "${CURRENT_MESH_VER}" != "${LATEST_MESH_VER}" ]] || [[ "$force" = true ]];
sudo systemctl start meshcentral
fi
# apply redis configuration
sudo redis-cli config set appendonly yes
sudo redis-cli config rewrite
rm -f $TMP_SETTINGS
printf >&2 "${GREEN}Update finished!${NC}\n"