警告:替换节点必须使用先前未在集群中使用的主机名以避免冲突。
替换功能节点
- 
在替换节点上使用唯一主机名供应和安装 GitHub Enterprise Server 。 
- 
使用管理 shell 或 DHCP,仅配置替换节点的 IP 地址。 不要配置任何其他设置。 
- 
要添加新配置的更换节点,在任何节点上,修改 cluster.conf文件以删除失败的节点并添加更换节点。 例如,下面修改的cluster.conf文件会将ghe-data-node-3替换为新配置的节点ghe-replacement-data-node-3:[cluster "ghe-replacement-data-node-3"] hostname = ghe-replacement-data-node-3 ipv4 = 192.168.0.7 ipv6 = fd12:3456:789a:1::7git-server = true pages-server = true mysql-server = true elasticsearch-server = true redis-server = true memcache-server = true metrics-server = true storage-server = true 
- 
从含有经修改 cluster.conf的节点的管理 shell 中,运行ghe-cluster-config-init。 这将初始化集群中新增的节点。
- 
从相同的节点,运行 ghe-cluster-config-apply。 这将验证配置文件、将其复制到集群中的每个节点以及根据修改的cluster.conf文件配置每个节点。
- 
如果要让在 cluster.conf 设置了 git-server = true的某个节点离线,请撤出该节点。 更多信息请参阅“Evacuating a cluster node”。
- 
要将失败的节点标记为离线,在任何节点上修改相关代码部分的群集配置文件 ( cluster.conf),以包含文本offline = true。例如,下面修改的 cluster.conf会将ghe-data-node-3节点标记为离线:[cluster "ghe-data-node-3"] hostname = ghe-data-node-3 offline = true ipv4 = 192.168.0.6 # ipv6 = fd12:3456:789a:1::6 
- 
从经修改 cluster.conf所在节点的管理 shell 中,运行ghe-cluster-config-init。 这将验证配置文件、将其复制到集群中的每个节点以及将该节点标记为离线。
- 
如果要替换 MySQL 主节点或 Redis 主节点,请在 cluster.conf中使用替换节点名称修改mysql-master或redis-master值。例如,以下修改的 cluster.conf文件指定新供应的集群节点ghe-replacement-data-node-1为 MySQL 和 Redis 主节点:mysql-master = ghe-replacement-data-node-1 redis-master = ghe-replacement-data-node-1 
在紧急情况下替换节点
- 
在替换节点上使用唯一主机名供应和安装 GitHub Enterprise Server 。 
- 
使用管理 shell 或 DHCP,仅配置替换节点的 IP 地址。 不要配置任何其他设置。 
- 
要将失败的节点标记为离线,在任何节点上修改相关代码部分的群集配置文件 ( cluster.conf),以包含文本offline = true。例如,下面修改的 cluster.conf会将ghe-data-node-3节点标记为离线:[cluster "ghe-data-node-3"] hostname = ghe-data-node-3 offline = true ipv4 = 192.168.0.6 # ipv6 = fd12:3456:789a:1::6 
- 
从经修改 cluster.conf所在节点的管理 shell 中,运行ghe-cluster-config-init。 这将验证配置文件、将其复制到集群中的每个节点以及将该节点标记为离线。
- 
要添加新配置的更换节点,在任何节点上,修改 cluster.conf文件以删除失败的节点并添加更换节点。 例如,下面修改的cluster.conf文件会将ghe-data-node-3替换为新配置的节点ghe-replacement-data-node-3:[cluster "ghe-replacement-data-node-3"] hostname = ghe-replacement-data-node-3 ipv4 = 192.168.0.7 ipv6 = fd12:3456:789a:1::7git-server = true pages-server = true mysql-server = true elasticsearch-server = true redis-server = true memcache-server = true metrics-server = true storage-server = true 
- 
如果要替换 MySQL 主节点或 Redis 主节点,请在 cluster.conf中使用替换节点名称修改mysql-master或redis-master值。例如,以下修改的 cluster.conf文件指定新供应的集群节点ghe-replacement-data-node-1为 MySQL 和 Redis 主节点:mysql-master = ghe-replacement-data-node-1 redis-master = ghe-replacement-data-node-1 
- 
从含有经修改 cluster.conf的节点的管理 shell 中,运行ghe-cluster-config-init。 这将初始化集群中新增的节点。
- 
从相同的节点,运行 ghe-cluster-config-apply。 这将验证配置文件、将其复制到集群中的每个节点以及根据修改的cluster.conf文件配置每个节点。
- 
如果要让在 cluster.conf 设置了 git-server = true的某个节点离线,请撤出该节点。 更多信息请参阅“Evacuating a cluster node”。