2:cd redis-2.6.12
3:make
有报错如下:
/home/liuxiaojie/redis-2.6.12/src/zmalloc.c:223: undefined reference to `__sync_add_and_fetch_4'
collect2: ld returned 1 exit status
make[2]: *** [redis-server] Error 1
make[2]: Leaving directory `/home/liuxiaojie/redis-2.6.12/src'
make[1]: *** [32bit] Error 2
make[1]: Leaving directory `/home/liuxiaojie/redis-2.6.12/src'
make: *** [32bit] Error 2
解决方法:
cd src
vi .make-settings
将OPT=-O2 修改为OPT=-O2 -march=i686
然后make 该问题即可解决
4:make test时出错
[root@centos5xenslave redis-2.6.12]# make test
cd src && make test
^[[6~make[1]: Entering directory `/home/liuxiaojie/redis-2.6.12/src'
You need tcl 8.5 or newer in order to run the Redis test
make[1]: *** [test] Error 1
make[1]: Leaving directory `/home/liuxiaojie/redis-2.6.12/src'
make: *** [test] Error 2
[root@centos5xenslave redis-2.6.12]#
我试着下载了tcl8.6.0-src.tar.gz
tar zxvf tcl8.6.0-src.tar.gz
cd tcl8.6.0
cd unix
./configure && make && make install
然后make test(但还是出错!)
但不影响redis服务启动
5:启动redis服务,见附件
显然redis已经正常启动
6:登录测试
摘抄一个配置文件:
daemonize yes
pidfile /usr/local/redis/var/redis.pid
port 6379
timeout 300
loglevel verbose
logfile /usr/local/redis/var/redis.log
databases 16
save 900 1
save 300 10
save 60 10000
rdbcompression yes
dbfilename dump.rdb
dir /usr/local/redis/var
slave-serve-stale-data yes
appendonly no
appendfsync everysec
no-appendfsync-on-rewrite no
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
关闭redis服务:
[root@centos5xenslave redis-2.6.12]# /usr/local/redis/src/redis-cli shutdown
[root@centos5xenslave redis-2.6.12]# lsof -i :6379
redis安装过程中遇到的问题如下:
1:
[root@zabbixserver redis-3.0.0-rc1]# make test
cd src && make test
make[1]: Entering directory `/root/redis-3.0.0-rc1/src'
You need tcl 8.5 or newer in order to run the Redis test
make[1]: *** [test] Error 1
make[1]: Leaving directory `/root/redis-3.0.0-rc1/src'
make: *** [test] Error 2
会提示tcl1.8.5 version or newer
解决方法:
yum -y install tcl-devel
然后再次执行make test 会一直执行
2:
redis安装:
tar zxvf redis-3.0.0-rc1.tar.gz
cd redis-3.0.0-rc1
yum -y install tcl
make
make test ##在这一步遇到如下的问题:
####在速度较慢的机器上执行make test可能出现下列错误(但无影响)
*** [err]: Test replication partial resync: no backlog in tests/integration/replication-psync.tcl
make PREFIX=/usr/local/redis install
3:
另外一个redis配置文件:
-
daemonize yes
-
-
pidfile /var/run/redis.pid
-
-
port 6379
-
-
bind 0.0.0.0
-
-
timeout 300
-
-
loglevel verbose
-
-
logfile /dev/null
-
-
databases 16
-
-
-
save 900 1
-
save 300 10
-
save 60 10000
-
-
rdbcompression yes
-
-
dbfilename dump.rdb
-
-
dir ./
-
-
-
slave-serve-stale-data yes
-
-
-
appendonly no
-
-
appendfsync everysec
-
-
no-appendfsync-on-rewrite no
-
-
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