First, Redis Introduction
Redis is one of the most popular NoSQL systems today, and it is a key-value storage system. Similar to memcache, but largely compensates for the lack of memcache, which supports storing more value types, including string, list, set, Zset, and hash. These data types support Push/pop, Add/remove, and intersection sets and differences, and richer operations. Based on this, Redis supports sorting in a variety of different ways.
Like Memcache, Redis data is cached in the computer's memory, except that memcache can only cache data in memory and not automatically write to the hard disk periodically, which means that a power outage or restart, memory emptying, and data loss. So Memcache's application scenario is for caching data that does not need to be persisted. The difference between redis is that it periodically writes the updated data to the disk or writes the modified operation to the appended record file, which makes the data persistent.
Second, the installation of Redis
The following is a description of the installation and deployment of Redis under the Linux environment
1, First officer network Download Redis compressed package, address: Http://redis.io/download Download stable version 3.0.7 can.
2, through the Remote management tool, the compressed package copy to the Linux server, to perform the decompression operation
3. Perform make to compile files after Redis decompression
After compiling, you can see that the extracted file redis-3.0.7 will have the corresponding SRC, conf and other folders, which is the same as installing the extracted files under Windows, most of the installation packages will have corresponding class files, configuration files and some command files.
4, after the successful compilation, enter the SRC folder, execute make install for Redis installation
5, the installation is complete, the interface is as follows
Iii. Deployment of Redis
After the installation is successful, Redis is deployed below
1, first for the convenience of management, the Redis file in the Conf configuration files and common commands to move to the unified file
A) Creating Bin and redis.conf files
Copy CodeThe code is as follows:
Mkdir-p/usr/local/redis/bin
Mkdir-p/usr/local/redis/ect
b) Execute the Linux file Move command:
Copy CodeThe code is as follows:
Mv/lamp/redis-3.0.7/redis.conf/usr/local/redis/etc
Cd/lamp/redis-3.0.7/src
MV mkreleasdhdr.sh Redis-benchmark redis-check-aof redis-check-dump redis-cli redis-server/usr/local/redis/bin
2, execute Redis-server command, start Redis service
Note: The Redis service, which executes the redis-server boot directly, is run directly in the foreground (as an effect), that is, if LUnix closes the current session after executing the command, the Redis service is closed. Under normal circumstances, starting the Redis service requires booting from the background and specifying a startup configuration file.
3. Back-up Redis service
A) First edit the Conf file and change the Daemonize property to Yes (indicating that you need to run in the background)
CD etc/
Vi redis.conf
b) Start the Redis service again and specify the startup service profile
Redis-server/usr/local/redis/etc/redis.conf
4. After the server starts successfully, execute REDIS-CLI to start the Redis client and view the port number.
Iv. Summary of common commands for Linux and Redis operations
Linux:
Cd/usr from subfolders into parent folder usr
CD local from parent to child
mv/a/b Moves file A to B
VI usr/local/redis/redis.conf Edit redis.conf file
: Wq Save the changes and exit
Redis:
redis-server/usr..../redis.conf start the Redis service and specify the configuration file
REDIS-CLI starting the Redis client
Pkill redis-server off Redis service
REDIS-CLI Shutdown Close Redis Client
Netstat-tunpl|grep 6379 View Redis default port number 6379 occupancy
Installation and deployment of Redis under Linux