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

How does CentOS7.6 deploy Redis5.0.3

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

Share

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

This article mainly introduces "how to deploy Redis5.0.3 in CentOS7.6". In daily operation, I believe many people have doubts about how to deploy Redis5.0.3 in CentOS7.6. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the doubts about "how to deploy Redis5.0.3 in CentOS7.6". Next, please follow the editor to study!

one。 Deployment steps

1. Install gcc dependency

Since redis is developed in C language, you must confirm whether to install the gcc environment (gcc-v) before installation, and if not, execute the following command to install.

# yum install-y gcc

2. Download and install

# wget http://download.redis.io/releases/redis-5.0.3.tar.gz# tar-zxvf redis-5.0.3.tar.gz

3. Switch to unzipped directory compilation

# cd redis-5.0.3# make

4. Install to the specified directory

# make install PREFIX=/usr/local/redis

5. Firewall Settings

# firewall-cmd-zone=public-add-port=6379/tcp-permanent# firewall-cmd-reload# firewall-cmd-zone=public-query-port=6379/tcp II. Start the service

1. The front desk starts.

# cd / usr/local/redis/bin/#. / redis-server

2. Start in the background

Copy redis.conf from the redis source directory to the redis installation directory

# cp / home/ptcvi/redis-5.0.3/redis.conf / usr/local/redis/bin/# vi redis.conf

Modify the redis.conf file to change daemonize no to daemonize yes

Add IP

Background start

#. / redis-server redis.conf III Boot configuration

Add Boot Startup Service

# vi / etc/systemd/system/redis.service

Copy and paste the following:

[Unit] Description=redis-serverAfter=network.target [Service] Type=forkingExecStart=/usr/local/redis/bin/redis-server / usr/local/redis/bin/redis.confPrivateTmp= true[Install] WantedBy=multi-user.target

Note: ExecStart is configured as the installation path

Create a redis command soft link

# ln-s / usr/local/redis/bin/redis-cli / usr/bin/redis

Set up boot boot

# systemctl daemon-reload# systemctl enable redis.service# systemctl start redis.service IV. Set password

Locate the redis.windows.conf configuration file in the redis root directory, search requirepass, find the comment password line, and add the password as follows:

# requirepass foobaredrequirepass redis#123 / / Note that there can be no spaces before the line

Restart the service

# systemctl restart redis.service V. Service Common commands start redis Service # systemctl start redis.service stop redis Service # systemctl stop redis.service restart Service # systemctl restart redis.service View Service current status # systemctl status redis.service Settings Boot self-start # systemctl enable redis.service stop Boot self-startup # systemctl disable redis.service, the study on "how to deploy Redis5.0.3 by CentOS7.6" is over. I hope you can solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

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