In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article will explain in detail several methods of forced restart of the Linux system for you. The content of the article is of high quality, so the editor will share it with you for reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.
In the actual production environment, in some cases, the Linux server system needs to be restarted remotely when a fatal error occurs, and it cannot be restarted normally by conventional reboot, init 6 and other methods (for example, when the restart is stuck in the driver, etc.). In this case, you need to restart forcefully through several special methods described below. Note that these forced restart methods directly skip operations such as umount file system and sync, which may lead to data corruption. Do not use them unless in special circumstances. Of course, these are only authorized by root superusers.
1. Reboot command:
By running the reboot-nf command directly, you can specify to skip init processing and sync operations on restart, which avoids problems in most cases.
2. Magic SysRq key method:
Magic SysRq key provides users with the ability to directly send underlying commands to kernel through the proc interface, which can achieve shutdown, restart, downtime and other operations. Linux kernel needs to enable CONFIG_MAGIC_SYSRQ to support magic SysRq key.
You can directly force a system restart by running the following two commands:
Echo 1 > / proc/sys/kernel/sysrq
Echo b > / proc/sysrq-trigger
Corresponding command for direct forced shutdown:
Echo 1 > / proc/sys/kernel/sysrq
Echo o > / proc/sysrq-trigger
3. Watchdog method:
If Linux kernel does not enable magic SysRq key or does not work, you can try to use the watchdog restart method. Watchdog can automatically restart the system when an exception occurs by monitoring whether the data input is normal, which we can borrow here.
First of all, you need to load watchdog support, which is related to the motherboard hardware device. If you only need software simulation, you can run:
Modprobe softdog
Command to load software watchdog support, and then run:
Cat / dev/watchdog
Command, which immediately exits with an error and prompts you in the system log:
Softdog: Unexpected close, not stopping watchdog!
This means that the watchdog device was turned off unexpectedly rather than stopped normally, and you will find that the Linux system restarts automatically after waiting for about 60 seconds. The exception wait time for Linux watchdog is set through / proc/sys/kernel/watchdog_thresh, which generally defaults to 60 seconds.
4. IPMI method:
None of the above methods can be used? If your motherboard happens to support the IPMI management interface, you can force the shutdown or restart on the hardware directly through IPMI.
First load IPMI support:
Modprobe ipmi_msghandler ipmi_devintf ipmi_si
Confirm that the IPMI device has been found:
Ls-l / dev/ipmi*
If the output is normal, it means that IPMI is loaded correctly, and then install ipmitool, the administrative tool. Ipmitool can manage a series of local or remote hosts through the IPMI interface.
Here we will restart the system with direct power management:
Ipmitool power reset
After the completion of the operation, the host will restart immediately, and the corresponding shutdown host can run:
Ipmitool power off
Ipmitool can also remotely view and monitor the hardware status of the motherboard when the system is not started, and ipmitool is more convenient and easy to use when IPMI is available.
Transfer to: https://zohead.com/archives/linux-force-reboot/
On the forced restart of the Linux system which have several ways to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
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.