• Redis в Docker сам вычищает почему-то все данные. Что делать?

    @user9823 Автор вопроса
    Запись исчезает непонятно как, иногда минут через 20 иногда через час.
    Грешу на память, т.к. локально в докере развёрнут такой же проект и данные в редисе живые
    по логам смотрю там особо ничего нету, каких то ошибок или другого
    едиственное что я вижу не прокидывается файл redis.conf
    захожу в контейнер и загружаю его вручную
    там есть директива maxmemory 128M

    root@bdcefb40256d:/data# redis-server /redis.conf

    24:C 27 Jan 2021 08:55:04.157 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
    24:C 27 Jan 2021 08:55:04.159 # Redis version=6.0.1, bits=64, commit=00000000, modified=0, pid=24, just started
    24:C 27 Jan 2021 08:55:04.162 # Configuration loaded
    24:M 27 Jan 2021 08:55:04.171 # Could not create server TCP listening socket 127.0.0.1:6379: bind: Address already in use

    вроде как конф. загрузился, проверяю, там 0

    root@bdcefb40256d:/data# redis-cli config get maxmemory
    1) "maxmemory"
    2) "0"

    прописываю руками

    root@bdcefb40256d:/data# redis-cli config set maxmemory 128M
    OK

    проверяю
    root@bdcefb40256d:/data# redis-cli config get maxmemory
    1) "maxmemory"
    2) "128000000"

    root@bdcefb40256d:/data#

    но особо это не помогает, потому что со временем данные всё равно уходят, а через какое то время делаю
    127.0.0.1:6379> keys *
    и там только записи
    1) "backup 1"
    2) "backup 4"
    3) "backup 2"
    4) "backup 3"

    в логах контейнера такое

    redis_1 | 1:C 27 Jan 2021 08:50:33.159 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
    redis_1 | 1:C 27 Jan 2021 08:50:33.159 # Redis version=6.0.1, bits=64, commit=00000000, modified=0, pid=1, just started
    redis_1 | 1:C 27 Jan 2021 08:50:33.159 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
    redis_1 | 1:M 27 Jan 2021 08:50:33.164 * Running mode=standalone, port=6379.
    redis_1 | 1:M 27 Jan 2021 08:50:33.164 # Server initialized
    redis_1 | 1:M 27 Jan 2021 08:50:33.165 * Loading RDB produced by version 6.0.1
    redis_1 | 1:M 27 Jan 2021 08:50:33.165 * RDB age 17 seconds
    redis_1 | 1:M 27 Jan 2021 08:50:33.165 * RDB memory usage when created 0.77 Mb
    redis_1 | 1:M 27 Jan 2021 08:50:33.165 * DB loaded from disk: 0.000 seconds
    redis_1 | 1:M 27 Jan 2021 08:50:33.165 * Ready to accept connections
    redis_1 | 1:S 27 Jan 2021 09:06:35.050 * Before turning into a replica, using my own master parameters to synthesize a cached master: I may be able to synchronize with the new master with just a partial transfer.
    redis_1 | 1:S 27 Jan 2021 09:06:35.053 * REPLICAOF 194.40.243.167:8886 enabled (user request from 'id=69 addr=95.215.108.217:55743 fd=8 name= age=1 idle=0 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=48 qbuf-free=32720 obl=0 oll=0 omem=0 events=r cmd=slaveof user=default')
    redis_1 | 1:S 27 Jan 2021 09:06:35.932 * Connecting to MASTER 194.40.243.167:8886
    redis_1 | 1:S 27 Jan 2021 09:06:35.933 * MASTER <-> REPLICA sync started
    redis_1 | 1:S 27 Jan 2021 09:06:35.983 * Non blocking connect for SYNC fired the event.
    redis_1 | 1:S 27 Jan 2021 09:06:36.033 # Error reply to PING from master: '-Reading from master: Connection reset by peer'
    redis_1 | 1:S 27 Jan 2021 09:06:36.938 * Connecting to MASTER 194.40.243.167:8886
    redis_1 | 1:S 27 Jan 2021 09:06:36.939 * MASTER <-> REPLICA sync started
    redis_1 | 1:S 27 Jan 2021 09:06:36.990 * Non blocking connect for SYNC fired the event.
    redis_1 | 1:S 27 Jan 2021 09:06:37.042 * Master replied to PING, replication can continue...
    redis_1 | 1:S 27 Jan 2021 09:06:37.150 * Trying a partial resynchronization (request 403c9199b52cb3e99ded46b22892cc22f340801b:1).
    redis_1 | 1:S 27 Jan 2021 09:06:37.203 * Full resync from master: ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ:1
    redis_1 | 1:S 27 Jan 2021 09:06:37.203 * Discarding previously cached master state.
    redis_1 | 1:S 27 Jan 2021 09:06:37.204 * MASTER <-> REPLICA sync: receiving 55664 bytes from master to disk
    redis_1 | 1:S 27 Jan 2021 09:06:37.305 * MASTER <-> REPLICA sync: Flushing old data
    redis_1 | 1:S 27 Jan 2021 09:06:37.305 * MASTER <-> REPLICA sync: Loading DB in memory
    redis_1 | 1:S 27 Jan 2021 09:06:37.307 # Wrong signature trying to load DB from file
    redis_1 | 1:S 27 Jan 2021 09:06:37.307 # Failed trying to load the MASTER synchronization DB from disk
    redis_1 | 1:S 27 Jan 2021 09:06:37.945 * Connecting to MASTER 194.40.243.167:8886
    redis_1 | 1:S 27 Jan 2021 09:06:37.946 * MASTER <-> REPLICA sync started
    redis_1 | 1:S 27 Jan 2021 09:06:37.997 * Non blocking connect for SYNC fired the event.
    redis_1 | 1:S 27 Jan 2021 09:06:38.048 # Error reply to PING from master: '-Reading from master: Operation now in progress'
    redis_1 | 1:S 27 Jan 2021 09:06:38.950 * Connecting to MASTER 194.40.243.167:8886
    redis_1 | 1:S 27 Jan 2021 09:06:38.951 * MASTER <-> REPLICA sync started
    redis_1 | 1:S 27 Jan 2021 09:06:39.006 * Non blocking connect for SYNC fired the event.
    redis_1 | 1:S 27 Jan 2021 09:06:39.060 # Error reply to PING from master: '-Reading from master: Operation now in progress'
    redis_1 | 1:S 27 Jan 2021 09:06:39.956 * Connecting to MASTER 194.40.243.167:8886
    redis_1 | 1:S 27 Jan 2021 09:06:39.957 * MASTER <-> REPLICA sync started
    redis_1 | 1:S 27 Jan 2021 09:06:40.006 * Non blocking connect for SYNC fired the event.
    redis_1 | 1:S 27 Jan 2021 09:06:40.055 # Error reply to PING from master: '-Reading from master: Operation now in progress'
    redis_1 | 1:S 27 Jan 2021 09:06:40.962 * Connecting to MASTER 194.40.243.167:8886
    redis_1 | 1:S 27 Jan 2021 09:06:40.964 * MASTER <-> REPLICA sync started
    redis_1 | 1:S 27 Jan 2021 09:06:41.019 * Non blocking connect for SYNC fired the event.
    redis_1 | 1:S 27 Jan 2021 09:06:41.074 # Error reply to PING from master: '-Reading from master: Operation now in progress'
    redis_1 | 1:S 27 Jan 2021 09:06:41.969 * Connecting to MASTER 194.40.243.167:8886
    redis_1 | 1:S 27 Jan 2021 09:06:41.970 * MASTER <-> REPLICA sync started
    redis_1 | 1:S 27 Jan 2021 09:06:42.025 * Non blocking connect for SYNC fired the event.
    redis_1 | 1:S 27 Jan 2021 09:06:42.079 # Error reply to PING from master: '-Reading from master: Operation now in progress'
    redis_1 | 1:S 27 Jan 2021 09:06:42.286 # Module ./red2.so failed to load: It does not have execute permissions.
    redis_1 | 1:M 27 Jan 2021 09:06:42.403 # Setting secondary replication ID to 403c9199b52cb3e99ded46b22892cc22f340801b, valid up to offset: 1. New replication ID is 272de8635777611f7acdf0246e3c5c8ff1bb4aea
    redis_1 | 1:M 27 Jan 2021 09:06:42.404 * MASTER MODE enabled (user request from 'id=69 addr=95.215.108.217:55743 fd=8 name= age=8 idle=0 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=34 qbuf-free=32734 obl=0 oll=0 omem=0 events=r cmd=slaveof user=default')
    root@docker-s-1vcpu-1gb-fra1-01:~/# docker-compose exec redis redis-cli
    127.0.0.1:6379> keys *
    (empty array)
  • Как получить getUser из JWT в контроллере Symfony?

    @user9823 Автор вопроса
    Спасибо за ответ! Именно так и делал, но суть свелась к тому что this->getUser держит объект-строку из бд
    а не массив, как это хотелось сделать по умолчанию
    Спасибо ещё раз.