I. Overview of getting Started with Redis1, what is it?
(1) Full name:REmote DIctionary Server(Remote dictionary server). is completely open source free, in C language, adhere to the BCD protocol. is a high-performance (key/value) distributed memory Database,
a NoSQL database that runs on memory and supports persistence is one of the most popular NoSQL databases today . It is also known as a data structure server.
(2) Redis and other Key-value cache products have the following three features
i) Redis support data persistence, can keep in-memory data on disk, reboot can be loaded again for use
II) Redis not only supports simple key-value types of data, but also provides storage of data structures such as List,set,zset,hash
III) Backup of Redis support data, i.e. data backup in Master-slave mode
2, what do you do?
(1) memory storage and persistence: Redis supports asynchronous writing of in-memory data to the hard disk without affecting the continuation of the service
(2) Take the latest n data operations, such as: You can put the latest 10 reviews of the ID in the Redis list collection
(3) analog similar to httpsession this need to set the expiration time function
(4) Publish and subscribe to the message system
(5) Timer, counter
3, where to go?
(1) Http://redis.io/
(2) Http://www.redis.cn/
4, how to play?
(1) Data type, basic operation and configuration
(2) Persistence and replication, rdb/aof
(3) Control of transactions
(4) Copy
(5) ....
Second, installation1. Check if Redis is installed
[Email protected] ~]# Rpm-qa | grep Redis
2. Download Redis
Official address: http://redis.io/I under the version: redis-3.2.0.tar.gz
3 , detailed steps(1) decompression
[Email protected] local]# TAR-ZXVF redis-3.2. 0. tar.gz
(2) Compiling
[Email protected] local]# CD redis-3.2. 0
The C compiler is not installed to report the following error
[Email protected] redis-3.2. 0 ]# Make
&& make allmake[1]: Enter Directory "/usr/local/redis-3.2. 0/src " CC adlist.o/bin/sh:cc: Command not found make[1127make[ 1]: Leave the directory "/usr/local/redis-3.2". 0/2
Install the C compiler and compile
[Email protected] redis-3.2. 0
[[email protected] redis-3.2.0]# make
CD src && make all
MAKE[1]: Enter directory "/USR/LOCAL/REDIS-3.2.0/SRC"
CC ADLIST.O
In file included from adlist.c:34:0:
ZMALLOC.H:50:31: Fatal error:jemalloc/jemalloc.h: No file or directory
#include <jemalloc/jemalloc.h>
^
Compile interrupts.
MAKE[1]: * * [ADLIST.O] Error 1
MAKE[1]: Leave directory "/USR/LOCAL/REDIS-3.2.0/SRC"
Make: * * * [ALL] Error 2
Fix "jemalloc/jemalloc.h: There is no file or directory" problem, in the compilation (because the last compilation failed, there are residual files)
[Email protected] redis-3.2. 0 ]# make Distclean[[email protected] Redis-3.2. 0] # Make && make install
(3) Modify the configuration file
first back up the factory configuration file [[email protected] Redis-3.2. 0 ]# CP redis.conf redis.conf.bak[[email protected] Redis-3.2. 0] # Vim Redis.conf
change daemonize Default No to Yes---> Redis service background run
(4) Start-up service
[Email protected] redis-3.2. 0] # cd/usr/local/bin/[[email protected] bin]# Redis-server/usr/local/redis-3.2. 0/redis.conf
(5) Start the client test
6379 127.0. 0.1:6379set1OK127.0. 0.1:6379get a"1"
At this point, Redis has been installed successfully and can be used normally.
Redis Learning Notes (i)