|
3 | 3 | [//]: # (SPDX-License-Identifier: Apache-2.0)
|
4 | 4 | [//]: # (##############################################################################################)
|
5 | 5 |
|
6 |
| -<a name = "adding-new-orderer-to-existing-organization-in-a-running-fabric-network"></a> |
7 |
| -# Adding a new RAFT orderer to existing Orderer organization in Hyperledger Fabric |
| 6 | +# Add Orderer Node to an existing organization |
8 | 7 |
|
9 |
| -- [Prerequisites](#prerequisites) |
10 |
| -- [Modifying Configuration File](#modifying-configuration-file) |
11 |
| -- [Run playbook](#run-playbook) |
| 8 | +This guide explains how to add an orderer node to an existing Hyperledger Fabric network using two methods: |
12 | 9 |
|
| 10 | +1. Using the `add-orderer.yaml` playbook: This method involves running an Ansible playbook that automates the process of adding an orderer node to the network. |
| 11 | + |
| 12 | +1. Using `helm install`: This method involves using the helm install command to directly install the orderer node chart. |
13 | 13 |
|
14 |
| -<a name = "prerequisites"></a> |
15 | 14 | ## Prerequisites
|
16 |
| -To add a new Orderer node, a fully configured Fabric network must be present already, i.e. a Fabric network which has Orderers, Peers, Channels (with all Peers already in the channels) and the organization to which the peer is being added. The corresponding crypto materials should also be present in their respective Hashicorp Vault. |
17 | 15 |
|
18 |
| ---- |
19 |
| -**NOTE**: Addition of a new Orderer node has been tested on an existing network which is created by Bevel. Networks created using other methods may be suitable but this has not been tested by Bevel team. |
20 |
| -This works only for RAFT Orderer. |
| 16 | +- A fully configured Fabric network with Orderers and Peers. |
| 17 | +- Corresponding crypto materials present in Hashicorp Vault or Kubernetes secrets. |
| 18 | +- Hyperledger Bevel configured. |
| 19 | + |
| 20 | +## Method 1: Using the `add-cli.yaml` playbook |
| 21 | + |
| 22 | +1. **Update Configuration File** |
| 23 | + |
| 24 | + To add a new Orderer node, a fully configured Fabric network must be present already, i.e. a Fabric network which has Orderers, Peers, Channels (with all Peers already in the channels) and the organization to which the peer is being added. The corresponding crypto materials should also be present in their respective Hashicorp Vault. |
| 25 | + |
| 26 | + --- |
| 27 | + **NOTE**: Addition of a new Orderer node has been tested on an existing network which is created by Bevel. Networks created using other methods may be suitable but this has not been tested by Bevel team. |
| 28 | + This works only for RAFT Orderer. |
| 29 | + |
| 30 | + --- |
| 31 | + |
| 32 | +1. **Update Configuration File** |
| 33 | + |
| 34 | + A Sample configuration file for adding new orderer is available [here](https://github.com/hyperledger/bevel/blob/main/platforms/hyperledger-fabric/configuration/samples/network-fabricv2-raft-add-orderer.yaml). Please go through this file and all the comments there and edit accordingly. |
| 35 | + |
| 36 | + For generic instructions on the Fabric configuration file, refer [this guide](../networkyaml-fabric.md). |
| 37 | + |
| 38 | + While modifying the configuration file(`network.yaml`) for adding new peer, all the existing orderers should have `status` tag as `existing` and the new orderers should have `status` tag as `new` under `network.organizations` as |
| 39 | + |
| 40 | + ```yaml |
| 41 | + |
| 42 | + --8<-- "platforms/hyperledger-fabric/configuration/samples/network-fabricv2-raft-add-orderer.yaml:126:135" |
| 43 | + .. |
| 44 | + .. |
| 45 | + --8<-- "platforms/hyperledger-fabric/configuration/samples/network-fabricv2-raft-add-orderer.yaml:174:174" |
| 46 | + --8<-- "platforms/hyperledger-fabric/configuration/samples/network-fabricv2-raft-add-orderer.yaml:185:220" |
| 47 | + |
| 48 | + ``` |
| 49 | + and under `network.orderers` the new orderer must be added. |
| 50 | + |
| 51 | + ```yaml |
| 52 | + --8<-- "platforms/hyperledger-fabric/configuration/samples/network-fabricv2-raft-add-orderer.yaml:42:66" |
| 53 | + ``` |
| 54 | + |
| 55 | + The `network.yaml` file should contain the specific `network.organization` details. |
| 56 | + |
| 57 | + Ensure the following is considered when adding the new orderer on a different cluster: |
| 58 | + - The CA server is accessible publicly or at least from the new cluster. |
| 59 | + - The CA server public certificate is stored in a local path and that path provided in network.yaml. |
| 60 | + - There is a single Hashicorp Vault and both clusters (as well as ansible controller) can access it. |
| 61 | + - Admin User certs have been already generated and store in Vault (this is taken care of by deploy-network.yaml playbook if you are using Bevel to setup the network). |
| 62 | + - The `network.env.type` is different for different clusters. |
| 63 | + - The GitOps release directory `gitops.release_dir` is different for different clusters. |
| 64 | + |
| 65 | +1. **Run playbook** |
| 66 | + |
| 67 | + The [add-orderer.yaml](https://github.com/hyperledger/bevel/tree/main/platforms/hyperledger-fabric/configuration/add-orderer.yaml) playbook is used to add a new peer to an existing organization in the existing network. This can be done using the following command |
| 68 | + |
| 69 | + ``` |
| 70 | + ansible-playbook platforms/hyperledger-fabric/configuration/add-orderer.yaml --extra-vars "@path-to-network.yaml" |
| 71 | + ``` |
| 72 | + |
| 73 | + --- |
| 74 | + **NOTE:** The `orderer.status` is not required when the network is deployed for the first time but is mandatory for addition of new orderer. |
| 75 | + |
21 | 76 |
|
22 |
| ---- |
| 77 | +## Method 2: Using `helm install` |
23 | 78 |
|
24 |
| -<a name = "modifying-configuration-file"></a> |
25 |
| -## Modifying Configuration File |
| 79 | +1. **Update the orderernode values.yaml file** |
26 | 80 |
|
27 |
| -A Sample configuration file for adding new orderer is available [here](https://github.com/hyperledger/bevel/blob/main/platforms/hyperledger-fabric/configuration/samples/network-fabricv2-raft-add-orderer.yaml). Please go through this file and all the comments there and edit accordingly. |
| 81 | + Following changes are must in the `values.yaml` file for a new orderer node to be added to the network: |
28 | 82 |
|
29 |
| -For generic instructions on the Fabric configuration file, refer [this guide](../networkyaml-fabric.md). |
| 83 | + - `certs.settings.createConfigMaps: false` as the ConfigMaps for certs are already generated in the same namespace. |
30 | 84 |
|
31 |
| -While modifying the configuration file(`network.yaml`) for adding new peer, all the existing orderers should have `status` tag as `existing` and the new orderers should have `status` tag as `new` under `network.organizations` as |
| 85 | + Refer to the [fabric-orderernode chart documentation](https://github.com/hyperledger/bevel/tree/main/platforms/hyperledger-fabric/charts/fabric-orderernode) for a complete list of available configuration options. |
32 | 86 |
|
33 |
| -```yaml |
| 87 | +1. **Install the orderernode chart** |
| 88 | + |
| 89 | + Execute the following command to install the Peer chart: |
| 90 | + ```bash |
| 91 | + helm dependency update ./fabric-orderernode |
| 92 | + helm install <release-name> ./fabric-orderernode --namespace <namespace> --values <values-file.yaml> |
| 93 | + ``` |
| 94 | + Replace the following placeholders: |
34 | 95 |
|
35 |
| ---8<-- "platforms/hyperledger-fabric/configuration/samples/network-fabricv2-raft-add-orderer.yaml:126:135" |
36 |
| - .. |
37 |
| - .. |
38 |
| ---8<-- "platforms/hyperledger-fabric/configuration/samples/network-fabricv2-raft-add-orderer.yaml:174:174" |
39 |
| ---8<-- "platforms/hyperledger-fabric/configuration/samples/network-fabricv2-raft-add-orderer.yaml:185:220" |
| 96 | + - `<release-name>`: The desired name for the orderer node release. |
| 97 | + - `<namespace>`: The Kubernetes namespace where the Peer should be deployed. |
| 98 | + - `<values-file.yaml>`: The path to a YAML file containing the new peer configuration values. |
40 | 99 |
|
41 |
| -``` |
42 |
| -and under `network.orderers` the new orderer must be added. |
| 100 | +1. **Update the osnadmin-channel-create values.yaml file** |
43 | 101 |
|
44 |
| -```yaml |
45 |
| ---8<-- "platforms/hyperledger-fabric/configuration/samples/network-fabricv2-raft-add-orderer.yaml:42:66" |
46 |
| -``` |
47 |
| - |
48 |
| -The `network.yaml` file should contain the specific `network.organization` details. |
| 102 | + Following changes are must in the `values.yaml` file for a new orderer node to be added to the network: |
| 103 | + ``` |
| 104 | + orderer: |
| 105 | + addOrderer: true |
| 106 | + name: orderer5 |
| 107 | + localMspId: orgNameMSP |
| 108 | + ordererAddress: orderer1.orgname-net:443 |
| 109 | + ``` |
49 | 110 |
|
50 |
| -Ensure the following is considered when adding the new orderer on a different cluster: |
51 |
| -- The CA server is accessible publicly or at least from the new cluster. |
52 |
| -- The CA server public certificate is stored in a local path and that path provided in network.yaml. |
53 |
| -- There is a single Hashicorp Vault and both clusters (as well as ansible controller) can access it. |
54 |
| -- Admin User certs have been already generated and store in Vault (this is taken care of by deploy-network.yaml playbook if you are using Bevel to setup the network). |
55 |
| -- The `network.env.type` is different for different clusters. |
56 |
| -- The GitOps release directory `gitops.release_dir` is different for different clusters. |
| 111 | + Refer to the [fabric-osn-channel-create chart documentation](https://github.com/hyperledger/bevel/tree/main/platforms/hyperledger-fabric/charts/fabric-osn-channel-create) for a complete list of available configuration options. |
57 | 112 |
|
58 |
| -<a name = "run-playbook"></a> |
59 |
| -## Run playbook |
| 113 | +1. **Install the osnadmin-channel-create chart** |
| 114 | + |
| 115 | + Execute the following command to install the fabric-osnadmin-channel-create chart: |
| 116 | + ```bash |
| 117 | + cd ../.. |
| 118 | + helm install <release-name> ./fabric-osnadmin-channel-create --namespace <namespace> --values <values-file.yaml> |
| 119 | + ``` |
| 120 | + Replace the following placeholders: |
60 | 121 |
|
61 |
| -The [add-orderer.yaml](https://github.com/hyperledger/bevel/tree/main/platforms/hyperledger-fabric/configuration/add-orderer.yaml) playbook is used to add a new peer to an existing organization in the existing network. This can be done using the following command |
| 122 | + - `<release-name>`: The desired name for the Peer release. |
| 123 | + - `<namespace>`: The Kubernetes namespace where the Peer should be deployed. |
| 124 | + - `<values-file.yaml>`: The path to a YAML file containing the new peer configuration values. |
62 | 125 |
|
63 |
| -``` |
64 |
| -ansible-playbook platforms/hyperledger-fabric/configuration/add-orderer.yaml --extra-vars "@path-to-network.yaml" |
65 |
| -``` |
66 | 126 |
|
67 |
| ---- |
68 |
| -**NOTE:** The `orderer.status` is not required when the network is deployed for the first time but is mandatory for addition of new orderer. |
| 127 | +## Additional Notes |
| 128 | +- The `add-orderer.yaml playbook` and `helm install` method has been tested on networks created by Bevel. Networks created using other methods may be suitable, but this has not been tested by the Bevel team. |
| 129 | +- Ensure that the network.yaml file contains the specific network.organization details along with the orderer information. |
0 commit comments