Redis introduction:
Redis is an open-source log-type and key-value database written in ansi c language that supports Network, memory-based persistence, and provides APIs in multiple languages. From January 1, March 15, 2010, the development of redis was hosted by VMware.
Redis is a key-value storage system. Similar to memcached, memcached supports more storage value types, including string, list, set, and zset) and hash (hash type ). These data types support push/pop, Add/Remove, Intersection Set and difference set, and more abundant operations, and these operations are atomic. On this basis, redis supports sorting in different ways. Like memcached, data is cached in the memory to ensure efficiency. The difference is that redis periodically writes the updated data to the disk or writes the modification operation to the append record file, and on this basis implements master-slave (master-slave) synchronization.
Installation environment:
Centos 1, 6.5
Redis 2.8.13
Download and install:
Download the file to the/opt/directory
Wget http://download.redis.io/releases/redis-2.8.13.tar.gz
Decompress the file
Tar zxvf redis-2.8.13.tar.gz
Switch directory to redis-2.8.13 directory
CD redis-2.8.13
Run the make command to output the last few lines.
Hint: To Run 'make test' is a good idea ;)
Make [1]: Leaving directory '/opt/redis-2.8.13/src'
Run the installation command
Make install
Tip:
cd src && make installmake[1]: Entering directory `/opt/redis-2.8.13/src‘Hint: To run ‘make test‘ is a good idea ;) INSTALL install INSTALL install INSTALL install INSTALL install INSTALL installmake[1]: Leaving directory `/opt/redis-2.8.13/src‘
Run: cd src & make install
Tip:
Hint: To run ‘make test‘ is a good idea ;) INSTALL install INSTALL install INSTALL install INSTALL install INSTALL instal
Follow the prompts to execute: Make Test
Tip:
You need tcl 8.5 or newer in order to run the Redis testmake: *** [test] Error 1
Reference solution: http://www.linuxfromscratch.org/blfs/view/cvs/general/tcl.html
You can also use the: Yum install TCL command to install
After searching, we found that no installation is required. You can directly execute./redis-server in the src directory.
You can use commands like./redis-server/path/to/redis. conf to specify the configuration file;
Server started, redis version 2.8.13
The server is now ready to accept connections on port 6379
The service is successfully started and listening for connection requests on port 6379.
You can use a built-in client to connect to redis: http://www.redis.cn/download.html
$ src/redis-cliredis> set foo barOKredis> get foo"bar"
Note: To access it remotely, you must enable the firewall port. To keep the service running, you can directly close the terminal window, but do not use Ctrl + C to exit the program.
Redis installation record in centos 6.5