Reboot Survival – Best Practices
Introduction
Cloud infrastructure offers resilience but all servers depend on its physical hardware, which in the long run needs maintenance. Round-the-clock servers depend on uptime which is optimum for its usage, but unavoidable downtime does happen. Apart from hardware maintenance, updates and patches require rebooting your server to keep your system secure and up-to-date. The guide below covers best practices to ensure your system handles unexpected reboots, minimizing downtime.
Test your Stack by Manual Reboot
During the development phase, when you make important changes to your stack, make sure you reboot your server and ensure that your stack is fully operational without any issues. Performing these reboot trials frequently prepares you for unexpected reboots during maintenance or upgrades.
Backup your Crucial Data
Backing up your most important and critical data is one of the most essential steps. Losing data due to unexpected downtime or accidental deletion can have an adverse impact on your stack. E2E Networks CDP Backups function as an exact replica of your file system, backed up automatically at periodic intervals. Each backup contains all data to restore from the initial provisioning to the most recent block update. This allows point-in-time recovery from any of the archive's recovery points. You can find more details here.
You can also back up your databases from MySQL or MariaDB and restore them using the mysqldump
command. For those unfamiliar with mysqldump
, refer to this guide.
Enable Services on Boot
Ensure that all your critical and important services and applications configured on your server are set to start at boot. This ensures that during future reboots, all services are up and running without manual intervention.
In Debian and Ubuntu, use update-rc.d to add or remove services from startup:
sudo update-rc.d service_name defaults
To remove service from boot startup,Use below command
sudo update-rc.d -f service_name remove
In Centos7,Use systemctl command
sudo systemctl enable service_name
sudo systemctl disable service_name
Ensure Firewall rules are saved
If you have manually configured the rules in firewall,You should make sure its already be saved, and gets loaded on boot automatically.
You can save the firewalls permanently by running the below command.
sudo iptables-save > /etc/iptables.firewall.rules
Using Load balancer
If your system totally cannot afford downtime, You can use a Load Balancer Appliance which helps you to dynamically distribute user traffic to multiple backend nodes — for high availability, scalability, fault-tolerance, and smooth user experience. It also helps you to apply changes to the backend without impacting the end-user experience. You can refer this article on how to launch a Load balancer in E2E .