Detail how to install Redis using yum

  • 2020-05-17 06:52:42
  • OfStack

introduce

Redis is an key-value storage system. Like Memcached, it supports a relatively large number of stored value types, including string(string), list(linked list), set(collection), zset(sorted set, sorted collection), and hash (hash type). These data types all support push/pop, add/remove and take the intersection union and difference sets and richer operations, and these operations are atomic. On top of that, redis supports various sorts of sorting. Like memcached1, data is cached in memory for efficiency. The difference is that redis will periodically write the updated data to disk or write the modified operation to the appended record file, and on this basis, master-slave (master and slave) synchronization is implemented.

This article describes how to install Redis using yum. Without further details, let's take a look at the process in detail.

1. Execute the installation command


yum install redis 

2. Connect the Redis


redis-cli 

Note: if the following error is reported, redis is not enabled


Could not connect to Redis at 127.0.0.1:6379: Connection refused

3. Allow remote access to redis

To support remote access debugging, in addition to the open server port number 6379, you also need to configure the bind 127.0.0.1 Comment out, but release in production to avoid hacking

4. Restart redis


sudo redis-server /etc/redis.conf 

5. Test usage commands


set key "hello world" 

get key 

Return: hello world, installation proved successful

conclusion


Related articles: