redis3.0.2 编译安装(启动参数方式启动)
2015-11-07 21:13
751 查看
1.下载redis3.0.2
[root@Moxiaokai ~]# wget http://download.redis.io/releases/redis-3.0.2.tar.gz [root@Moxiaokai ~]# ll
redis-3.0.2.tar.gz
2.解压并编译安装
[root@Moxiaokai ~]# tar -xzf redis-3.0.2.tar.gz
[root@Moxiaokai ~]# ll
redis-3.0.2 redis-3.0.2.tar.gz
[root@Moxiaokai ~]# cd redis-3.0.2
[root@Moxiaokai redis-3.0.2]# make
检查redis是否有异常
[root@Moxiaokai redis-3.0.2]# make test
[root@Moxiaokai redis-3.0.2]# make install
在 make test时redis-3.0.2的时候可能提示错误:
[root@Moxiaokai redis-3.0.2]# make test
make:cc:Command not found ,make: *** [adlist.o] Error 127
这里是由于新安装的Linux系统没有安装gcc环境,需要安装gcc,为了方便选择用yum进行安装。
[root@Moxiaokai redis-3.0.2]# yum -y install gcc
make: *** [test] Error 1
[root@Moxiaokai redis-3.0.2]# make test
You need tcl 8.5 or newer in order to run the Redis test
make: *** [test] Error 1
root@Moxiaokai redis-3.0.2]#wget http://downloads.sourceforge.net/tcl/tcl8.6.1-src.tar.gz root@Moxiaokai redis-3.0.2]#tar -xzvf tcl8.6.1-src.tar.gz -C /usr/local/
root@Moxiaokai redis-3.0.2]#cd /usr/local/tcl8.6.1/unix/
root@Moxiaokai redis-3.0.2]# ./configure
root@Moxiaokai redis-3.0.2]# make
root@Moxiaokai redis-3.0.2]# make install
3.运行redis
i)开启Server进程
[root@Moxiaokai redis-3.0.2]# ./src/redis-server
24841:C 08 Nov 07:20:33.378 # Warning: no config file specified, using the default config. In order to specify a config file use ./src/redis-server /path/to/redis.conf
24841:M 08 Nov 07:20:33.379 * Increased maximum number of open files to 10032 (it was originally set to 1024).
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 3.0.2 (00000000/0) 64 bit
.-`` .-```. ```\/ _.,_ ''-._
( ' , .-` | `, ) Running in standalone mode
|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
| `-._ `._ / _.-' | PID: 24841
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' | http://redis.io `-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-'
24841:M 08 Nov 07:20:33.381 # Server started, Redis version 3.0.2
24841:M 08 Nov 07:20:33.383 # 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.
24841:M 08 Nov 07:20:33.383 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
24841:M 08 Nov 07:20:33.384 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
24841:M 08 Nov 07:20:33.384 * The server is now ready to accept connections on port 6379
ii)关闭Server进程
[root@Moxiaokai redis-3.0.2]#./redis-cli shutdown
登入客户端进行关闭:
[root@Moxiaokai redis-3.0.2]#./redis-cli
127.0.0.1:6379> shutdown
not connected>
4.程序验证:
[root@vstar75 src]# ./redis-cli
127.0.0.1:6379> set MyName 'Moxiaokia'
OK
127.0.0.1:6379> get MyName
"Moxiaokia"
127.0.0.1:6379>
5.启动参数方式启动Serverredis.conf
[root@Moxiaokai redis-3.0.2]# ./src/redis-server redis.conf
6.将 Redis 作为 Linux 服务随机启动
[root@Moxiaokai redis-3.0.2]#vi /etc/rc.local
加入:
/root/install/redis-3.0.2/src/redis-server
[root@Moxiaokai ~]# wget http://download.redis.io/releases/redis-3.0.2.tar.gz [root@Moxiaokai ~]# ll
redis-3.0.2.tar.gz
2.解压并编译安装
[root@Moxiaokai ~]# tar -xzf redis-3.0.2.tar.gz
[root@Moxiaokai ~]# ll
redis-3.0.2 redis-3.0.2.tar.gz
[root@Moxiaokai ~]# cd redis-3.0.2
[root@Moxiaokai redis-3.0.2]# make
检查redis是否有异常
[root@Moxiaokai redis-3.0.2]# make test
[root@Moxiaokai redis-3.0.2]# make install
在 make test时redis-3.0.2的时候可能提示错误:
[root@Moxiaokai redis-3.0.2]# make test
make:cc:Command not found ,make: *** [adlist.o] Error 127
这里是由于新安装的Linux系统没有安装gcc环境,需要安装gcc,为了方便选择用yum进行安装。
[root@Moxiaokai redis-3.0.2]# yum -y install gcc
make: *** [test] Error 1
[root@Moxiaokai redis-3.0.2]# make test
You need tcl 8.5 or newer in order to run the Redis test
make: *** [test] Error 1
root@Moxiaokai redis-3.0.2]#wget http://downloads.sourceforge.net/tcl/tcl8.6.1-src.tar.gz root@Moxiaokai redis-3.0.2]#tar -xzvf tcl8.6.1-src.tar.gz -C /usr/local/
root@Moxiaokai redis-3.0.2]#cd /usr/local/tcl8.6.1/unix/
root@Moxiaokai redis-3.0.2]# ./configure
root@Moxiaokai redis-3.0.2]# make
root@Moxiaokai redis-3.0.2]# make install
3.运行redis
i)开启Server进程
[root@Moxiaokai redis-3.0.2]# ./src/redis-server
24841:C 08 Nov 07:20:33.378 # Warning: no config file specified, using the default config. In order to specify a config file use ./src/redis-server /path/to/redis.conf
24841:M 08 Nov 07:20:33.379 * Increased maximum number of open files to 10032 (it was originally set to 1024).
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 3.0.2 (00000000/0) 64 bit
.-`` .-```. ```\/ _.,_ ''-._
( ' , .-` | `, ) Running in standalone mode
|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
| `-._ `._ / _.-' | PID: 24841
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' | http://redis.io `-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-'
24841:M 08 Nov 07:20:33.381 # Server started, Redis version 3.0.2
24841:M 08 Nov 07:20:33.383 # 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.
24841:M 08 Nov 07:20:33.383 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
24841:M 08 Nov 07:20:33.384 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
24841:M 08 Nov 07:20:33.384 * The server is now ready to accept connections on port 6379
ii)关闭Server进程
[root@Moxiaokai redis-3.0.2]#./redis-cli shutdown
登入客户端进行关闭:
[root@Moxiaokai redis-3.0.2]#./redis-cli
127.0.0.1:6379> shutdown
not connected>
4.程序验证:
[root@vstar75 src]# ./redis-cli
127.0.0.1:6379> set MyName 'Moxiaokia'
OK
127.0.0.1:6379> get MyName
"Moxiaokia"
127.0.0.1:6379>
5.启动参数方式启动Serverredis.conf
[root@Moxiaokai redis-3.0.2]# ./src/redis-server redis.conf
6.将 Redis 作为 Linux 服务随机启动
[root@Moxiaokai redis-3.0.2]#vi /etc/rc.local
加入:
/root/install/redis-3.0.2/src/redis-server
相关文章推荐
- redis安装问题小结
- Redis偶发连接失败案例实战记录
- Redis中实现查找某个值的范围
- Redis和Memcached的区别详解
- 分割超大Redis数据库例子
- Redis总结笔记(一):安装和常用命令
- Redis sort 排序命令详解
- 用Redis实现微博关注关系
- redis中修改配置文件中的端口号 密码方法
- 在Ruby on Rails上使用Redis Store的方法
- Redis和Memcache的区别总结
- 在Node.js应用中使用Redis的方法简介
- Redis服务器的启动过程分析
- web 应用中常用的各种 cache详解
- 利用yum安装Redis的方法详解
- 从MySQL到Redis的简单数据库迁移方法
- 为啥懒 Redis 是更好的 Redis
- 利用Redis实现SQL伸缩的方法
- 在Redis数据库中实现分布式速率限制的方法
- redis2.8配置文件中文翻译版