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.1 can.
2. Download Linux commands via network wget http://download.redis.io/releases/redis-3.0.1.tar.gz
Execute after download is complete
$ tar xzf redis-3. 0. 1 . tar.gz$ CD Redis-3.0. 1 $ Make
Redis has been completed to this installation.
The following interface can be seen in execution Redis-server:
Third, let Redis run in the background
Redis is run in the foreground by default, which makes it inconvenient to operate, so Redis can run in the background by setting redis.conf
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
Command mode
/down to search for characters (enter after n next)
? Character to search down (return n prev)
b) Start the Redis service again and specify the startup service profile
Redis-server/usr/local/redis/etc/redis.conf
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
Linux installation Redis