Finally have time to tidy up their notes ....
First, Introduction
REmoteDIctionary Server (Redis) is a key-value Storage System . 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.
Redis is a high-performance Key-value database. The emergence of Redis, to a large extent, compensates for the lack of memcached such key/value storage, in some cases can be a good complement to the relational database. It provides clients such as Java,c/c++,c#,php,javascript,perl,object-c,python,ruby,erlang, which is convenient to use.
Redis supports master-slave synchronization, where data can be synchronized from the primary server to any number of slave servers, and the server can be associated with other primary servers from the server. This enables Redis to perform single-layer tree replication. The data can be written intentionally or unintentionally from the library. Because of the full implementation of the publish/subscribe mechanism, you can subscribe to a channel and receive a complete message release record from the master server when the tree is synchronized anywhere from the database. Synchronization is helpful for the scalability and data redundancy of read operations.
Second, installation
Redis Installation Super Simple
1. Unzip the tar zxvf redis-2.8.18.tar.gz to any directory
2. Compile Make
- Redis-server:redis Server Daemon Startup program
- Redis-cli:redis command-Line Operations tool, Redis Client
- Redis-benchmark:redis Performance testing tools to test the read and write performance of Redis in your system and in your configuration
- Redis-stat:redis Status Detection Tool to detect Redis current status parameters and delay status
Third, testing
System: CentOS 6.4 64-bit
Redis:redis 2.8.18
[Email protected] redis]# tar zxvf redis-2.8.18.tar.gz-c/usr/local/redis/#源码包解压到指定目录
[Email protected] redis-2.8.18]# cd/usr/local/redis/redis-2.8.18/#进入该目录
[[email protected] redis-2.8.18]# make
After compiling the executable file in the SRC directory, you can run Redis using the following command:
[Email protected] redis-2.8.18]#./src/redis-server
[26720] Dec 23:38:07.043 # warning:no config file specified, using the default Config. In order to specify a config file use./src/redis-server/path/to/redis.conf
[26720] DEC 23:38:07.045 * Increased maximum number of open files to 10032 (it is originally set to 1024).
_._
_.-' __ '-._
_.-`` `. `_. "-._ Redis 2.8.18 (00000000/0)
.-`` .-```. ' \ \ _.,_ '-._
(',.-' | ',) Running in Stand alone mode
| '-._ '-...-' __...-. '-._| ' ' _.-' | port:6379
| '-._ '. _/_.-' | pid:26720
'-._ '-._ '-./_.-' _.-'
| '-._ '-._ '-.__.-' _.-' _.-' |
| '-._ '-._ _.-' _.-' | Http://redis.io
'-._ '-._ '-.__.-' _.-' _.-'
| '-._ '-._ '-.__.-' _.-' _.-' |
| '-._ '-._ _.-' _.-' |
'-._ '-._ '-.__.-' _.-' _.-'
'-._ '-.__.-' _.-'
'-._ _.-'
'-.__.-'
[26720] Dec 23:38:07.069 # Server started, Redis version 2.8.18
[26720] Dec 23:38:07.070 # WARNING Overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add ' vm.overcommit_memory = 1 ' to/etc/sysctl.conf and then reboot or run the command ' Sysctl vm.overcom Mit_memory=1 ' for the take effect.
[26720] Dec 23:38:07.072 # WARNING You has Transparent Huge Pages (THP) support for enabled in your kernel. This would create latency and memory usage issues with Redis. To fix this issue run the command ' echo never >/sys/kernel/mm/transparent_hugepage/enabled ' as root, and add it to you R/etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
[26720] Dec 23:38:07.078 # warning:the TCP Backlog setting of 511 cannot be enforced BECAUSE/PROC/SYS/NET/CORE/SOMAXC Onn is set to the lower value of 128.
[26720] DEC 23:38:07.078 * The server is now ready for accept connections on port 6379
Note: Redis is exclusively initiated at this time, default port 6379, to connect Redis need to open a new window
If you want to change the Redis boot mode, you can modify the Redis configuration file redis.conf (in the extracted directory, here is:/usr/local/redis/redis-2.8.18)
About the parameters in the redis.conf, I will write a blog to explain later, look forward to it ^_^
You can use the built-in client to connect Redis
[Email protected] redis-2.8.18]#./src/redis-cli
127.0.0.1:6379> Set MyKey Wangxiuli
Ok
127.0.0.1:6379> Get MyKey
"Wangxiuli"
127.0.0.1:6379>
is not very simple, we have installed successfully.
Redis---Linux environment installation