Redis Linux 安装运行实战全记录

转载自  Redis Linux 安装运行实战全记录

下载Redis

去Redis官网下载最新的Linux包,Redis官方没有Windows版的下载。

https://redis.io/

下载后把包上传到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。

https://redisdesktop.com/download

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/325369.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Ubuntu 免密登录

ssh-keygen的使用方法及配置authorized_keys两台linux机器相互认证

Localdatetime

根据指定日期/时间创建对象 LocalDate localDate LocalDate.of(2018, 1, 13); LocalTime localTime LocalTime.of(9, 43, 20); LocalDateTime localDateTime LocalDateTime.of(2018, 1, 13, 9, 43, 20); System.out.println(localDate); System.out.println(localTime); Sy…

幸运抽奖案例

package xinyunchoujiang;import java.util.Scanner;/*** * * 项目名称:19qn3 * 类名称:CaiDan * 类描述: 幸运抽奖 * 创建人:Mu Xiongxiong * 创建时间:2020-4-2 下午5:13:15 * 修改人:…

基于OAuth2的认证(译)

OAuth 2.0 规范定义了一个授权(delegation)协议,对于使用Web的应用程序和API在网络上传递授权决策非常有用。OAuth被用在各钟各样的应用程序中,包括提供用户认证的机制。这导致许多的开发者和API提供者得出一个OAuth本身是一个认证…

Java 面试就业指导,100 % 提高面试成功率

转载自 Java 面试就业指导,100 % 提高面试成功率 想要成为合格的Java程序员或工程师到底需要具备哪些专业技能,面试者在面试之前到底需要准备哪些东西呢? 本文陈列的这些内容既可以作为个人简历中的内容,也可以作为…

Redis非阻塞I/O多路复用机制

小曲在S城开了一家快递店,负责同城快送服务。小曲因为资金限制,雇佣了一批快递员,然后小曲发现资金不够了,只够买一辆车送快递。 经营方式一 客户每送来一份快递,小曲就让一个快递员盯着,然后快递员开车去…

React前端格式化时间

import moment from "moment";const dateFormat YYYY-MM-DD HH:mm:ss;<DatePicker label"时间" name"insertTime" showTime onChange{onChange} onOk{onOk}defaultValue{moment(location?.defaultValues?.record?.insertTime, dateFormat…

《呐喊》金句摘抄(一)

System.out.print("今天摘抄的是什么书呢&#xff1f;"); String b_name "《呐喊》"; System.out.println("今天读的是"b_name);黑沉沉的灯光&#xff0c;照着宝儿的脸&#xff0c;绯红里带一点青。单四嫂子心里计算&#xff1a;神签也求过了&a…

[认证授权] 4.OIDC(OpenId Connect)身份认证授权(核心部分)

1 什么是OIDC&#xff1f; 看一下官方的介绍&#xff08;http://openid.net/connect/&#xff09;&#xff1a; OpenID Connect 1.0 is a simple identity layer on top of the OAuth 2.0 protocol. It allows Clients to verify the identity of the End-User based on the a…

Round Robin 算法

转载自 Round Robin 算法 什么是Round Robin&#xff1f; 先来看和他相近的名词&#xff0c;轮询调度算法(Round-Robin Scheduling) 轮询调度算法的原理是每一次把来自用户的请求轮流分配给内部中的服务器&#xff0c;从1开始&#xff0c;直到N(内部服务器个数)&#xff0…

《彷徨》金句摘抄

今日读书摘抄金句&#xff1a; System.out.print("今天摘抄的是什么书呢&#xff1f;"); String b_name "《彷徨》"; System.out.println("今天读的是"b_name);入芝兰之室&#xff0c;久而不闻其香小鸭也诚然是可爱&#xff0c;遍身松花黄&…

EasyExcel中输出为时间格式

前端传值 后端Excel配置为String类型 配置为其他类型显示格式转化异常

Identity Service - 解析微软微服务架构eShopOnContainers(二)

接上一篇&#xff0c;众所周知一个网站的用户登录是非常重要&#xff0c;一站式的登录&#xff08;SSO&#xff09;也成了大家讨论的热点。微软在这个Demo中&#xff0c;把登录单独拉了出来&#xff0c;形成了一个Service&#xff0c;用户的注册、登录、找回密码等都在其中进行…

TCP/IP协议——ARP详解

转载自 TCP/IP协议——ARP详解 本文主要讲述了ARP的作用、ARP分组格式、ARP高速缓存、免费ARP和代理ARP。 1.学习ARP前要了解的内容 建立TCP连接与ARP的关系 应用接受用户提交的数据&#xff0c;触发TCP建立连接&#xff0c;TCP的第一个SYN报文通过connect函数到达IP层&a…

RPC远程过程调用之 RMI实现

1&#xff09;RMI&#xff08;remote method invocation&#xff09;是java原生支持的远程调用&#xff0c;RMI采用JRMP&#xff08;java RemoteMessageing Protocol&#xff09;作为通信协议。可以认为是纯java版本的分布式远程调用解决方法。 2&#xff09;RMI的核心概念 3&…

《四世同堂》金句摘抄(一)

System.out.println("今天读的是什么书呢&#xff1f;"); String bname "《四世同堂》"; System.out.println("今天读的书是&#xff1a;"bname);Console.WriteLine("今天读的是什么书呢&#xff1f;"); String bname "《四世同…

[翻译]编写高性能 .NET 代码 第一章:性能测试与工具 -- 选择什么来衡量

选择什么来衡量 在搜集数据测试数据前&#xff0c;你需要知道你要以怎样的指标来衡量测试结果。这听起来很容易&#xff0c;但实际上比你想象中的要难许多。如果你想降低内存使用量&#xff0c;你会选择什么方式呢&#xff1f; 私有工作集&#xff08;Private working set&am…

RPC远程过程调用之Hessian 基于HTTP

Hessian使用C/S方式&#xff0c;基于HTTP协议传输&#xff0c;使用Hessian二进制序列化。 添加依赖&#xff1a; <dependency><groupId>com.caucho</groupId><artifactId>hessian</artifactId><version>4.0.7</version> </depen…

EF框架中,在实体中手动更新字段,数据库数据未同步到程序中应该怎么解决呢?

在一些技术不是很强的选手手中&#xff0c;设计数据库时&#xff0c;难免会未考虑到某些字段&#xff0c;只能到后期实现功能时&#xff0c;才能觉察出来数据库中或是少写字段&#xff0c;或是多加了无用的字段&#xff0c;故我们还不得不去数据库中做些手脚。 本文列举的是在…

[.NET跨平台]Jexus独立版本的便利与过程中的一些坑

本文环境与前言 之前写过一篇相关的文章:在.NET Core之前,实现.Net跨平台之MonoCentOSJexus初体验 当时的部署还是比较繁琐的,而且需要联网下载各种东西..有兴趣的可以看看,但是..已经过时了.. 虽然已经出了.NET Core2.0 但是目前是预览版本,而且部署来说 相对比较麻烦. 今…