我们经常发布文档更新,此页面的翻译可能仍在进行中。有关最新信息,请访问英文文档。如果此页面上的翻译有问题,请告诉我们
文章版本: Enterprise Server 2.21

Enabling and scheduling maintenance mode

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

本文内容

About maintenance mode

Some types of operations require that you take 您的 GitHub Enterprise Server 实例 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 备份实用程序 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. Visiting the site in a browser results in a maintenance page.

The maintenance mode splash screen

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

  1. 在任何页面的右上角,单击
    用于访问站点管理员设置的火箭图标
  2. 在左侧边栏中,单击 管理控制台
    左侧边栏中的 管理控制台 选项卡
  3. At the top of the 管理控制台, click Maintenance.
    Maintenance tab
  4. 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
  5. Select Enable maintenance mode.
    Checkbox for enabling or scheduling maintenance mode
  6. 在左侧边栏下,单击 Save settings(保存设置)
    Save settings 按钮

Scheduling maintenance mode with GitHub Enterprise Server API

You can schedule maintenance for different times or dates with GitHub Enterprise Server API. 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

问问别人

找不到要找的内容?

联系我们