Redis Installation
Linux under the Environment install Redis, I download here is 3.0.0 version (currently the latest 3.2.0).
wget http://download.redis.io/releases/redis-3.0.0.tar.gztar xzf redis- 3.0. 0. Tar . gz$ CD Redis-3.0. 0 make
So Redis is installed, and then you start Redis:
$ src/redis-server
To connect Redis with a client tool that comes with you, reopen a window, enter into the redis-3.0.0 directory, enter:
$ src/redis-cli
Seeing the message means the connection is successful.
Redis Operations Basic Commands
- String
Command: Set key value, get key values with get
- Hash
Command: Hmset key field value [Field1 value1 ...]
A Redis hash stores a mapping between a string field and a string value, so it is used to represent the object.
- List
Command: Lpush key value [value ...] to queue one or more elements from the left side of the list
Command: Rpush key value [value ...] to enqueue one or more elements from the right side of the list
- Set Set (unordered)
Command: Sadd key value [value ...]
- Set set:sorted sets (ordered)
Command: Zadd key score Member[member ...]
One or more members added to the ordered set, or the score is updated if it already exists
- To view Redis consumption memory size
Command: Info
- View all keys in Redis
Command: Keys *
Learn redis-installation and basic commands