Redis 安装

更新时间: 2019-07-07 15:54

Redis 最新稳定版本下载地址:http://redis.io/download

本教程使用的 redis 版本为 2.8.17

Linux 下安装

从 redis 官网下载并安装:

$ wget http://download.redis.io/releases/redis-2.8.17.tar.gz
$ tar xzf redis-2.8.17.tar.gz
$ cd redis-2.8.17
$ make

make 完后 redis-2.8.17 目录下会出现编译后的 redis 服务程序 redis-server ,还有用于测试的客户端程序redis-cli,两个程序位于安装目录 src 目录下:

下面启动redis服务:

$ cd src
$ ./redis-server

注意这种方式启动redis 使用的是默认配置。也可以通过启动参数告诉redis使用指定配置文件使用下面命令启动。

$ cd src
$ ./redis-server ../redis.conf

redis.conf 是一个默认的配置文件。我们可以根据需要使用自己的配置文件。

启动 redis 服务进程后,就可以使用测试客户端程序 redis-cli 和 redis 服务交互了。 比如:

root@centos7php7 software]# /usr/local/redis/bin/redis-cli
127.0.0.1:6379> set web_name codercto
OK
127.0.0.1:6379> get web_name
"codercto"

Ubuntu 下安装

在 Ubuntu 系统安装 Redis 可以使用以下命令:

$sudo apt-get update
$sudo apt-get install redis-server

启动 Redis 服务

$ redis-server

启动 Redis 客户端

$ redis-cli

以上命令将打开以下终端:

redis 127.0.0.1:6379>

127.0.0.1 是本机 IP ,6379 是 redis 服务端口。现在我们输入 PING 命令。

redis 127.0.0.1:6379> ping
PONG

以上说明我们已经成功安装了redis。

Building Social Web Applications

Building Social Web Applications

Gavin Bell / O'Reilly Media / 2009-10-1 / USD 34.99

Building a social web application that attracts and retains regular visitors, and gets them to interact, isn't easy to do. This book walks you through the tough questions you'll face if you're to crea......一起来看看 《Building Social Web Applications》 这本书的介绍吧!

在线进制转换器

在线进制转换器

各进制数互转换器

HTML 编码/解码

HTML 编码/解码

HTML 编码/解码

html转js在线工具

html转js在线工具

html转js在线工具