[TOC]
A, redis installation
Redis Introduction
Redis is an advanced key-value database. It is similar with memcached, but data can be persistent, and supported data types is very rich. There are strings, linked lists, hash, set and ordered set of five kinds. Calculating a set of support and on the server side, and cross-complement (-difference), etc., but also supports a variety of sorting. Therefore Redis may be viewed as a data structure of a server. All Redis data are stored in memory, and then from time to time by asynchronously save to disk (this is known as "semi-persistent mode"); can also change each time data is written to a append only file ( aof) inside (this is known as "full-persistent mode").
1. Download redis
|
|
After extracting file directory as follows:
2. Compile redis
|
|
3. Copy the generated executable commands
|
|
4. redis service starts
(1) modify the environment variables (vim ~ / .bash_profile) as follows:
|
|
(2) 修改完成后,记得使用source ~/.bash_profile
生效。
(3) 查看redis-server使用文档
|
|
(4) Starting a Single redis
using the default parameters start redis: redis-server
Specifies the port to start redis:redis-server --port 6380
(5) to allow the remote connection port redis
modify firewall configuration file as follows:
|
|
At this point you can use the client redis-cli connected:redis-cli -h 127.0.0.1 -p 6380
Two, redis master-slave configuration
Three, redis sentinel configuration
Fourth, the reference documentation:
Installation Redis master-slave configuration and
installation redis CentOS (a machine may be mounted a plurality redis)
building a plurality redis instances on one machine
Original: Big Box redis stand-alone multi-instance deployment