redis 3.0.7 安装部署

本文涉及的产品
云原生内存数据库 Tair,内存型 2GB
云数据库 Redis 版,社区版 2GB
推荐场景:
搭建游戏排行榜
云数据库 Redis 版,经济版 1GB 1个月
简介:

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

基础环境

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可能出现下列错误,无影响











本文转自 roidba 51CTO博客,原文链接:http://blog.51cto.com/roidba/1876589,如需转载请自行联系原作者
相关实践学习
基于Redis实现在线游戏积分排行榜
本场景将介绍如何基于Redis数据库实现在线游戏中的游戏玩家积分排行榜功能。
云数据库 Redis 版使用教程
云数据库Redis版是兼容Redis协议标准的、提供持久化的内存数据库服务,基于高可靠双机热备架构及可无缝扩展的集群架构,满足高读写性能场景及容量需弹性变配的业务需求。 产品详情:https://www.aliyun.com/product/kvstore     ------------------------------------------------------------------------- 阿里云数据库体验:数据库上云实战 开发者云会免费提供一台带自建MySQL的源数据库 ECS 实例和一台目标数据库 RDS实例。跟着指引,您可以一步步实现将ECS自建数据库迁移到目标数据库RDS。 点击下方链接,领取免费ECS&RDS资源,30分钟完成数据库上云实战!https://developer.aliyun.com/adc/scenario/51eefbd1894e42f6bb9acacadd3f9121?spm=a2c6h.13788135.J_3257954370.9.4ba85f24utseFl
目录
相关文章
|
3天前
|
NoSQL 数据可视化 Redis
Mac安装Redis
Mac安装Redis
12 3
|
3天前
|
NoSQL Ubuntu 安全
在Ubuntu 18.04上安装和保护Redis的方法
在Ubuntu 18.04上安装和保护Redis的方法
13 0
|
4天前
|
存储 NoSQL Java
使用redis进行手机验证码的验证、每天只能发送三次验证码 (redis安装在虚拟机linux系统中)
该博客文章展示了如何在Linux虚拟机上使用Redis和Jedis客户端实现手机验证码的验证功能,包括验证码的生成、存储、验证以及限制每天发送次数的逻辑,并提供了测试结果截图。
使用redis进行手机验证码的验证、每天只能发送三次验证码 (redis安装在虚拟机linux系统中)
|
4天前
|
NoSQL Linux 网络安全
Linux系统安装Redis
该博客文章详细介绍了在Linux系统中安装Redis的步骤,包括下载、编译、配置、启动Redis服务以及使用客户端访问Redis数据库的过程。
Linux系统安装Redis
|
7天前
|
NoSQL Redis Docker
Docker 安装 Redis
Docker 安装 Redis
31 2
|
22天前
|
NoSQL Linux Redis
linux 安装redis
linux 安装redis
70 3
|
23天前
|
NoSQL 前端开发 Linux
入职必会-开发环境搭建45-Linux软件安装-安装Redis
本文介绍了在Linux中3种安装Redis的方式和连接方式
|
3天前
|
存储 NoSQL Ubuntu
如何安装和使用 Redis
如何安装和使用 Redis
10 0
|
3天前
|
存储 NoSQL Ubuntu
在Ubuntu 16.04上安装和配置Redis的方法
在Ubuntu 16.04上安装和配置Redis的方法
6 0
|
25天前
|
缓存 NoSQL Linux
入职必会-开发环境搭建26-Redis下载和安装
Redis是一个开源的、内存中的数据结构存储系统,用作数据库、缓存、消息中间件。它提供了丰富的数据结构,包括字符串、哈希、列表、集合、有序集合、位图、HyperLogLog、地理空间索引和流。以下是 Redis 的一些主要特点和用途。