顯示具有 buntu 標籤的文章。 顯示所有文章
顯示具有 buntu 標籤的文章。 顯示所有文章

2022-05-06

Ubuntu Redis-server 啟動警告的修正

最近開始想玩玩 redis,所以開始進行安裝

安裝完後第一次啟動算正常,但當檢查啟動記錄( /var/log/redis/redis-server.log )時有看到以下的警告
# Server initialized
# 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.
# 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.
* Ready to accept connections
這兩個警告 redis-server 都有提供解法,所以就照說明來進行即可