Redis Linux 安装运行实战全记录
下载Redis
去Redis官网下载最新的Linux包,Redis官方没有Windows版的下载。
下载后把包上传到Linux服务器。
安装Redis
1、解压Redis包
> tar -zxvf redis-4.0.2.tar.gz
2、切换到Redis解压目录
> cd redis-4.0.2
3、编译Redis
> make
如报错按以下错误解决。
make: cc:命令未找到
make: *** [adlist.o] 错误 127
> yum install gcc
collect2: ld returned 1 exit status
make[1]: *** [redis-server] Error 1
make[1]: Leaving directory `/usr/local/redis/src'
make: *** [all] Error 2
> vi src/.make-settings,修改OPT=-O2 -march=x86-64
4、编译测试
> make test
报错解决。
make[1]: Entering directory
/home/test/redis-4.0.2/src' CC Makefile.dep make[1]: Leaving directory/home/test/redis-4.0.2/src'
make[1]: Entering directory/home/test/redis-4.0.2/src' You need tcl 8.5 or newer in order to run the Redis test make[1]: *** [test] Error 1 make[1]: Leaving directory/home/test/redis-4.0.2/src'
> wget http://downloads.sourceforge.net/tcl/tcl8.6.7-src.tar.gz
> tar -zxvf tcl8.6.7-src.tar.gz
> cd tcl8.6.7/unix/
> ./configure
> make
> make install
5、安装
切换到redis目录执行安装。
> make install
启动Redis
启动redis src目录下的redis-server命令来启动Redis服务。
> ./redis-server ../redis.conf
启动成功画面:
6651:C 17 Nov 09:24:43.145 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
6651:C 17 Nov 09:24:43.145 # Redis version=4.0.2, bits=64, commit=00000000, modified=0, pid=6651, just started
6651:C 17 Nov 09:24:43.145 # Configuration loaded
6651:M 17 Nov 09:24:43.147 # You requested maxclients of 10000 requiring at least 10032 max file descriptors.
6651:M 17 Nov 09:24:43.147 # Server can't set maximum open files to 10032 because of OS error: Operation not permitted.
6651:M 17 Nov 09:24:43.147 # Current maximum open files is 4096. maxclients has been reduced to 4064 to compensate for low ulimit. If you need higher maxclients increase 'ulimit -n'.
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 4.0.2 (00000000/0) 64 bit
.-`` .-```. ```\/ _.,_ ''-._
( ' , .-` | `, ) Running in standalone mode
|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
| `-._ `._ / _.-' | PID: 6651
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' | http://redis.io
`-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-'
6651:M 17 Nov 09:24:43.157 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
6651:M 17 Nov 09:24:43.158 # Server initialized
6651:M 17 Nov 09:24:43.158 # 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.
6651:M 17 Nov 09:24:43.158 # 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.
6651:M 17 Nov 09:24:43.158 * Ready to accept connections
连接Redis
启动redis src目录下的redis-cli命令来连接到Redis服务。
> ./redis-cli
连接成功:
127.0.0.1:6379>
另外推荐使用客户端连接工具:redis desktop manager。
关注下面的微信公众号,回复 “答案” 获取全套Redis面试题及答案。
Redis Linux 安装运行实战全记录的更多相关文章
- Redis - (Linux)安装与配置
Redis 是完全开源免费的,遵守BSD协议,是一个高性能的key-value数据库. Redis 与其他 key - value 缓存产品有以下三个特点: 1:Redis支持数据的持久化,可以将内存 ...
- redis linux 安装及jedis连接测试
一.安装配置 1:下载redis下载地址 http://code.google.com/p/redis/downloads/list推荐下载redis-1.2.6.tar.gz,之前这个版本同事已经有 ...
- redis linux安装与简单集群配置
由于项目原因最近在使用redis,把redis的安装以及配置记录下来方便查看. 1.下载 地址http://download.redis.io/releases/ 需要哪个版本就使用那个版本 2.解 ...
- Asp.net MVC + Redis(Linux安装Redis)
最近有幸在工作中用到了redis,玩的还算开心.但是发现Redis在Windows上并不是满血状态的,所以决定安装一个Linux的虚拟机,让Redis在Linux上运行. 虚拟环境 虚拟机,我已经玩了 ...
- Mycat分布式数据库架构解决方案--Linux安装运行Mycat
echo编辑整理,欢迎转载,转载请声明文章来源.欢迎添加echo微信(微信号:t2421499075)交流学习. 百战不败,依不自称常胜,百败不颓,依能奋力前行.--这才是真正的堪称强大!!! Myc ...
- Redis Linux安装+配置
1.进入指定目录,下载资源(也可本地下载后复制到指定目录) wget http://download.redis.io/releases/redis-5.0.5.tar.gz 2.解压到指定目录 ta ...
- cmd&Linux 下使用mysql全记录
php mysql数据库常用cmd命令集 show databases; 显示数据库 create database name; 创建数据库 use databasename; 选择数据库 drop ...
- HTTPS从认识到线上实战全记录
前言 关于HTTPS,基本上你想知道的都在这里了.本文原标题<HTTPS原理与实践>,下图是本文配套PPT的目录截图: [TOC] 原理篇 认识HTTPS 先说一下,本文可能有些地方由于描 ...
- linux 安装 python 最全教程
环境:centos6.5 centos6.5 自带的 python 版本是 2.6.6,需要重新安装 2.7: centos7 自带的 python 版本是 2.7.5 基本操作 在安装新版本之前,一 ...
随机推荐
- pip install rrdtool
fatal error: rrd.h: No such file or directory apt-get install librrd-dev
- JS中的instanceof和typeof,以及特殊引用类型
1.instanceof是用于测试对象类型,通常格式为:a instanceof b,返回true或falise,表示为对象a是否是类型b的实例. typeof则是用于测试基本类型,包括undefin ...
- SAS 操作数据集的观测
SAS 操作数据集的观测 1. SAS表达式 表达式是操作数和操作符的序列,该序列会形成一组可执行并产生 结果值的指令.其中,操作数可以是常量.变量或表达式:操作符是表 示比较.数学计算或逻辑运算的 ...
- Logback简单使用
1. 添加jar包/maven配置 <dependency> <groupId>ch.qos.logback</groupId> <artifactI ...
- 28. 实现strStr()
实现 strStr() 函数. 给定一个 haystack 字符串和一个 needle 字符串,在 haystack 字符串中找出 needle 字符串出现的第一个位置 (从0开始).如果不存在,则返 ...
- Web表现层
目录 Web表现层调用过程... 2 延迟... 3 什么是延迟... 3 延迟的构成... 3 最基本的优化思路:... 4 Web表现层性能优化... 4 Web性能的基本指标... 4 Web性 ...
- Python3学习(1)——初步了解
Python是解析性语言,Python解释器将源程序解释并执行. 基本语法 print() --打印字符串 -直接打印 print("hello world") 结果: hel ...
- Vue下载页面显示内容
摘抄自 https://www.cnblogs.com/zhangtianqi520/p/9323873.html 先下载所需依赖 npm install --save html2canvas npm ...
- Spring的声明式事务管理<tx:advice/>
<tx:advice/> 有关的设置 这一节里将描述通过 <tx:advice/> 标签来指定不同的事务性设置.默认的 <tx:advice/> 设置如下: 事务传 ...
- ArcSDE
ArcSDE,即数据通路,是ArcGIS的空间数据引擎,它是在关系数据库管理系统(RDBMS)中存储和管理多用户空间数据库的通路.从空间数据管理的角度看,ArcSDE是一个连续的空间数据模型,借助这一 ...