Home >Database >Mysql Tutorial >Centos安装配置redis

Centos安装配置redis

WBOY
WBOYOriginal
2016-06-07 16:33:521091browse

编译安装: 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

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn