歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> CentOS 6.3安裝Redis

CentOS 6.3安裝Redis

日期:2017/2/28 14:55:49   编辑:Linux教程

Linux系統:CentOS 6.3

一、下載源碼包
wget http://redis.googlecode.com/files/redis-2.2.12.tar.gz

二、安裝
1、解壓:
[root@localhost ~]# tar -zxvf redis-2.2.12.tar.gz

2、安裝:
[root@localhost ~]# cd redis-2.2.12
[root@localhost redis-2.2.12]# make PREFIX=/usr/local/redis install

3、建立需要的目錄
mkdir -p /usr/local/redis/etc
mkdir -p /usr/local/redis/var
mkdir -p /usr/local/redis/bin

4、cp文件
cp redis-server redis-cli redis-benchmark redis-stat /usr/local/redis/bin/
cp redis.conf /usr/local/redis/etc/

5、配置文件
[root@localhost redis-2.2.12]# cat /data/app/redis/etc/redis.conf
daemonize yes
pidfile /usr/local/redis/redis.pid
port 6379
bind 10.10.0.78
#unixsocket /tmp/redis.sock
timeout 120
#loglevel verbose
#logfile stdout
#logfile /tmp/redis_6379.log
databases 16
save 1800 1
#save 300 10
#save 60 10000
rdbcompression yes
dbfilename dump.rdb
dir /usr/local/redis/var/
slave-serve-stale-data yes
maxclients 12800
slaveof 10.10.0.157 6379
appendonly no
appendfsync no
no-appendfsync-on-rewrite no
slowlog-log-slower-than 10000
Slowlog-max-len 1024
vm-enabled no
vm-swap-file /tmp/redis.swap
vm-max-memory 0
vm-page-size 32
vm-pages 134217728
vm-max-threads 4
hash-max-zipmap-entries 512
hash-max-zipmap-value 64
list-max-ziplist-entries 512
list-max-ziplist-value 64
set-max-intset-entries 512
activerehashing yes
########配置文件結束#########

三、啟動服務
/usr/local/redis/bin/redis-server /usr/local/redis/etc/redis.conf

Copyright © Linux教程網 All Rights Reserved