Get the App
SLTechnology News&Howtos  ›  Development  › 

How to install redis in linux

Shulou Source: shulou.com Published: 2022-06-03 19:09:41 09月27日 Update

This article focuses on "how to install redis in linux". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to install redis in linux.

How to install redis in linux

1.redis installation mode

Yum installation (yum source is configured in advance)

Yuminstallredis-y#

Source code compilation and installation

Manual installation of rpm package

two。 Compile and install redis

Create a folder and save redis (or you don't have to create it)

Mkdirlinux_redis

Cdlinux_redis

1. In the redis directory, download the redis source code package

Wget http://download.redis.io/releases/redis-4.0.10.tar.gz

two。 Decompress the redis source code packet

3. Compile trilogy

Specify the installation path and generate the makefile compilation file

. / installation path of configure--prefix=redis

Start compilation

Make

Compilation and installation

Makeinstall

When compilation is complete, redis commands that can be used are generated by default

/ usr/local/bin/redis-server

4. Modify the redis configuration file to support a more secure startup mode

Vimredis.conf

# parameters for opening redis password

Requirepass123456789

# enable safe mode

Protected-modeyes

# modify the default startup port and binding address of redis

Bind0.0.0.0

Port6800

# filter out the contents of non-blank lines and comment lines, and redirect write to a file

Grep-v "^ $" redis.conf | grep-v "^ #" > linuxredis.conf

# add background startup parameters at the end of the configuration file

Daemonizeyes

5. Start the redis server

Redis-serverlinuxredis.conf

6. Verify that redis is started

Netstat-tunlp | grepredis

Ps-ef | grepredis

7. Specify password to log in to redis

[root@localhostredis-5.0.7] # redis-cli-p6800

127.0.0.1purl 6800 > ping

(error) NOAUTHAuthenticationrequired

127.0.0.1purl 6800 > auth223456789

OK

127.0.0.1purl 6800 > ping

PONG

At this point, I believe you have a deeper understanding of "how redis is installed in linux". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Tags: Compile mode file content configuration security parameters password source code path learning generation utility deeper trilogy no interest background command address Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information Docker NVidia vpn macOS