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

Redis (2): installation and configuration of Redis (2)-setting startup information

2025-03-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

Set startup information

Copy the startup script file in the source code package (under the utils directory in the source code package) to the / etc/rc.d/init.d directory, as shown below:

Modify script information:

The EXEC path is the default installation path, and if our installation path is changed, it needs to be modified here.

The PID file (PIDFILE) is the PID path, which can be used by default, but I modified it here because I also changed it later in the configuration file, and the path here must correspond to the one in the configuration file.

The default path to the configuration file (CONF) is / etc/redis/, so we created this folder and copied the configuration, but note here that the file name of CONF is 6379.conf, because there is a variable in this path.

Modify the configuration file to support daemon startup. The default is no, which needs to be changed to yes. If it is not modified, then the startup of redis will occupy a terminal interface and will run in the background after modification.

Modify the pid and log paths, as shown below:

Create / var/redis/run and / var/redis/log directories, as shown below:

As to why it should be created under the / var path, please refer to FHS's definition of the Linux directory. To put it simply, the / var path is used by programs in the system after running, so FHS recommends mounting a partition to / var, which will contain cache, Log, Lock files, and so on. Of course, it's OK if you have to use other directories.

Modify the storage path of the local database snapshot, as shown below:

This directory is the place where the snapshot database files (with the extension rdb and the default file name dump.rdb) are stored, and if AOF persistence is enabled, the AOF files are also placed in this directory.

Create a directory, as shown below:

To be continued.

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

Database

Wechat

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

12
Report