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

Ubuntu 16.04 two ways to install redis tutorial details (apt and compilation)

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

The tutorials on two ways to install redis for ubuntu 16.04 are as follows:

Method 1: apt installation

To install Redi on a Ubuntu system, you can use the following command:

$sudo apt-get update $sudo apt-get install redis-server

Start Redis

$redis-server

Check to see if redis is started?

$redis-cli

The above command opens the following terminals:

Redis 127.0.0.1 purl 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 shows that we have successfully installed redis.

Method 2: compile and install

Ensure that the network is smooth, select the download work path, and execute the following command to download redis-3.2.6:

Sudo wget http://download.redis.io/releases/redis-3.2.6.tar.gz

Extract the file:

Sudo tar-zxvf redis-3.2.6.tar.gz

The folder redis-3.2.6 is generated under the current directory, and I moved it to the / usr/redis directory:

If you do not have gcc installed, you need to install:

Sudo apt-get install gcc

Go to the redis-3.2.6 directory and execute the following two commands in turn:

Sudo makesudo make install

Will be installed in the directory / usr/local/bin:

Now enter the folder obtained after the previous decompression (mine in / usr/redis), copy the configuration file redis.conf to / etc/redis/, and use the vi command to edit the file, change "daemonize no" to "daemonize yes", that is, set to run as a background process, save and exit after the modification is completed.

Go to the / usr/local/bin directory and execute the command: (default port 6379)

Redis-server / etc/redis/redis.confredis-cli-p 6379

Then execute the command ping, and if the output is pong, it proves that the service started successfully.

Execute a command

Set k1 helloworldget ki

The following information is output:

Execute the quit command to exit, and you can now view the process with the following command:

Ps-ef | grep redis

Summary

The above is the editor to introduce to you the two ways to install redis ubuntu 16.04 tutorial details (apt and compilation), I hope to help you, if you have any questions, please leave me a message, the editor will reply to you in time. Thank you very much for your support to the website!

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: 0

*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