Steps for installation and use of Redis
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!