Sharp tools make good work.
工欲善其事,必先利其器。

总览概要
1.官方解释什么是Redis?
2.离线状态Redis下载(如果Ubuntu能上外网,则可忽略
3.打开Ubuntu19.04,安装redis全过程
4.总结

一.官方解释什么是Redis?

Redis is an open source (BSD licensed), in-memory data structure store, used as a database, cache and message broker. It supports data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs, geospatial indexes with radius queries and streams. Redis has built-in replication, Lua scripting, LRU eviction, transactions and different levels of on-disk persistence, and provides high availability via Redis Sentinel and automatic partitioning with Redis Cluster.

Redis 是一个开源(BSD许可)的,内存中的数据结构存储系统,它可以用作数据库、缓存和消息中间件。 它支持多种类型的数据结构,如 字符串(strings), 散列(hashes), 列表(lists), 集合(sets), 有序集合(sorted sets) 与范围查询, bitmaps, hyperloglogs 和 地理空间(geospatial) 索引半径查询。 Redis 内置了 复制(replication),LUA脚本(Lua scripting), LRU驱动事件(LRU eviction),事务(transactions) 和不同级别的 磁盘持久化(persistence), 并通过 Redis哨兵(Sentinel)和自动 分区(Cluster)提供高可用性(high availability)。

二.离线状态Redis下载(如果Ubuntu能上外网,则可忽略)

Redis的官方网站:https://redis.io/ Redis的中文官方网站:http://www.redis.cn/ Redis的压缩包下载网站:http://download.redis.io/releases/redis-5.0.5.tar.gz

三.打开Ubuntu19.04,安装redis全过程

前面给的网站是资源包下载路径,但是如果你的Ubuntu19.04连接了网络,你可以Ctrl+Alt+T打开命令行,直接使用命令来安装。

1.wget http://download.redis.io/releases/redis-5.0.5.tar.gz

redistribute命令 redistribute subnets_Linux下redis安装


2.回车后,下载完成后如下图。

redistribute命令 redistribute subnets_redistribute命令_02


3.ls后可以看到

redistribute命令 redistribute subnets_redistribute命令_03


4.解压这个包

用 tar -zxvf redis-5.0.5.tar.gz

解压后如下图

redistribute命令 redistribute subnets_redis安装_04


5.cd redis-5.0.5,再ls,使用make命令。

redistribute命令 redistribute subnets_redis安装_05


6.make命令后等待几分钟,最后看到如下图成功界面

redistribute命令 redistribute subnets_redistribute命令_06


7.安装后在哪里呢?

现在这个目录,cd src,然后ls -l,我们能看到如下所示。

redistribute命令 redistribute subnets_redistribute命令_07


8.redis-cli是我们连接redis是client。当前目录下执行redis-cli ping,如果回车后显示PONG,即为能连通。然后redis-cli -p 6379,出现127.0.0.1:6379,即为最后的连接成功!如果想要退出,输入shutdown,然后回车后再输入exit,就退出了连接。

redistribute命令 redistribute subnets_Linux下redis安装_08

四.总结

本次在Ubuntu安装redis是建立在有网,且有gcc的基础条件下,因为redis是C语言写的,所以可能需要gcc,如果需要,可以按照提示,使用在线安装命令安装gcc。本次安装redis,了解了redis的用途,nosql是什么,今天安装也学习了很多安装命令,也算是对Linux进一步了解吧。