简介

Redis是一个开源的使用ANSI C语言编写、支持网络、可基于内存亦可持久化的日志型、Key-Value数据库,并提供多种语言的API

安装

CentOS

1
2
3
4
5
6
7
8
9
10
11
12
13
## 安装wget包,有可以忽略
$ yum -y install wget
## 下载Redis
$ wget http://download.redis.io/releases/redis-3.2.9.tar.gz
## 解压Redis
$ tar xzf redis-3.2.9.tar.gz
## 编译安装Redis
$ cd redis-3.2.9
## 安装make包,有可以忽略
$ yum install make
$ make
## 执行安装
$ make install

问题处理

1
2
3
4
5
6
7
8
9
10
11
12
13
# 编译redis时 提示 make: cc: Command not found make: *** [adlist.o] Error 127
$ yum install gcc

# Redis 安装报错 error: jemalloc/jemalloc.h: No such file or directory解决方法
$ make MALLOC=libc

# 登录Redis
redis-cli -h 10.140.0.7 -p 6379
auth 密码



解决Redis之MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled. Please check Redis logs for details about the error
1
2
3
4
5
# 重启Redis 
$ service redis restart

# cd /usr/local/bin
# ./redis-server /etc/redis.conf

参考资料