redis3.0.2 编译安装(启动参数方式启动)
来源:互联网 发布:使用java实现串口通信 编辑:程序博客网 时间:2024/06/04 21:34
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
本文出自 “小陌成长之路” 博客,请务必保留此出处http://309173854.blog.51cto.com/7370240/1710655
- redis3.0.2 编译安装(启动参数方式启动)
- redis3.0.2 编译安装 (启动服务方式启动)
- CentOS7.0 lnmp编译安装Redis3.2.9、设置自启动、php7编译安装Redis
- Redis3.0.3的安装、测试、服务启动、密码设置
- redis3.2.9 编译安装
- kvm安装与启动过程说明-Kernel源码编译方式
- EFI方式编译启动Xen
- CentOS6.5下redis3.0.7安装、启动、关闭、配置密码、开机启动详细步骤
- redis3.2.9完整编译安装
- redis3.0.2安装
- Redis3.2设置为开机启动
- CentOS7 配置redis3.0集群开机启动
- activity的启动方式及其参数总结
- 启动参数
- Hadoop安装——启动模式,基本配置,启动方式
- nginx学习(1):编译、安装、启动
- linux apache(httpd)编译安装和启动
- nginx(tengine)编译安装启动配置
- CodeForces 501A Contest(水题,感觉BUG)
- 千万级PV架构
- TextInputLayout 设置hint和EditText之间的距离的一种方案
- Google大数据三篇著名论文中文版
- Centos学习笔记 by 小陌_0226
- redis3.0.2 编译安装(启动参数方式启动)
- MariaDB10.0.21 编译安装 脚本
- Android Studio:生成 JavaDoc
- 二维码扫描
- 网络虚拟化服务之软件定义网络新机制 A New Mechanism for SDN Network Virtualization Service
- salt-minion dead but pid file exists 正确解决方法
- GitLab完整搭建(版本6.3.1)
- Gitlab RPC failed; result=22, HTTP code = 413 解决方法
- 关于okhhtp使用