redis 3.0.7 安装部署
admin
2023-05-30 10:22:15
0


############################

基础环境

OS: centos 6.6

DB: redis 3.0.7

#############################


1.下载源码包,稳定版本 

http://redis.io/   -->Download it  -->download 3.0.7.


2.上传到服务器/usr/local目录下,解压缩

#cd /usr/local

# tar -zxvf redis-3.0.7.tar.gz


3.编译

# cd redis-3.0.7

# make

#make test  --可以省略


4.安装

# make install


5.安装数据库设置,可以设置不同端口,多个实例

# ./utils/install_server.sh    --可以运行多次

Welcome to the redis service installer

This script will help you easily set up a running redis server


Please select the redis port for this instance: [6379] 

Selecting default: 6379

Please select the redis config file name [/etc/redis/6379.conf] 

Selected default - /etc/redis/6379.conf

Please select the redis log file name [/var/log/redis_6379.log] 

Selected default - /var/log/redis_6379.log

Please select the data directory for this instance [/var/lib/redis/6379] 

Selected default - /var/lib/redis/6379

Please select the redis executable path [/usr/local/bin/redis-server] 

Selected config:

Port           : 6379

Config file    : /etc/redis/6379.conf

Log file       : /var/log/redis_6379.log

Data dir       : /var/lib/redis/6379

Executable     : /usr/local/bin/redis-server

Cli Executable : /usr/local/bin/redis-cli

Is this ok? Then press ENTER to go on or Ctrl-C to abort.

Copied /tmp/6379.conf => /etc/init.d/redis_6379

Installing service...

Successfully added to chkconfig!

Successfully added to runlevels 345!

Starting Redis server...

Installation successful!


6.验证

# ps -ef |grep redis

# chkconfig --list |grep redis

redis_6379      0:off   1:off   2:on    3:on    4:on    5:on    6:off

# redis-cli -p 6379

127.0.0.1:6379> info 


7.启停

#service redis_6379 stop

#service redis_6379 start


8.问题总结:


1)安装gcc、jemalloc

# yum -y install gcc

# rpm -ivh jemalloc-3.6.0-1.el6.x86_64.rpm 


2)make时报如下错误,一定要用jemalloc

zmalloc.h:50:31: error: jemalloc/jemalloc.h: No such file or directory

zmalloc.h:55:2: error: #error "Newer version of jemalloc required"

make[1]: *** [adlist.o] Error 1

原因是jemalloc重载了Linux下的ANSI C的malloc和free函数。解决办法:make时添加参数。

解决方法:

#make MALLOC=libc


3)make之后,会出现一句提示

Hint: To run 'make test' is a good idea ;) 

但是不测试,通常是可以使用的。若我们运行make test ,会有如下提示

#make test

You need tcl 8.5 or newer in order to run the Redis test

make: ***[test] Error_1

解决办法是用yum安装tcl8.5(或去tcl的官方网站http://www.tcl.tk/下载8.5版本,并参考官网介绍进行安装)

#yum install tcl


4)编译测试报错

*** [err]: Test replication partial resync: no backlog (diskless: no, reconnect: 1) in tests/integration/replication-psync.tcl

Expected condition '[s -1 sync_partial_err] > 0' to be true ([s -1 sync_partial_err] > 0)

Cleanup: may take some time... OK

make[1]: *** [test] 错误 1

make[1]: Leaving directory `/usr/local/redis-3.0.7/src'

make: *** [test] 错误 2

解决办法:

在速度较慢的机器上执行make test可能出现下列错误,无影响



相关内容

热门资讯

天津高空跳伞遇难女子原计划今年... 极目新闻记者 舒隆焕天津高空跳伞项目发生事故,一名女员工和教练遇难(极目新闻5月18日报道)。记者从...
这部电影,道尽了中国人的情义二... 12015年,我还在深圳工作。一个周末,我和小小明妈妈带着小小明,开车好几个小时,就为了看一眼大名鼎...
原创 宇... 「宇宙探索·伽马射线暴——宇宙中最亮的爆炸」 一、什么是伽马射线暴? 1967年,美国Vela...
2026年外贸企业谷歌SEO选... 一、引言:流量困局与增长迷思 2026年,外贸企业面临的营销困境正从“流量获取难”演变为“转化效率低...
原创 科... 你以为的宇宙,有可能是一个超级巨型黑洞,银河系在这个超大黑洞的内部,仅仅只是一粒微不足道的宇宙尘埃!...
伊朗外交部:现阶段谈判重点是结... 当地时间5月21日,伊朗外交部发言人巴加埃在接受媒体采访时表示,现阶段,谈判的重点是结束包括黎巴嫩在...
2026年专业可靠的抖音指环遥... 探索智能遥控新纪元:揭秘指环遥控器的核心技术演进 想象一下:当你在公园记录孩子的童真笑容,双手却...
原创 秦... 摘要:建文软件以“360°可视化”为核心引擎,助力秦皇岛多信建筑重塑“AI+工程管理”新范式。依托覆...
聚力新通信 智启6G未来 6G... 2026年5月21日,以“聚力新通信·智启6G未来”为主题的6G产业创新发展大会暨第九届“绽放杯”上...
别让伪科学教育,毁了孩子的未来... 从“量子波动速读”到“脑屏开发”,再到各类“脑波智慧机”“照相记忆”“蒙眼识字”培训,以及“近红外光...