Skip to main content

Enabling and scheduling maintenance mode

Some standard maintenance procedures, such as upgrading your GitHub Enterprise Server instance or restoring backups, require the instance to be taken offline for normal use.

About maintenance mode

Some types of operations require that you take your GitHub Enterprise Server instance offline and put it into maintenance mode:

  • Upgrading to a new version of GitHub Enterprise Server
  • Increasing CPU, memory, or storage resources allocated to the virtual machine
  • Migrating data from one virtual machine to another
  • Restoring data from a GitHub Enterprise Server Backup Utilities snapshot
  • Troubleshooting certain types of critical application issues

We recommend that you schedule a maintenance window for at least 30 minutes in the future to give users time to prepare. When a maintenance window is scheduled, all users will see a banner when accessing the site.

End user banner about scheduled maintenance

When the instance is in maintenance mode, all normal HTTP and Git access is refused. Git fetch, clone, and push operations are also rejected with an error message indicating that the site is temporarily unavailable. In high availability configurations, Git replication will be paused. GitHub Actions jobs will not be executed. Visiting the site in a browser results in a maintenance page.

The maintenance mode splash screen

You can perform initial validation of your maintenance operation by configuring an IP exception list to allow access to your GitHub Enterprise Server instance from only the IP addresses and ranges provided. Attempts to access your GitHub Enterprise Server instance from IP addresses not specified on the IP exception list will receive a response consistent with those sent when the instance is in maintenance mode.

Enabling maintenance mode immediately or scheduling a maintenance window for a later time

  1. Desde una cuenta administrativa de GitHub Enterprise Server, en la esquina superior derecha de cualquier página, haz clic en .

    Captura de pantalla del icono de cohete para acceder a los ajustes administrativos

  2. Si todavía no está en la página "Administrador del sitio", en la esquina superior izquierda, haga clic en Administrador del sitio.

    Captura de pantalla del vínculo "Administrador del sitio"

  3. En la barra lateral de la izquierda, haga clic en Consola de administración . Pestaña Consola de administración en la barra lateral de la izquierda

  4. At the top of the Consola de administración, click Maintenance. Maintenance tab

  5. Under "Enable and schedule", decide whether to enable maintenance mode immediately or to schedule a maintenance window for a future time.

    • To enable maintenance mode immediately, use the drop-down menu and click now. Drop-down menu with the option to enable maintenance mode now selected
    • To schedule a maintenance window for a future time, use the drop-down menu and click a start time. Drop-down menu with the option to schedule a maintenance window in two hours selected
  6. Select Enable maintenance mode. Checkbox for enabling or scheduling maintenance mode

  7. En la barra lateral de la izquierda, haga clic en Guardar configuración.

    Captura de pantalla del botón para guardar los ajustes en la Consola de administración

    Nota: Al guardar la configuración en la Consola de administración se restablecen los servicios de sistema, lo que podría generar un tiempo de inactividad visible para el usuario.

  8. Espera que se complete la fase de configuración.

    Configurar tu instancia

Validating changes in maintenance mode using the IP exception list

The IP exception list provides controlled and restricted access to your GitHub Enterprise Server instance, which is ideal for initial validation of server health following a maintenance operation. Once enabled, your GitHub Enterprise Server instance will be taken out of maintenance mode and available only to the configured IP addresses. The maintenance mode checkbox will be updated to reflect the change in state.

If you re-enable maintenance mode, the IP exception list will be disabled and your GitHub Enterprise Server instance will return to maintenance mode. If you just disable the IP exception list, your GitHub Enterprise Server instance will return to normal operation.

You can also use a command-line utility to configure the IP exception list. For more information, see "Command-line utilities" and "Accessing the administrative shell (SSH)."

  1. Desde una cuenta administrativa de GitHub Enterprise Server, en la esquina superior derecha de cualquier página, haz clic en .

    Captura de pantalla del icono de cohete para acceder a los ajustes administrativos

  2. Si todavía no está en la página "Administrador del sitio", en la esquina superior izquierda, haga clic en Administrador del sitio.

    Captura de pantalla del vínculo "Administrador del sitio"

  3. En la barra lateral de la izquierda, haga clic en Consola de administración . Pestaña Consola de administración en la barra lateral de la izquierda

  4. At the top of the Consola de administración, click Maintenance, and confirm maintenance mode is already enabled. Maintenance tab

  5. Select Enable IP exception list. Checkbox for enabling ip exception list

  6. In the text box, type a valid list of space-separated IP addresses or CIDR blocks that should be allowed to access your GitHub Enterprise Server instance. completed field for IP addresses

  7. Click Save. after IP excetpion list has saved

Scheduling maintenance mode with the GitHub Enterprise Server APIs

You can schedule maintenance for different times or dates with the GitHub Enterprise Server APIs. For more information, see "Management Console."

Enabling or disabling maintenance mode for all nodes in a cluster

With the ghe-cluster-maintenance utility, you can set or unset maintenance mode for every node in a cluster.

$ ghe-cluster-maintenance -h
# Shows options
$ ghe-cluster-maintenance -q
# Queries the current mode
$ ghe-cluster-maintenance -s
# Sets maintenance mode
$ ghe-cluster-maintenance -u
# Unsets maintenance mode