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

The method of installing Redis in CentOS7 Linux yum

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article mainly introduces the CentOS7 Linux yum installation Redis method related knowledge, detailed and easy to understand, simple and fast operation, has a certain reference value, I believe that everyone reading this CentOS7 Linux yum installation Redis method article will have some gains, let's take a look at it.

1. Install redis

Download fedora's epel repository

yum install epel-release

Install redis database

yum install redis

After installation, start redis service using the following command

#start redisservice redis start#stop redisservice redis stop#view redis status service redis status#view redis process ps -ef| grep redis

Set redis to boot automatically

chkconfig redis on

Enter redis service

#Enter native redisredis-cli#List all keykeys *

Firewall opens corresponding port

#Open 6379/sbin/iptables -I INPUT -p tcp --dport 6379 -j ACCEPT#Save/etc/rc.d/init.d/iptables save# Centos 7 Execute service iptables save2. Modify redis default port and password

open the configuration file

vi /etc/redis.conf

Modify the default port, find port 6379 and modify it to the corresponding port.

Change the default password, find requipass and fix your password

Stop redis service and specify profile restart

service redis stopredis-server /etc/redis.conf &

Log in using port

redis-cli -h 127.0.0.1 -p 6379

use of passwords to authenticate

auth 123

3. Remote connection redis

/etc/redis.conf needs to be modified

#Open redis configuration file vi /etc/redis.conf#Find bind 127.0.0.1 and comment on it #Find protected-mode yes and change it to protected-mode no

restart the service

service redis stopredis-server /etc/redis.conf &

If you modify the above configuration or you cannot connect remotely, please check whether the port is open, the network is connected, and the password is correct.

About "CentOS7 Linux yum installation Redis method" The content of this article is introduced here, thank you for reading! I believe everyone has a certain understanding of the knowledge of "CentOS7 Linux yum installation Redis method". If you still want to learn more knowledge, please pay attention to the industry information channel.

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

Development

Wechat

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

12
Report