Reading time: 5 min.
How to Restart a Server?
"Have you tried turning it off and on again?"
At first, restarting a server looks simple and trivial. However, in reality, this process is much more complicated. In various situations, a reboot can lead to unexpected consequences, from data loss to an operating system crash. In this article, we will talk about how to reboot the local and remote servers safely.
There is a software (soft) and hardware (hard) reset. The soft reset is secure. After receiving the command, the server will wait until all processes terminate correctly before stopping and restarting. A hard reset t is performed by short-term power off (the action is similar to pressing the reset button on a computer). The server will restart, but some data and files may be lost or damaged. Therefore, a hard reset is a last resort when there are no other options for restarting the VDS.
The soft type of reboot solves some local problems. For example, it is used if one or more programs do not run correctly, or new software cannot be installed or uninstalled. But this method only works on an accessible server. To reboot, enter the appropriate commands at the command prompt.
To reboot the Linux server from the console, you must enter as root and use commands shutdown -r now, reboot now, or init 6.
The basic command to restart a Linux server is shutdown -r. Variations of the command allow you to schedule the reboot time. For example, shutdown -r now will immediately restart the server, but shutdown -r 10:30 will restart the server at 10:30.
The reboot command is another versatile tool. The advantage of this command is that first all saves all logs to disk (command sync) and shuts down unfinished processes. The reboot process will be initiated only after that.
The 6-level initialization system Init Scripts also allows restart. To do this, select the level 6 command (init 6), and the level 0 command (init 0) to turn the server off.
Windows servers have a similar restart method. A user with administrative privileges (administrator) must enter the shutdown -r -t 0 command. Alternatively, use PowerShell. In this case, the Restart-Computer command and the computer name are required.
If a soft reset does not work, you should use a hard reset.
If the remote server is not available for some reason, the equipment is physically restarted (by power supply). This can be done remotely without visiting the data center. Use the IPMI interface for remote access to the server BIOS power settings and configuration management.
Step-by-step instruction for remote power restart using IPMI/KVM: Authorize in personal user account – select a server in the DCI panel – press KVM button - select Remote Control tab (in the IPMI interface) – Power Control / Reset Control / Perform Action.
After that, the virtual server will be rebooted. If a hard reset does not solve the problem, contact the data center support.
To restart the remote server from the Windows operating system, use the PuTTY application. It is a popular software for remote access to the server without encrypted packet forwarding. After logging in, enter reboot at the command line. The server will reboot in 15 minutes.
If you use a Linux-based server, use the /etc/init.d/ssh script with the restart parameter. To stop or start the server, use the stop and start commands respectively.
If the reboot is unsuccessful, check the server status through the IP-KVM interface or the control panel in your account.