In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Registration service
The so-called registration service is a system service that turns a program into a Linux, giving access to shutdown and startup at a specified run level.
By default, redis does not support service registration and will report an error.
The modification in the redis script copied to / etc/rc.d/init.d/ is as follows (previously copied): add chkconfig:2345 9010. 2345 is the run level, which tells the chkconfig program that you need to create a link to a file called S90redis in the rc2.d, rc3.d, rc4.d, and rc5.d directories to the redis script in the / etc/rc.d/init.d directory. The first character is S, and a start parameter is added to tell the script that this is a startup mode. Create a file link named K10redis in both the rc0.d and rc6.d directories, with the character K, indicating that the system runs the script when it is shut down, adding a parameter to stop, telling the script that it is now in closed mode.
If you register again, you will not make a mistake.
Let's take a look at the files in rc2.d (as in other rc3-5.d), as shown below:
In fact, the two numbers of 90 or 10 are customized, and it doesn't matter if the number is duplicated, after all, the overall name is different.
It should be noted that after registering the service, it does not mean that it will start automatically at the 2345 level, only that it can be started automatically at the 2345 level. How to set the automatic start also requires the following command:
Chkconfig-- level 35 redis on # is generally only set to 35-level automatic startup, not all 2345
The purpose of registering the service is also to make it easier to manage, and we can use the following command to start or stop the process at any time:
Service redis start/stop
To sum up:
The real scripts are in / etc/rc.d/init.d, while those in / etc/rc0-6.d are all linked files, and the links are all real scripts in / etc/rc.d/init.d.
Rc0-6.d corresponds to 7 different run levels
The naming rules for linked files are S + digits + service names or K + digits + service names, and S for start,K and kill.
The system will find the corresponding rcN.d file according to the startup level set, and then execute the link file. The S indicates that the current run level needs to be started, and K means that the program needs to be stopped if it is not started.
With all the settings above, the following is to start the service:
This completes the installation.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.