forked from mtusi2026/mtusi2026lab2
Заполнить отчёт и добавить доказательства
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
# Сессии в Redis: настройки persistence, вид ключа, TTL не продлевается перезапуском
|
||||
# дата: 2026-10-08T15:55Z, commit: 6473fd0
|
||||
# стенд: Apple M3 Pro, 11 CPU, 18 GB RAM, macOS 26.1, Docker 29.3.0, Compose 5.1.0
|
||||
|
||||
$ redis-cli CONFIG GET appendonly / appendfsync / maxmemory-policy
|
||||
appendonly
|
||||
yes
|
||||
appendfsync
|
||||
always
|
||||
maxmemory-policy
|
||||
noeviction
|
||||
|
||||
$ redis-cli --scan --pattern 'session:*' | wc -l
|
||||
41
|
||||
|
||||
# один из ключей: sha256 от токена, значение — id пользователя
|
||||
$ redis-cli GET session:e478544e3e6f92c4c36896617f812541bdb171df4654de1fafaad9074c962367
|
||||
97dbb54c-2e55-441f-ae31-ef469b935758
|
||||
$ redis-cli TTL session:e478544e3e6f92c4c36896617f812541bdb171df4654de1fafaad9074c962367
|
||||
3591
|
||||
|
||||
$ docker compose --env-file .env restart redis
|
||||
Container mtusi-messenger-lab2-redis-1 Restarting
|
||||
Container mtusi-messenger-lab2-redis-1 Started
|
||||
|
||||
$ redis-cli TTL session:e478544e3e6f92c4c36896617f812541bdb171df4654de1fafaad9074c962367 # после перезапуска ключ на месте, TTL уменьшился
|
||||
3583
|
||||
|
||||
$ docker compose --env-file .env exec -T redis ls -la /data/appendonlydir
|
||||
total 24
|
||||
drwx------ 2 redis redis 4096 Oct 8 15:55 .
|
||||
drwxr-xr-x 3 redis redis 4096 Oct 8 15:55 ..
|
||||
-rw------- 1 redis redis 89 Oct 8 15:55 appendonly.aof.1.base.rdb
|
||||
-rw------- 1 redis redis 7582 Oct 8 15:55 appendonly.aof.1.incr.aof
|
||||
-rw------- 1 redis redis 88 Oct 8 15:55 appendonly.aof.manifest
|
||||
|
||||
Reference in New Issue
Block a user