1. Basic Concepts
Redis is an open-source high-performance key-value storage database developed by Salvatore Sanfilippo (Italy), which released its first version in 2009 and with the same year open source, official site: http://www.redis.io/, The latest stable version is 2.8.17. It is recommended that online business use a stable version earlier than the current 1-2 version ~ Redis itself offers a variety of key-value data types to suit the storage needs of different scenarios, while using his data types combined with various packages of interfaces can be implemented such as caching, queuing and other functions of the application. At the moment, the online business I'm in touch with is using its caching capabilities.
2. Rich Features
1. Data type: String type, hash type, list type, collection type, ordered collection type
2. Memory storage and persistence: Data memory storage, strategy landing drive
3. Feature rich: Cache (Configure time-to-live use), Queue (list type, support blocking read)
4. Support multi-DB: Support 16 databases, NO. 0 database is used by default, you can switch with the Select command.
Note: Multiple databases are not completely isolated, and using flushall will empty all of the data in the DB. The database does not support renaming and does not support separate permission controls.
3. Jane single Ann installed
1234 |
# tar xf redis-2.8.17.tar.gz #发现目录中有Makefile ASCII文件, 可直接编译 # make # make test # make install #实际上执行复制命令到/usr/local/bin下操作(命令可以直接使用) |
4. Common commands
12345 |
redis-server redis.conf # Redis boot command redis-cli #Redis命令行客户端 redis-benchmark #Redis性能测试工具 redis-check-aof #AOF文件修复工具 redis-check-dump #RDB文件检查工具 |
5. Simple to use
1. Configure initialization scripts: Write the start and stop commands to the script
2. Create a required folder: It is recommended to manage Redis by instance, creating separate profiles, log files and data files for each instance
3. Modify the configuration file according to the requirements: recommend the template, use the initialization script to make corresponding changes
4. Set Boot start: Single instance suggestion with Chkconfig management, multi-instance suggestion to join Rc.local file
6. Example
Introduction to Redis basics and installation examples