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 to install Redis on CentOS

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

Share

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

This article mainly explains how to install Redis on CentOS. Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let Xiaobian take you to learn "How to install Redis on CentOS"!

Redis is a high-performance key-value database. The emergence of redis largely compensates for the lack of keyvalue storage such as memcached, which can complement relational databases in some cases.

1. First upload the installation package, here I'm using redis-5.0.8.tar.gz as an example.

Linux download redis address:

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

First create a package upload folder under the opt directory:

mkdir /opt/software

Upload redis-5.0.8.tar.gz to/opt/software/

2. Download Redis Installation Dependency Compilation Environment

Install the gcc build environment to execute the make command:

yum -y install gcc gcc-c++3. Use tar -xzvf redis-5.0.8.tar.gz4. Move the extracted redis source files to mv /opt/software/redis-5.0.8 /usr/local/src//** 5. Go to/usr/local/src/redis-5.0.8 directory and enter *make* command to compile make6. Then enter/usr/local/src/redis-5.0.8/src/and enter the following command. The purpose is to specify the directory for redis installation make install PREFIX=/usr/local/redis7. Create a folder to prescribe custom redis.conf files mkdir /etc/redis/*8. Copy/usr/local/src/redis-5.0.8/redis.conf to **/etc/redis/* under cp /usr/local/src/redis-5.0.8/redis.conf /etc/redis/9. Modify the/etc/redis/redis.conf configuration file vim /etc/redis/redis.conf10. The core redis.conf configuration modification code is as follows: bind 0.0.0.0protected-mode noport 6379tcp-backlog 511timeout 0tcp-keepalive 300daemonize yessupervised nopidfile /var/run/redis_6379.pidloglevel noticelogfile /var/log/redis/redis_master.logdatabases 16always-show-logo yessave 900 1save 300 10save 60 10000stop-writes-on-bgsave-error yesrdbcompression yesrdbchecksum yesdbfilename dump.rdbdir /opt/redis_datareplica-serve-stale-data yesreplica-read-only yesrepl-diskless-sync norepl-diskless-sync-delay 5repl-disable-tcp-nodelay noreplica-priority 100maxmemory 10000000kblazyfree-lazy-eviction nolazyfree-lazy-expire nolazyfree-lazy-server-del noreplica-lazy-flush noappendonly yesappendfilename "appendonly.aof"appendfsync everysecno-appendfsync-on-rewrite noauto-aof-rewrite-percentage 100auto-aof-rewrite-min-size 64mbaof-load-truncated yesaof-use-rdb-preamble yeslua-time-limit 5000slowlog-log-slower-than 10000slowlog-max-len 128latency-monitor-threshold 0notify-keyspace-events ""hash-max-ziplist-entries 512hash-max-ziplist-value 64list-max-ziplist-size -2list-compress-depth 0set-max-intset-entries 512zset-max-ziplist-entries 128zset-max-ziplist-value 64hll-sparse-max-bytes 3000stream-node-max-bytes 4096stream-node-max-entries 100activerehashing yesclient-output-buffer-limit normal 0 0 0client-output-buffer-limit replica 256mb 64mb 60client-output-buffer-limit pubsub 32mb 8mb 60hz 10dynamic-hz yesaof-rewrite-incremental-fsync yesrdb-save-incremental-fsync yes

You can copy my profile to your profile.

11. Some paths in the configuration file need to establish the corresponding directory mkdir /var/log/redis/mkdir /opt/redis_data12. Start running *redis*/usr/local/redis/bin/redis-server /etc/redis/redis.conf13. Check whether the background process exists ps -ef| The requested URL/usr/local/redis/bin/redis-chli was not found on this server.

enter

15. Close *redis*redis-cli shutdown16. Force Close *redis*kill -9 PID

(your process ID, query ps -ef with this command)| grep redis )

or

pkill redis here, I believe everyone has a deeper understanding of "how to install Redis on CentOS", may wish to actually operate it! Here is the website, more related content can enter the relevant channels for inquiry, pay attention to us, continue to learn!

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