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

此版本的 GitHub Enterprise 将停止服务 此版本的 GitHub Enterprise 已停止服务 2019-10-16. 即使针对重大安全问题,也不会发布补丁。 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.

替换集群节点

要替换 GitHub Enterprise Server 节点,必须在集群配置文件 (cluster.conf) 中将受影响的节点标记为离线,然后添加替换节点。 如果节点发生故障,或者添加具有更多资源的节点以提高性能,则可能需要执行此操作。

警告:替换节点必须使用先前未在集群中使用的主机名以避免冲突。

本文内容:

在紧急情况下替换节点

  1. Provision and install GitHub Enterprise Server with a unique hostname on the replacement node.

  2. Using the administrative shell or DHCP, only configure the IP address of the replacement node. 不要配置任何其他设置。

  3. 要将失败的节点标记为离线,在任何节点上修改相关代码部分的群集配置文件 (cluster.conf),以包含文本 offline = true

    例如,下面修改的 cluster.conf 会将 ghe-data-node-3 节点标记为离线:

    [cluster "ghe-data-node-3"]
    hostname = ghe-data-node-3offline = trueipv4 = 192.168.0.6
    # ipv6 = fd12:3456:789a:1::6
    
  4. From the administrative shell of the node where you modified cluster.conf, run ghe-cluster-config-apply. This will validate the configuration file, copy it to each node in the cluster, and mark the node offline.

  5. 要添加新配置的更换节点,在任何节点上,修改 cluster.conf 文件以删除失败的节点并添加更换节点。 例如,下面修改的 cluster.conf 文件会将 ghe-data-node-3 替换为新配置的节点 ghe-replacement-data-node-3

    [cluster "ghe-replacement-data-node-3"]
    hostname = ghe-replacement-data-node-3ipv4 = 192.168.0.7

    ipv6 = fd12:3456:789a:1::7

    git-server = true pages-server = true mysql-server = true elasticsearch-server = true redis-server = true memcache-server = true metrics-server = true storage-server = true

  6. If you're replacing the MySQL master node or Redis master node, in cluster.conf, modify the mysql-master or redis-master value with the replacement node name.

    For example, this modified cluster.conf file specifies a newly provisioned cluster node, ghe-replacement-data-node-1 as the MySQL and Redis master node:

    mysql-master = ghe-replacement-data-node-1redis-master = ghe-replacement-data-node-1

  7. From the administrative shell of the node with the modified cluster.conf, run ghe-cluster-config-init. This will initialize the newly added node in the cluster.

  8. From the same node, run ghe-cluster-config-apply. This will validate the configuration file, copy it to each node in the cluster, and configure each node according to the modified cluster.conf file.

问问别人

找不到要找的内容?

联系我们