当前位置:Gxlcms > mysql > Centos安装配置redis

Centos安装配置redis

时间:2021-07-01 10:21:17 帮助过:9人阅读

编译安装: wget http://download.redis.io/releases/redis-2.8.6.tar.gztar zxvf redis-2.8.6.tar.gz cd redis-2.8.6make make PREFIX=/www/wdlinux/redis installcp redis.conf /etc/mkdir /www/wdlinux/redis/dbmkdir /www/wdlinux/redis/logtouch /www/w

编译安装:

wget http://download.redis.io/releases/redis-2.8.6.tar.gz
tar zxvf redis-2.8.6.tar.gz 
cd redis-2.8.6
make 
make PREFIX=/www/wdlinux/redis install
cp redis.conf /etc/

mkdir /www/wdlinux/redis/db
mkdir /www/wdlinux/redis/log
touch /www/wdlinux/redis/log/redis.log
ln -s /etc/redis.conf /www/wdlinux/redis/redis.conf

编辑配置文件 /etc/redis.conf:

daemonize yes
port 6379
bind 127.0.0.1
timeout 300
dir /www/wdlinux/redis/db/
logfile /www/wdlinux/redis/log/redis.log
maxmemory 1024000000

防止Redis脚本在重启或停止报错

echo "vm.overcommit_memory = 1" >> /etc/sysctl.conf
sysctl -p

运行redis

/usr/local/bin/redis-server /etc/redis.conf

添加开机启动:
echo "/usr/local/bin/redis-server /etc/redis.conf" >> /etc/rc.d/rc.local

人气教程排行