Heim >Datenbank >MySQL-Tutorial >Centos安装配置redis
编译安装: 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
编译安装:
<code>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</code>
编辑配置文件 /etc/redis.conf:
<code>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</code>
防止Redis脚本在重启或停止报错
<code>echo "vm.overcommit_memory = 1" >> /etc/sysctl.conf sysctl -p</code>
运行redis
<code>/usr/local/bin/redis-server /etc/redis.conf</code>
添加开机启动:
echo "/usr/local/bin/redis-server /etc/redis.conf" >> /etc/rc.d/rc.local
原文地址:Centos安装配置redis, 感谢原作者分享。