About Redis
Redis is based on memory, or can be based on disk persistence NoSQL database, using C language development.
Data storage structure: Key-value
Installation Environment Preparation
Redis is developed using the C language and needs to be compiled using the GCC compiler.
1) Installing GCC
A) Install from disk mirroring: (reboot the Linux server requires a re-mount disk image)
b) Download the local URL directly from the Mine.repo file using the Yum command
c) Mount command: mount/dev/cdrom/mnt
d) installation command: yum-y install GCC
2) Install upload file plugin
A) tool upload file: (only the root directory can be uploaded)
b) Alt+p upload file can only upload root directory by default
c) Install the plugin: (Can upload files to any directory)
Rz (LRZSZ)
Install command: Yum–y install Lrzsz (directly installed in disk image)
Redis Cache System
Redis is one of the industry's leading key-value NoSQL databases. Similar to memcached, it supports storing more value types, including string (string), list (linked list), set (set), Zset (sorted set-ordered collection), and hash (hash type). These data types support Push/pop, Add/remove, and intersection-set and difference sets, and richer operations, and these operations are atomic. Based on this, Redis supports sorting in a variety of different ways. As with memcached, data is cached in memory to ensure efficiency. The difference is that Redis periodically writes the updated data to disk or writes the modified operation to the appended record file, and Master-slave (Master-Slave) synchronization is implemented on this basis.
Operating mode
1 Import paramiko,redis2 3 R=redis. Redis (host= ' 127.0.0.1 ', port=6379) #连接redis4 r.set (' foo ', ' Bar ') 5 print (R.get (' foo ')) 6 for item in R.hscan_iter (' Info_ 1 '): 7print (Item,type (item))