1. Stop Redis and sentilo-server:
systemctl stop
redis-server.service
systemctl stop sentilo-server.service
2. Do a backup of Redis BBDD:
cp /var/lib/redis/dump.rdb
<your path>/dump.rdb.<current date>
3. Configure Redis propertly at /etc/redis/redis.conf. Set parameters:
maxmemory 8gb
maxmemory-policy
volatile-ttl
4. Configure your sentilo.conf:
sentilo.redis.expire.key.seconds=7500000
5. Start Redis and Stop sentilo-server:
systemctl start
redis-server.service
systemctl stop
sentilo-server.service
6. Set Expiration value for all KEYS:
redis-cli –a
<password> KEYS 'sdid:*' | awk '{printf "EXPIRE %s 60\n", $1}'
| redis-cli -a <password> > expire.log
7. Use mongosh to syncronize Redis
and MongoDB:
db.sensor.updateMany({},{$unset:{synchronized:""}},{multi:true});
8. Reboot server
I hope it helps
El dia dijous, 18 d’abril del 2024 a les 12:23:00 UTC+2, Roger Xandri Elias va escriure: