Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Steps for installation and use of Redis

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains "the steps of installing and using Redis". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn the steps of installing and using Redis.

# download redis

Hadoop@dblab:/usr/local$ sudo wget http://download.redis.io/releases/redis-5.0.5.tar.gz

Hadoop@dblab:/usr/$ sudo mv redis-5.0.5.tar.gz. / redis

Local$ sudo tar-zxvf redis-5.0.5.tar.gz-C / usr/local

# authorize the redis directory to hadoop users

Hadoop@dblab:/usr/local$ sudo chown-R hadoop:hadoop. / redis

Hadoop@dblab:~$ cd / usr/local/redis/

Hadoop@dblab:/usr/local/redis$ sudo make # compilation

Hadoop@dblab:/usr/local/redis$ sudo make install # installation

# enable Redis server

Hadoop@dblab:/usr/local/redis$ pwd

/ usr/local/redis

Hadoop@dblab:/usr/local/redis$. / src/redis-server

# then create a new terminal and enter the following command to start the Redis client:

Hadoop@dblab:/usr/local/redis$. / src/redis-cli

127.0.0.1purl 6379 >

At this point, Redis is installed and running successfully, and then you can manipulate the Redis database.

# insert data

127.0.0.1 6379 > set Student:95001:Sname Li Yong

OK

127.0.0.1 6379 > set Course:1:Cname library

127.0.0.1 set Sc:95001:1:Grade 6379 >

127.0.0.1 6379 > set Course:8:Cname algorithm

# query data

127.0.0.1 purl 6379 > get Sc:95001:1:Grade

"92"

# Delete data

127.0.0.1 purl 6379 > del Course:8:Cname

(integer) 1

127.0.0.1 purl 6379 > get Course:8:Cname

(nil)

127.0.0.1 6379 > set Student:95001:Sname Li Yong

127.0.0.1 purl 6379 > get Student:95001:Sname

"\ xe6\ x9d\ x8e\ xe5\ x8b\ x87"

# solve the above problem of garbled Chinese content displayed in get key

Hadoop@dblab:/usr/local/redis$. / src/redis-cli-- raw

127.0.0.1 purl 6379 > get Student:95001:Sname

At this point, I believe that everyone on the "Redis installation and use steps" have a deeper understanding, might as well to the actual operation of it! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 242

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report