下载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'<br/>CC Makefile.dep<br/>make[1]: Leaving directory/home/test/redis-4.0.2/src'
make[1]: Entering directory /home/test/redis-4.0.2/src'<br/>You need tcl 8.5 or newer in order to run the Redis test<br/>make[1]: *** [test] Error 1<br/>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

关注下面的微信公众号,回复 “答案” 获取全套Redis面试题及答案。

转载于:https://blog.51cto.com/honly/2167526

Redis Linux 安装运行实战全记录相关推荐

  1. [转]ubuntu 安装code blocks全记录

    ubuntu 安装code blocks全记录 转载来自 csdn 日志 (一)安装步骤: 1.先把编译环境,C库.C++库和Boost库装好,如下: sudo apt-get install bui ...

  2. ubuntu 安装code blocks全记录

    ubuntu 安装code blocks全记录   (一)安装步骤: 1.先把编译环境,C库.C++库和Boost库装好,如下: sudo apt-get install build-essentia ...

  3. Linux安装7z压缩软件记录

    ** Linux安装7z压缩软件记录 ​ 官网下载文件p7zip_16.02_src_all.tar.bz2 下载链接 将下载的包上传到linux,使用如下命令解压缩并安装 解压 tar xjvf p ...

  4. linux安装运行redis

    redis是一个非关系型数据库,是一个存储键值对的数据库,通常被称为数据结构服务器. 值(value)可以是字符串(String).哈希(Hash).列表(list).集合(sets)和有序集合(so ...

  5. linux安装运行jmeter,Linux下安装运行Jmeter程序

    Jmeter在linux系统中运行需要安装jdk和Jmeter两个软件: 1.安装JDK 先检查系统是否有安装jdk,在linux中执行如下命令:java -version  如果返回版本信息,说明系 ...

  6. Redis Linux安装 --码之狼

    需要工具 : 虚拟机 Linux系统虚拟机 Xftp 文件上传 网盘连接:https://pan.baidu.com/s/1OdAgkdsX894DBim9NNqY6Q 提取码:d9d9 RedisD ...

  7. 史上最详细的UEFI+GTP安装ubuntu18.04LTS全记录,涵盖安装过程中的各种问题,所有的问题都将在这里终结。

    首先,若还有朋友不知道UEFI,可以先百度了解一下.截止到现在2019年,90%的朋友所使用的电脑都支持UEFI,不支持UEFI的电脑应该已经退役的差不多了.所以当你百度了解UEFI之后,相信你会有想 ...

  8. HTTPS从认识到线上实战全记录

    https://www.cnblogs.com/liuxianan/p/https.html 前言 关于HTTPS,基本上你想知道的都在这里了(当然仅限入门).本文原标题<HTTPS原理与实践& ...

  9. redis linux安装配置,linux下安装配置单点redis

    so easy. step1. 下载资源 redis-4.0.10.tar.gz step2. 解压到 /usr/local/redis下面 tar -zxvf redis-4.0.10.tar.gz ...

最新文章

  1. Android Studio 项目打包成apk时 Signature Version 的选择
  2. Oracle 12C 新特性之级联truncate
  3. Anaconda中安装pytorch,并在pycharm中配置【win10】
  4. 中国金刚石线行业“十四五规划”与未来产销需求预测报告2021-2027年
  5. C语言中,指针在一个自定义且不带返回值是如何改变外部一些变量的(指针与函数的相互作用)
  6. python字符串类型str_python数据类型之字符串类型str
  7. setitimer()函数
  8. Srping事务的传播行为和隔离级别
  9. ansible 循环与条件判断when
  10. 用U盘制作Windows7安装以及MacBook Air上装Win7
  11. 3CDaemon FTP使用教程
  12. project甘特图导出图片_Project2013教程-常见视图-甘特图
  13. 国内计算机三大期刊+ JCST
  14. java多线程视频转码_java 后台视频转码、压缩工具
  15. 解决Duo13内置博通蓝牙和博通Wifi冲突
  16. 海岛奇兵服务器维护中怎么办,海岛奇兵无法更新解决方法介绍
  17. 前端---HTML5如何制作一个折线图
  18. 关于计算机这个行业,中级技工证书有什么意义吗?
  19. 数据结构与算法——每日一练(12月)
  20. 5款软件压力测试工具分享

热门文章

  1. Unity3D 游戏引擎之IOS高级界面发送消息与Unity3D消息的接收(九)
  2. linux解压后缀为.xz,xz后缀名文件解压方法
  3. 按照秒数延时打印、运行
  4. 光流 | OpenCV中的光流有关函数
  5. 数据库mysql驱动在8.0以上解决时区问题
  6. Qt学习(八):QT中TCP传输文件
  7. Sybase和mysql语法_主流数据库复制表结构(SqlServer/Mysql/Oracle/Sybase)[语法差异分析]...
  8. 数字语音信号处理学习笔记——语音信号的短时时域分析(4)
  9. MFC中SendMessage的用法与相应函数的添加
  10. 日志库EasyLogging++学习系列(1)—— 简要介绍