Redis 安装
2022-10-28
yum 安装
pip 安装
源码包编译安装
arm 服务器源码安装
wget http://download.redis.io/releases/redis-4.0.9.tar.gz
tar xf redis-4.0.9.tar.gz
cd redis-4.0.9/deps/
#
make -j2 hiredis lua jemalloc linenoise
#
cd ..
make
make install
mkdir /opt/redis
cp redis.conf /opt/redis/
cp sentinel.conf /opt/redis/
cd src/
cp mkreleasehdr.sh redis-benchmark redis-check-aof redis-check-rdb redis-cli redis-sentinel redis-server redis-trib.rb /opt/redis/bin/
需要调整的几个地方;
9773:M 25 Oct 03:39:10.891 # 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.
9773:M 25 Oct 03:39:10.891 # 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.
# 解决方法;
echo never > /sys/kernel/mm/transparent_hugepage/enabled
echo 'vm.overcommit_memory = 1' >> /etc/sysctl.conf
sysctl -p