设为首页 收藏本站
查看: 677|回复: 0

[经验分享] redis 3.0.7 安装部署

[复制链接]
累计签到:1 天
连续签到:1 天
发表于 2016-11-28 10:59:05 | 显示全部楼层 |阅读模式
############################
基础环境
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可能出现下列错误,无影响




运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-306624-1-1.html 上篇帖子: redis3.2.3安装部署实战 下篇帖子: Redis 3.0 新特性,支持redis 集群
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表