1. Redis introduction Redis open-source memory database, which stores data in Key-Value mode; Redis features: 1) Redis data is fully stored in the memory, the disk is used only to persist data and solve the problem of data loss caused by server restart. 2) compared with other Key-Value databases, Redis has a wide range of data types. 3
1. Redis introduction Redis open-source memory database, which stores data in Key-Value mode; Redis features: 1) Redis data is fully stored in the memory, the disk is used only to persist data and solve the problem of data loss caused by server restart. 2) compared with other Key-Value databases, Redis has a wide range of data types. 3
1. Redis introduction Redis open-source memory database, which stores data in Key-Value mode; Redis features: 1) Redis data is fully stored in the memory, the disk is used only to persist data and solve the problem of data loss caused by server restart. 2) compared with other Key-Value databases, Redis has a wide range of data types. 3) redis can copy data to any number of slave servers.
2. Advantages of Redis 1) Fast execution: about 0.11 million sets can be executed per second, with more than 81000 records; 2) rich data types: redis supports data types familiar to most data developers: String, list, set, sorted set, and hash data types; 3) Atomic operations: all Redis operations are atomic. 4) multi-functional utility:
3. Install Redis in the form of source code compilation. Install Redis in Ubuntu14.04. Redis edition: redis-3.0.7.tar.gz
1)unzip decompress redis-3.0.7.tar.gz:
tar -xzvf redis-3.0.7.tar.gz
2) install the relevant environment (g ++, make). If the server has been installed, skip this step:If g ++ is not installed, you must first install:
sudo apt-get install g++
If make is not installed, install:
sudo apt-get install make
3) switch to the redis-3.0.7 directory, compile the program, install the program (the premise is that the server to install make ):
make
[If an error occurs] make [1]: Entering directory '/home/cb/environment/redis-3.0.7/src' CC adlist. o ..... then execute the following command to compile:
make MALLOC=libc
Compiled successfully:
4) Go to the src directory and explain the relevant files:
5) Create the Redis running Directory: mkdir/home/cb/ToolSoftware/redis;
6) copy the file redis-cli and redis-server to the Redis running directory;
cp redis-cli redis-server /home/cb/ToolSoftware/redis
7), switch to the redis-3.0.7 directory, the redis. conf is also copied to the Redis running directory;
cp redis.conf /home/cb/ToolSoftware/redis
8). The effect of successfully starting the Redis service on the front end (Ctrl + c will close the Service ):./Redis-server
After the service is started successfully, the system runs a process:
After ctrl + c, the redis-server Service is also disabled.
9) Start the Redis service at the backend:Modify the configuration file redis. config: Set daemonize no --> daemonize yes # The default service is frontend startup, set to yes, the service is started at the backend; the command to start the Redis service at the backend is as follows:
./Redis-server redis. conf # import the configuration file;
After the backend successfully starts the Redis service, the system starts a redis-server service process.
10) enter the Redis command terminal:
./redis-cli