M
M
Maxim2018-03-05 10:58:47
Redis
Maxim, 2018-03-05 10:58:47

How to properly configure redis?

There is a container radish in docker

# Redis
    redis:
      image: redis:4.0.6
      build:
        context: .
        dockerfile: dockerfile_redis
      volumes:
        - "./redis.conf:/usr/local/etc/redis/redis.conf"
      ports:
        - "6379:6379"

Runs when docker-compose up -d
1 starts. After about 4-6 hours of running, an error appears, how to fix it?
Failed opening the RDB file backupall.db (in server root dir /run) for saving: Permission denied

Redis config file for docker container
CMD ["chown", "redis:redis", "-R", "/etc"]
CMD ["chown", "redis:redis", "-R", "/var/lib"]
CMD ["chown", "redis:redis", "-R", "/run"]

CMD ["sudo", "chmod", "644", "/data/dump.rdb" ]
CMD ["sudo", "chmod", "755", "/etc" ]
CMD ["sudo", "chmod", "770", "/var/lib" ]
CMD ["sudo", "chmod", "777", "/run" ]

CMD [ "redis-server", "/usr/local/etc/redis/redis.conf" ]

Even at the start of the radish, warnings that the default config file is used are confusing.
1:C 05 Mar 07:23:56.263 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
 1:C 05 Mar 07:23:56.263 # Redis version=4.0.6, bits=64, commit=00000000, modified=0, pid=1, just started
 1:C 05 Mar 07:23:56.263 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
 1:M 05 Mar 07:23:56.265 * Running mode=standalone, port=6379.
 1:M 05 Mar 07:23:56.265 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
 1:M 05 Mar 07:23:56.265 # Server initialized
 1:M 05 Mar 07:23:56.265 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.

2. Really custom configs are not used?
3. How to set up Redis for uptime?
There are many articles on the web on this topic, but everyone has a very different approach and you can’t immediately figure out what needs to be changed and what is better not to touch.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question