拉取镜像
docker pull redis:5.0
启动容器
docker run -d -p 6379:6379 --name redis redis:5.0 --appendonly yes
查看日志
docker logs 67dade7133d0
1:C 03 Sep 2020 09:59:07.277 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1:C 03 Sep 2020 09:59:07.277 # Redis version=5.0.9, bits=64, commit=00000000, modified=0, pid=1, just started
1:C 03 Sep 2020 09:59:07.277 # Configuration loaded
1:M 03 Sep 2020 09:59:07.279 * Running mode=standalone, port=6379.
1:M 03 Sep 2020 09:59:07.279 # 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 03 Sep 2020 09:59:07.279 # Server initialized
1:M 03 Sep 2020 09:59:07.279 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
1:M 03 Sep 2020 09:59:07.279 * Ready to accept connections
本文档详细介绍了如何通过Docker来安装和启动Redis 5.0版本。首先,需要从官方镜像库拉取Redis 5.0的Docker镜像。接着,启动Redis容器,并确保其正常运行。最后,通过查看日志确认Redis服务器已经成功启动并监听6379端口。在启动过程中,注意了TCP backlog设置和Transparent Huge Pages (THP)可能带来的问题,并给出了相应的解决建议。
6246

被折叠的 条评论
为什么被折叠?



