This article is a mirror article of machine translation, please click here to jump to the original article.

View: 3124|Reply: 0

[Redis] CentOS 7 installs the Redis 7.2.4 caching service

[Copy link]
Posted on 4/24/2024 4:51:34 PM | | | |
Recently, I need to use Redis for caching, and I found that the official website has been changed to a new style. Review:

CentOS 7 installation Redis 5.0.3 tutorial
https://www.itsvse.com/thread-7201-1-1.html

Redis latest version download:

The hyperlink login is visible.
The hyperlink login is visible.

This article is based on redis-7.2.4 on a CentOS 7 server.

First check if the machine is installed with gcc, the command is as follows:

The Redis download compilation command is as follows:

Once Redis starts, there is a warning by default, which can be modified by following the tutorial below. (omitted)

Redis will now exit to prevent data corruption. Note that it is...
https://www.itsvse.com/thread-10113-1-1.html


After the execution is complete, enter the Redis directory, as shown in the following figure:



Create a new Redis cache data directory with the following command:

Create a new redis7.conf configuration file in this directory, as follows:


The main configurations are as follows:

bind 0.0.0.0
#Redis will run as a daemon, that is, it will run silently in the background and no longer occupy the terminal.
daemonize yes
requirepass a123456
#当 protected-mode is set to no, Redis disables protected mode. With Protected Mode disabled, Redis can accept connections from any network address. This is often used to allow external systems or applications to connect to the Redis server.
protected-mode no
#设置最大使用内存
maxmemory 1GB
#当超过最大内存后, select the policy to delete the cache
maxmemory-policy allkeys-lru
#配置数据目录
dir /data/middleware/redis/data


Reference:

Redis memory eight elimination strategies
https://www.itsvse.com/thread-10626-1-1.html


You can try to start with a command like this:





Create a new service based on systemd and create a new service in /etc/systemd/systemredis7.serviceThe services are as follows:



Start and view the service status as shown in the following image:


(End)




Previous:.NET Core projects do not display a warning
Next:Compile the NPM package into a browser-ready JavaScript script
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com