Skip to main content

Replacing a cluster node

If a node fails in a GitHub Enterprise Server cluster, or if you want to add a new node with more resources, mark any nodes to replace as offline, then add the new node.

GitHub はクラスタリングの適格性を決定し、インスタンスのライセンスの構成を有効にする必要があります。 クラスタリングには、慎重な計画と追加の管理オーバーヘッドが必要です。 詳しくは、「クラスタリングについて」を参照してください。

About replacement of GitHub Enterprise Server cluster nodes

You can replace a functional node in a GitHub Enterprise Server cluster, or you can replace a node that has failed unexpectedly.

Warning: To avoid conflicts, do not reuse a hostname that was previously assigned to a node in the cluster.

Replacing a functional node

You can replace an existing, functional node in your cluster. For example, you may want to provide a virtual machine (VM) with additional CPU, memory, or storage resources.

To replace a functional node, install the GitHub Enterprise Server appliance on a new VM, configure an IP address, add the new node to the cluster configuration file, initialize the cluster and apply the configuration, then take the node you replaced offline.

  1. 置き換えノードに一意のホスト名を指定し、GitHub Enterprise Server をプロビジョニングしてインストールします

  2. 管理シェルまたは DHCP を使用して、置換ノードの IP アドレスのみを構成します。 その他の設定は行わないでください。

  3. 任意のノードに対して、新たにプロビジョニングされた置換ノードを追加するには、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::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
    
  4. 変更された cluster.conf があるノードの管理シェルから、ghe-cluster-config-init を実行します。 これで、クラスタに新たに追加されたノードが初期化されます。

  5. 同じノードから、ghe-cluster-config-apply を実行します。 これにより、構成ファイルが検証され、クラスター内の各ノードにコピーされ、変更された cluster.conf ファイルに従って各ノードが設定されます。

  6. git-serverpages-serverstorage-server などのデータ サービスを提供するノードをオフラインにしている場合は、ノードを退避します。 詳しくは、「Evacuating a cluster node running data services」を参照してください。

  7. 障害が発生したノードをオフラインとしてマークするには、offline = true というテキストを含むようにクラスター構成ファイル (cluster.conf) の関連するノードのセクションを変更します。

    たとえば、このように変更した 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
    
  8. cluster.conf を変更したノードの管理シェルから、ghe-cluster-config-apply を実行します。 これで設定ファイルが検証され、クラスタ内の各ノードにコピーされ、そのノードがオフラインとしてマークされます。

  9. プライマリ MySQL または Redis ノードを置き換える場合は、cluster.confmysql-master または redis-master の値を置換ノード名に変更します。

    たとえば、この変更された cluster.conf ファイルは、プライマリ MySQL および Redis ノードとして、新しくプロビジョニングされたクラスター ノード ghe-replacement-data-node-1 を指定します。

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

Replacing a node in an emergency

You can replace a failed node in your cluster. For example, a software or hardware issue may affect a node's availability.

To replace a node in an emergency, install the GitHub Enterprise Server appliance on a new VM, configure an IP address, take the failed node offline, apply the configuration, add the new node to the cluster configuration file, initialize the cluster and apply the configuration, and optionally, evacuate the failed node.

  1. 置き換えノードに一意のホスト名を指定し、GitHub Enterprise Server をプロビジョニングしてインストールします

  2. 管理シェルまたは DHCP を使用して、置換ノードの IP アドレスのみを構成します。 その他の設定は行わないでください。

  3. 障害が発生したノードをオフラインとしてマークするには、offline = true というテキストを含むようにクラスター構成ファイル (cluster.conf) の関連するノードのセクションを変更します。

    たとえば、このように変更した 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
    
  4. cluster.conf を変更したノードの管理シェルから、ghe-cluster-config-apply を実行します。 これで設定ファイルが検証され、クラスタ内の各ノードにコピーされ、そのノードがオフラインとしてマークされます。

  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-3
      ipv4 = 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. プライマリ MySQL または Redis ノードを置き換える場合は、cluster.confmysql-master または redis-master の値を置換ノード名に変更します。

    たとえば、この変更された cluster.conf ファイルは、プライマリ MySQL および Redis ノードとして、新しくプロビジョニングされたクラスター ノード ghe-replacement-data-node-1 を指定します。

    mysql-master = ghe-replacement-data-node-1
    redis-master = ghe-replacement-data-node-1
    
  7. 変更された cluster.conf があるノードの管理シェルから、ghe-cluster-config-init を実行します。 これで、クラスタに新たに追加されたノードが初期化されます。

  8. 同じノードから、ghe-cluster-config-apply を実行します。 これにより、構成ファイルが検証され、クラスター内の各ノードにコピーされ、変更された cluster.conf ファイルに従って各ノードが設定されます。

  9. git-serverpages-serverstorage-server などのデータ サービスを提供するノードをオフラインにしている場合は、ノードを退避します。 詳しくは、「Evacuating a cluster node running data services」を参照してください。