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 基本操作 在安装新版本之前,一 ...
随机推荐
- HTML页面使用layer弹出框输入数据
javascript中layer是一款近年来备受青睐的web弹层组件,layer.open对弹出框进行输入信息,并处理返回结果.详细介绍http://layer.layui.com/ 部署:将laye ...
- 上传文件,经过Zuul,中文文件名乱码
问题描述: 在学习<SpingCloud与Docker微服务架构实战>8.7节 使用Zuul上传文件,测试通过Zuul上传中文文件时出现,文件名.目录名或卷标语法不正确异常:但是直接通过上 ...
- JAVA实训第四次作业
编写"电费管理类"及其测试类. 第一步 编写"电费管理"类 私有属性:上月电表读数.本月电表读数 构造方法:无参.2个参数 成员方法:getXXX()方法.se ...
- Ubuntu 下的QQ WECHAT FOXMAIL解决方案
原文链接: https://www.lulinux.com/archives/1319 真心很强大. Ubuntu系发行版*安装deepin wine QQ的步骤 1,安装deepin-wine环境: ...
- 464. Can I Win
https://leetcode.com/problems/can-i-win/description/ In the "100 game," two players take t ...
- Python——我所学习的turtle函数库
1基础概念 1.1 画布(canvas) 画布就是turtle为我们展开用于绘图区域, 我们可以设置它的大小和初始位置. 常用的画布方法有两个:screensize()和setup(). (1)tur ...
- 2019.03.28 bzoj3595: [Scoi2014]方伯伯的Oj(splay+map+set)
传送门 题意简述: 给一个有优先级的nnn个人的序列,初始的时候第iii个人排名为iii,现在有mmm个操作,种类如下: 把编号为xxx的改成yyy,输出改前xxx的排名 把编号为xxx放到队首,输出 ...
- python 0228
01 cpu 内存 硬盘 操作系统 CPU:中央处理器,相当于人大脑. 飞机 内存:临时存储数据. 8g,16g, 高铁 1,成本高. 2,断电即消失. 硬盘:长期存储大量的数据. 1T 512G等等 ...
- [Java源码解析] -- String类的compareTo(String otherString)方法的源码解析
String类下的compareTo(String otherString)方法的源码解析 一. 前言 近日研究了一下String类的一些方法, 通过查看源码, 对一些常用的方法也有了更透彻的认识, ...
- shell遍历文件夹
遍历目录下的所有文件 假如有一个文件夹路径为dir,遍历文件 for file in /path/dir/* do if test -f $file then echo $file arrary=($ ...