Excerpt from: Redis Chinese web (http://www.redis.net.cn/)
Redis is an open source (BSD licensed), memory-stored data structure server that can be used as a database, cache, and Message Queuing agent. It supports data types such as strings, hash tables, lists, collections, ordered collections, bitmaps, hyperloglogs, and so on. Built-in replication, LUA scripting, LRU retract, transactions, and different levels of disk persistence, while providing high availability through Redis Sentinel, automatic partitioning via Redis cluster.
Redis download
Redis 3.2.1 is the latest stable version. Click Download.
If you are interested in a beta version or an unstable version, see more Redis downloads.
The Redis version number is in standard practice: The major version number. The patch level , a sub-version number is marked as a standard release, such as 1.2,2.0,2.2,2.4,2.6,2.8, the odd version number is used to denote a non-standard version, For example, the 2.9.x release is a non-standard release version of the Redis 3.0 standard version.
How to install Windows under installation
:https://github.com/dmajkic/redis/downloads.
Redis supports 32bit and 64bit to download. Depending on your actual situation, select the 64bit content CP to the custom drive letter installation directory named Redis. such as C:\reids
Open a CMD window using the CD command to switch directories to C:\redis run redis-server.exe redis.conf .
If you want to be convenient, you can add the path of Redis to the environment variables of the system, so as to save the path again, the latter redis.conf can be omitted, if omitted, the default is enabled. After entering, the following interface is displayed:
At this time another cmd window, the original do not close, otherwise you will not be able to access the server.
Switch to the Redis directory to run the redis-cli.exe-h 127.0.0.1-p 6379 .
Set the key-value pair set MyKey ABC
Remove key value pair get MyKey
Install under Linux
Download, unzip, compile:
- $ wget http://download.redis.io/releases/redis-3.0.6.tar.gz
- $ tar xzf redis-3.0. 6.tar. GZ
- $ cd Redis-3.0. 6
- $ make
Binaries are compiled in the src
directory, including the Redis service program Redis-server, and the client program REDIS-CLI for testing.
Run the service as follows:
- $ src/redis-server
Note this way of starting Redis is using the default configuration. You can also tell Redis to start with the following command using the specified configuration file through the startup parameters.
./Redis-server Redis. Conf
Redis.conf is a default configuration file, relative or absolute path. We can use our own configuration files as needed.
You can use Redis's built-in client to write Redis code:
- $ src/redis-CLI
- Redis> set foo bar
- Ok
- Redis> get foo
- "Bar"
Install under Ubuntu
In Ubuntu system installation Redi can use the following command:
- $sudo apt-get update
- $sudo apt-get install Redis-server
Start Redis
- $redis-server
See if Redis starts?
- $redis-CLI
The above command will open the following terminal:
- Redis 127.0. 0.1:6379>
127.0.0.1 is the native IP, and 6379 is the Redis service port. Now let's enter the PING command.
- Redis 127.0. 0.1:6379> ping
- PONG
The above indicates that we have successfully installed Redis.
Redis Series (i)