Skip to main content

This version of GitHub Enterprise was discontinued on 2022-06-03. No patch releases will be made, even for critical security issues. For better performance, improved security, and new features, upgrade to the latest version of GitHub Enterprise. For help with the upgrade, contact GitHub Enterprise support.

Evacuating a cluster node

You can evacuate data services on a cluster node.

About evacuation of cluster nodes

In a cluster configuration for GitHub Enterprise Server, you can evacuate a node before taking the node offline. Evacuation ensures that the remaining nodes in a service tier contain all of the service's data. For example, when you replace the virtual machine for a node in your cluster, you should first evacuate the node.

For more information about nodes and service tiers for GitHub Enterprise Server, see "About cluster nodes."

Warnings:

  • To avoid data loss, GitHub strongly recommends that you evacuate a node before taking the node offline.

  • If you only have three nodes in your data services cluster, you can't evacuate the nodes because ghe-spokes doesn't have another place to make a copy. If you have four or more, ghe-spokes will move all the repositories off of the evacuated node.

Evacuating a cluster node

If you plan to take a node offline and the node runs a data service role like git-server, pages-server, or storage-server, evacuate each node before taking the node offline.

  1. SSH into any node in your cluster. For more information, see "Accessing the administrative shell (SSH)."

  2. To find the UUID of the node to evacuate, run the following command. Replace HOSTNAME with the node's hostname.

    $ ghe-config cluster.HOSTNAME.uuid
  3. Monitor the node's status while GitHub Enterprise Server copies the data. Don't take the node offline until the copy is complete. To monitor the status of your node, run any of the following commands, replacing UUID with the UUID from step 2.

    • Git:

      $ ghe-spokes evac-status git-server-UUID
    • GitHub Pages:

      $ echo "select count(*) from pages_replicas where host = 'pages-server-UUID'" | ghe-dbconsole -y
    • Storage:

      $ ghe-storage evacuation-status storage-server-UUID
  4. After the copy is complete, you can evacuate the node by running any of the following commands, replacing UUID with the UUID from step 2.

    • Git:

      $ ghe-spokes server evacuate git-server-UUID \'REASON FOR EVACUATION\'
    • GitHub Pages:

      $ ghe-dpages evacuate pages-server-UUID
    • For storage, first take the node offline by running the following command.

      $ ghe-storage offline storage-server-UUID

      After the storage node is offline, you can evacuate the node by running the following command.

      $ ghe-storage evacuate storage-server-UUID