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

Centos7 install Redis

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

Share

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

Yum install gcc

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

Cp redis-5.0.7.tar.gz / usr/local

Cd / usr/local

Tar-zxvf redis-5.0.7.tar.gz

Cd redis-5.0.7

Make

Make install

Cp / usr/local/redis-5.0.7/redis.conf / usr/local/etc/

Set up background startup

Vi / usr/local/etc/redis.conf

Daemonize yes

Set the redis server to boot automatically

Vi / lib/systemd/system/redis.service

[Unit]

Description=The redis-server Process Manager

Documentation= https://redis.io/

After=network.target

[Service]

Type=forking

ExecStart=/usr/local/bin/redis-server / usr/local/etc/redis.conf

ExecStop=/usr/local/bin/redis-cli shutdown

PrivateTmp=true

[Install]

WantedBy=multi-user.target

Systemctl enable redis

Systemctl start redis

Systemctl status redis

Redis-cli

127.0.0.1 purl 6379 > info server

This is the user startup item, which means that it starts only when the user logs in:

/ usr/lib/systemd/system/

This is the boot entry of the system, which means to start at boot, no matter which user logs in:

/ lib/systemd/system/

View all boot items:

Systemctl list-unit-files | grep enabled

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

Servers

Wechat

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

12
Report