1.安装
$ wget http://download.redis.io/releases/redis-2.8.9.tar.gz
$ tar xzf redis-2.8.9.tar.gz
$ cd redis-2.8.9
$ make
make之后,会出现一句提示:
Hint: To run 'make test' is a good idea ;)
其实不测试,一般都可以用。但是既然人家建议了,咱们就走一下make test吧。
运行
#make test
成功以后,提示:
\o/ All tests passed without errors!
Cleanup: may take some time... OK
make[1]: Leaving directory `/root/redis-2.8.9/src'
执行完后,会在当前目录中的src目录中生成相应的执行文件,如:redis-server redis-cli等;
2.精简运行文件
mkdir /usr/local/redis/{conf,bin,db} -pv
cp redis.conf /usr/local/redis/conf
cd src
cp redis-benchmark redis-check-aof redis-check-dump redis-cli redis-server mkreleasehdr.sh /usr/local/redis/bin/
3.启动redis
/usr/local/redis/bin/redis-server /usr/local/redis/conf/redis.conf
[26765] 10 May 23:52:10.706 * Increased maximum number of open files to 10032 (it was originally set to 1024).
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 2.8.9 (00000000/0) 64 bit
.-`` .-```. ```\/ _.,_ ''-._
( ' , .-` | `, ) Running in stand alone mode
|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
| `-._ `._ / _.-' | PID: 26765
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' | http://redis.io
`-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-'
[26765] 10 May 23:52:10.708 # Server started, Redis version 2.8.9
[26765] 10 May 23:52:10.708 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
[26765] 10 May 23:52:10.708 * The server is now ready to accept connections on port 6379
此时启动所有的配置都是默认的,可以看到redis是前台运行,启动服务默认端口6379
4.查询运行
# netstat -tlnp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:6379 0.0.0.0:* LISTEN 26765/redis-server
5.客户端连接
# ./redis-cli
127.0.0.1:6379> set foo bar
OK
127.0.0.1:6379> get foo
"bar"
127.0.0.1:6379>
6.关闭redis
redis-cli shutdown
也可以指定端口:
redis-cli -p 6380 shutdown
分享到:
相关推荐
Windows 上安装 Redis安装Windows 上安装 Redis安装Windows 上安装 Redis安装Windows 上安装 Redis安装Windows 上安装 Redis安装Windows 上安装 Redis安装Windows 上安装 Redis安装Windows 上安装 Redis安装Windows ...
Redis安装配置文档
redis安装的安装使用及其用法
redis安装教程和java操作服务器端demo
Redis安装与卸载文档
redis安装与开发实例,包括redis安装,java代码实例
redis 安装教程,及redis 集群搭建教程 redis 常用操作命令
自己写的一个redis安装及使用手册,很详细的一个安装配置过程.
redis 安装 redis 安装 redis 安装
redis安装文档,包含windows环境及linux环境,亲测安装成功,方便大家进行学习整理,个人觉得非常有必要学习一下~
内含redis安装文件、tcl依赖、安装方法和windows下的管理客户端。没有gcc还需下载gcc离线包,在我的另一个资源。
Linux ContOS7 Redis安装和配置及开机自启 https://blog.csdn.net/sikefeng/article/details/82222154
windows下redis安装部署,redis2.8
linux Redis安装步骤及安装包
redis安装与测试,包含Linux下安装包、安装说明、测试工程,很合适初学者。
redis安装,基本数据类型介绍和基本应用
redis安装部署_压缩版.rar 全
redis安装详细步骤,压缩包内附带redis安装包及安装成功后启动服务的效果图
Redis安装配置Redis安装配置Redis安装配置Redis安装配置Redis安装配置Redis安装配置Redis安装配置Redis安装配置
redis安装的详细过程,有软件下载路径,安装方法,linux 和windows都有