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

Centos安装配置redis

WBOY
Release: 2016-06-07 16:33:52
Original
1091 people have browsed it

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

编辑配置文件 /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>
Copy after login

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

<code>echo "vm.overcommit_memory = 1" >> /etc/sysctl.conf
sysctl -p</code>
Copy after login

运行redis

<code>/usr/local/bin/redis-server /etc/redis.conf</code>
Copy after login

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

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template