Maintenance windows
Pick a weekly hour for Hatchbox to update your servers, one at a time
Updated
Pick a weekly hour when your app is quiet, and Hatchbox keeps your servers up to date in it. Updates that restart PostgreSQL, Redis or Caddy then happen when they bother the fewest users, and only one server restarts at a time.
Set a window
Open your cluster, go to Settings, and choose a day, an hour and a time zone under Maintenance window. The window lasts three hours. It follows your local clock, so daylight saving time doesn't move it.
The settings page shows when the next window opens. Remove window turns it off. To run maintenance right away, click Run maintenance at the top of the cluster page.
Every night: security updates
Security updates install every night, with or without a window, and services using an updated library restart.
With a window, each server's nightly updates start at the window's hour, one server every 10 minutes. For a window at 3 AM, the first server updates at 3:00, the second at 3:10, and so on. Without a window, each server picks a random time between 6 and 7 AM server time.
Every week: everything else
In the window, Hatchbox updates your servers one at a time, the same as clicking Update on each one:
- All package updates, not just security ones, including PostgreSQL, Redis and new kernels
- The latest Caddy
- Hatchbox's latest server configuration
- Your cluster's setup script
Services still running old libraries restart, and so does anything whose configuration changed. Services with nothing new keep running. Your apps aren't deployed.
Web servers that share their roles with another server go first, and database servers go last. Your cluster's run starts within the first 30 minutes of the window.
Make your setup script safe to re-run
Your setup script now runs every week, not just when a server is created or updated. It must work on a server where it already ran. For example, check whether something is installed before installing it, and use apt-get install -y, which skips packages that are already there.
Reboots
Hatchbox never reboots your servers on its own. When an update needs a reboot to finish, usually a new kernel, the server shows Reboot required. Hover over it to see which packages are waiting. Click Reboot when it suits you.
When something goes wrong
- A server running a deploy or provision, or still running a database backup or its nightly updates after 30 minutes, is skipped. So is a server Hatchbox can't reach. The run moves on to the next server.
- If an update fails, the run stops. The servers after it are left as they were.
- Servers the run hasn't reached when the window closes wait for next week.
In each of these cases, your account's admins get one notification saying what happened. A clean run sends nothing. Each server's part of the run is in that server's logs.