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。

Programming the Mobile Web

Programming the Mobile Web

Maximiliano Firtman / O'Reilly Media / 2010-07-23 / $44.99

* Learn how to use your existing skills to move into mobile web development * Discover the new possibilities of mobile web development, and understand its limitations * Get detailed coverage of ......一起来看看 《Programming the Mobile Web》 这本书的介绍吧!

CSS 压缩/解压工具

CSS 压缩/解压工具

在线压缩/解压 CSS 代码

URL 编码/解码

URL 编码/解码

URL 编码/解码

UNIX 时间戳转换

UNIX 时间戳转换

UNIX 时间戳转换