github.com/osdi23p228/fabric@v0.0.0-20221218062954-77808885f5db/docs/source/deployorderer/ordererchecklist.md (about) 1 # Checklist for a production ordering node 2 3 As you prepare to build a production ordering service (or a single ordering node), you need to customize the configuration by editing the [orderer.yaml](https://github.com/osdi23p228/fabric/blob/{BRANCH}/sampleconfig/orderer.yaml) file, which is copied into the `/config` directory when downloading the Fabric binaries, and available within the Fabric ordering node image at `/etc/hyperledger/fabric/orderer.yaml`. 4 5 While in a production environment you could override the environment variables in the `orderer.yaml` file in your Docker container or your Kubernetes job, these instructions show how to edit `orderer.yaml` instead. It’s important to understand the parameters in the configuration file and their dependencies on other parameter settings in the file. Blindly overriding one setting using an environment variable could affect the functionality of another setting. Therefore, the recommendation is that before starting the ordering node, you make the modifications to the settings in the configuration file to become familiar with the available settings and how they work. Afterwards, you may choose to override these parameters using environment variables. 6 7 This checklist covers key configuration parameters for setting up a production ordering service. Of course, you can always refer to the orderer.yaml file for additional parameters or more information. It also provides guidance on which parameters should be overridden. The list of parameters that you need to understand and that are described in this topic include: 8 9 * [General.ListenAddress](#general-listenaddress) 10 * [General.ListenPort](#general-listenport) 11 * [General.TLS.*](#general-tls) 12 * [General.Keepalive.*](#general-keepalive) 13 * [General.Cluster.*](#general-cluster) 14 * [General.BoostrapMethod](#general-bootstrapmethod) 15 * [General.BoostrapFile](#general-bootstrapfile) 16 * [General.LocalMSPDir](#general-localmspdir) 17 * [General.LocalMSPID](#general-localmspid) 18 * [FileLedger.Location](#fileledger-location) 19 * [Operations.*](#operations) 20 * [Metrics.*](#metrics) 21 * [Consensus.*](#consensus) 22 23 ## General.ListenAddress 24 25 ``` 26 # Listen address: The IP on which to bind to listen. 27 ListenAddress: 127.0.0.1 28 ``` 29 30 * **`ListenAddress`**: (default value should be overridden) This is the location where the orderer will listen, for example, `0.0.0.0`. Note: unlike the peer, the `orderer.yaml` separates the address and the port, hence the [General.ListenPort](#general-listenport) parameter. 31 32 ## General.ListenPort 33 34 ``` 35 # Listen port: The port on which to bind to listen. 36 ListenPort: 7050 37 ``` 38 39 * **`ListenPort`**: (default value should be overridden) This is the port that the orderer listens on. 40 41 ## General.TLS 42 43 ``` 44 Enabled: false 45 # PrivateKey governs the file location of the private key of the TLS certificate. 46 PrivateKey: tls/server.key 47 # Certificate governs the file location of the server TLS certificate. 48 Certificate: tls/server.crt 49 RootCAs: 50 - tls/ca.crt 51 ClientAuthRequired: false 52 ClientRootCAs: 53 ``` 54 55 * **`Enabled`**: (default value should be overridden) In a production network, you should be using TLS-secured communications. This value should be `true`. 56 * **`PrivateKey`**: (default value should be overridden). Provide the path to, and filename of, the private key generated by your TLS CA for this node. 57 * **`Certificate`**: (default value should be overridden) Provide the path to, and filename of, the public certificate (also known as the sign certificate) generated by your TLS CA for this node. 58 * **`RootCAs`**: (should be commented out) This parameter is typically unset for normal use. It is a list of the paths to additional root certificates used for verifying certificates of other orderer nodes during outbound connections. It can be used to augment the set of TLS CA certificates available from the MSPs of each channel's configuration. 59 * **`ClientAuthRequired`**: (Mutual TLS only) Setting this value to “true” will enable mutual TLS on your network, and must be done for the entire network, not just one node. 60 * **`ClientRootCAs`**: (Mutual TLS only) Can be left blank if mutual TLS is disabled. If mutual TLS is enabled, this is a list of the paths to additional root certificates used for verifying certificates of client connections. It can be used to augment the set of TLS CA certificates available from the MSPs of each channel’s configuration. 61 62 ## General.KeepAlive 63 64 The `KeepAlive` values might need to be tuned for compatibility with any networking devices or software (like firewalls or proxies) in between components of your network. Ideally, these settings would be manipulated if needed in a test or pre-prod environment and then set accordingly for your production environment. 65 66 ``` 67 # ServerMinInterval is the minimum permitted time between client pings. 68 # If clients send pings more frequently, the server will 69 # disconnect them. 70 ServerMinInterval: 60s 71 # ServerInterval is the time between pings to clients. 72 ServerInterval: 7200s 73 # ServerTimeout is the duration the server waits for a response from 74 # a client before closing the connection. 75 ServerTimeout: 20s 76 ``` 77 78 * **`ServerMinInterval`**: (default value should not be overridden, unless determined necessary through testing) 79 * **`ServerInterval`**: (default value should not be overridden, unless determined necessary through testing) 80 * **`ServerTimeout`**: (default value should not be overridden, unless determined necessary through testing) 81 82 ## General.Cluster 83 84 ``` 85 # SendBufferSize is the maximum number of messages in the egress buffer. 86 # Consensus messages are dropped if the buffer is full, and transaction 87 # messages are waiting for space to be freed. 88 SendBufferSize: 10 89 # ClientCertificate governs the file location of the client TLS certificate 90 # If not set, the server General.TLS.Certificate is re-used. 91 ClientCertificate: 92 # If not set, the server General.TLS.PrivateKey is re-used. 93 ClientPrivateKey: 94 # The below 4 properties should be either set together, or be unset together. 95 # If they are set, then the orderer node uses a separate listener for intra-cluster 96 # communication. If they are unset, then the general orderer listener is used. 97 # This is useful if you want to use a different TLS server certificates on the 98 # client-facing and the intra-cluster listeners. 99 100 # ListenPort defines the port on which the cluster listens to connections. 101 ListenPort: 102 # ListenAddress defines the IP on which to listen to intra-cluster communication. 103 ListenAddress: 104 # ServerCertificate defines the file location of the server TLS certificate used for intra-cluster 105 # communication. 106 ServerCertificate: 107 # ServerPrivateKey defines the file location of the private key of the TLS certificate. 108 ServerPrivateKey: 109 ``` 110 111 If unset, the `ClientCertificate` and `ClientPrivateKey` default to the server `General.TLS.Certificate` and `General.TLS.PrivateKey` when the orderer is not configured to use a separate cluster port. 112 113 * **`ClientCertificate`**: Provide the path to, and filename of, the public certificate (also known as a signed certificate) generated by your TLS CA for this node. 114 * **`ClientPrivateKey`**: Provide the path to, and filename of, the private key generated by your TLS CA for this node. 115 116 In general, these four parameters would only need to be configured if you want to configure a separate listener and TLS certificates for intra-cluster communication (with other Raft orderers), as opposed to using the listener that peer clients and application clients utilize. This is an advanced deployment option. These four parameters should be set together or left unset, and if they are set, note that the `ClientCertificate` and `ClientPrivateKey` must be set as well. 117 118 * **`ListenPort`** 119 * **`ListenAddress`** 120 * **`ServerCertificate`** 121 * **`ServerPrivateKey`** 122 123 ## General.BoostrapMethod 124 125 ``` 126 # Bootstrap method: The method by which to obtain the bootstrap block 127 # system channel is specified. The option can be one of: 128 # "file" - path to a file containing the genesis block or config block of system channel 129 # "none" - allows an orderer to start without a system channel configuration 130 BootstrapMethod: file 131 ``` 132 133 * **`BootstrapMethod`**: (default value should not be overridden) Unless you plan to use a file type other than “file”, this value should be left as is. 134 135 ## General.BoostrapFile 136 137 ``` 138 # Bootstrap file: The file containing the bootstrap block to use when 139 # initializing the orderer system channel and BootstrapMethod is set to 140 # "file". The bootstrap file can be the genesis block, and it can also be 141 # a config block for late bootstrap of some consensus methods like Raft. 142 # Generate a genesis block by updating $FABRIC_CFG_PATH/configtx.yaml and 143 # using configtxgen command with "-outputBlock" option. 144 # Defaults to file "genesisblock" (in $FABRIC_CFG_PATH directory) if not specified. 145 BootstrapFile: 146 ``` 147 148 * **`BoostrapFile`**: (default value should be overridden) Specify the location and name of the system channel genesis block to use when this node is created. 149 150 ## General.LocalMSPDir 151 152 ``` 153 # LocalMSPDir is where to find the private crypto material needed by the 154 # orderer. It is set relative here as a default for dev environments but 155 # should be changed to the real location in production. 156 LocalMSPDir: msp 157 ``` 158 159 **`LocalMSPDir`**: (default value will often be overriden be overridden) This is the path to the ordering node's local MSP, which must be created before it can be deployed. The path can be absolute or relative to `FABRIC_CFG_PATH` (by default, it is `/etc/hyperledger/fabric` in the orderer image). Unless an absolute path is specified to a folder named something other than "msp", the ordering node defaults to looking for a folder called “msp” at the path (in other words, `FABRIC_CFG_PATH/msp`) and when using the orderer image: `/etc/hyperledger/fabric/msp`. If you are using the recommended folder structure described in the [Registering and enrolling identities with a CA](https://hyperledger-fabric-ca.readthedocs.io/en/release-1.4/deployguide/use_CA.html) topic, it would be relative to the `FABRIC_CFG_PATH` as follows: 160 `config/organizations/ordererOrganizations/org0.example.com/orderers/orderer0.org0.example.com/msp`. **The best practice is to store this data in persistent storage**. This prevents the MSP from being lost if your orderer containers are destroyed for some reason. 161 162 ## General.LocalMSPID 163 164 ``` 165 # LocalMSPID is the identity to register the local MSP material with the MSP 166 # manager. IMPORTANT: The local MSP ID of an orderer needs to match the MSP 167 # ID of one of the organizations defined in the orderer system channel's 168 # /Channel/Orderer configuration. The sample organization defined in the 169 # sample configuration provided has an MSP ID of "SampleOrg". 170 LocalMSPID: SampleOrg 171 ``` 172 173 * **`LocalMSPID`**: (default value should be overridden) The MSP ID must match the orderer organization MSP ID that exists in the configuration of the system channel. This means the MSP ID must have been listed in the `configtx.yaml` used to create the genesis block of the system channel (or have been added later to the list of system channel administrators). 174 175 ## General.BCCSP.* 176 177 ``` 178 # Default specifies the preferred blockchain crypto service provider 179 # to use. If the preferred provider is not available, the software 180 # based provider ("SW") will be used. 181 # Valid providers are: 182 # - SW: a software based crypto provider 183 # - PKCS11: a CA hardware security module crypto provider. 184 Default: SW 185 186 # SW configures the software based blockchain crypto provider. 187 SW: 188 # TODO: The default Hash and Security level needs refactoring to be 189 # fully configurable. Changing these defaults requires coordination 190 # SHA2 is hardcoded in several places, not only BCCSP 191 Hash: SHA2 192 Security: 256 193 # Location of key store. If this is unset, a location will be 194 # chosen using: 'LocalMSPDir'/keystore 195 FileKeyStore: 196 KeyStore: 197 ``` 198 199 (Optional) This section is used to configure the Blockchain crypto provider. 200 201 * **`BCCSP.Default:`** If you plan to use a Hardware Security Module (HSM), then this must be set to `PKCS11`. 202 203 ``` 204 # Settings for the PKCS#11 crypto provider (i.e. when DEFAULT: PKCS11) 205 PKCS11: 206 # Location of the PKCS11 module library 207 Library: 208 # Token Label 209 Label: 210 # User PIN 211 Pin: 212 Hash: 213 Security: 214 FileKeyStore: 215 KeyStore: 216 ``` 217 218 * **`BCCSP.PKCS11.*:`** Provide this set of parameters according to your HSM configuration. Refer to this [example](../hsm.html) of an HSM configuration for more information. 219 220 ## FileLedger.Location 221 222 ``` 223 # Location: The directory to store the blocks in. 224 Location: /var/hyperledger/production/orderer 225 ``` 226 227 * **`Location`**: (default value should be overridden in the unlikely event where two ordering nodes are running on the same node) Every channel on which the node is a consenter will have its own subdirectory at this location. The user running the orderer needs to own and have write access to this directory. **The best practice is to store this data in persistent storage**. This prevents the ledger from being lost if your orderer containers are destroyed for some reason. 228 229 ## Operations.* 230 231 The operations service is used for monitoring the health of the ordering node and relies on mutual TLS to secure its communication. Therefore, you need to set `operations.tls.clientAuthRequired` to `true`. When this parameter is set to `true`, clients attempting to ascertain the health of the node are required to provide a valid certificate for authentication. If the client does not provide a certificate or the service cannot verify the client’s certificate, the request is rejected. This means that the clients will need to register with the ordering node's TLS CA and provide their TLS signing certificate on the requests. See [The Operations Service](../operations_service.html) to learn more. 232 233 If you plan to use Prometheus [metrics](#metrics) to monitor your ordering node, you must configure the operations service here. 234 235 In the unlikely case where two ordering nodes are running on the same node on your infrastructure, you need to modify the addresses for the second ordering node to use a different port. Otherwise, when you start the second ordering node, it will fail to start, reporting that the addresses are already in use. 236 237 ``` 238 # host and port for the operations server 239 ListenAddress: 127.0.0.1:8443 240 241 # TLS configuration for the operations endpoint 242 TLS: 243 # TLS enabled 244 Enabled: false 245 246 # Certificate is the location of the PEM encoded TLS certificate 247 Certificate: 248 249 # PrivateKey points to the location of the PEM-encoded key 250 PrivateKey: 251 252 # Most operations service endpoints require client authentication when TLS 253 # is enabled. ClientAuthRequired requires client certificate authentication 254 # at the TLS layer to access all resources. 255 ClientAuthRequired: false 256 257 # Paths to PEM encoded ca certificates to trust for client authentication 258 ClientRootCAs: [] 259 ``` 260 261 * **`ListenAddress`**: (required when using the operations service) Specify the address and port of the operations server. 262 * **`Enabled`**: (required when using the operations service) Must be `true` if the operations service is being used. 263 * **`Certificate`**: (required when using the operations service) Can be the same file as the `General.TLS.Certificate`. 264 * **`PrivateKey`**: (required when using the operations service) Can be the same file as the `General.TLS.PrivateKey`. 265 * **`ClientAuthRequired`**: (required when using the operations service) Must be set to `true` to enable mutual TLS between the client and the server. 266 * **`ClientRootCAs`**: (required when using the operations service) Similar to the client root CA cert file in TLS, it contains a list of client root CA certificates that can be used to verify client certificates. If the client enrolled with the orderer organization CA, then this value is the orderer organization root CA cert. 267 268 ## Metrics.* 269 270 By default this is disabled, but if you want to monitor the metrics for the orderer, you need to use `StatsD` or `Prometheus` as your metric provider. `StatsD` uses a "push" model, pushing metrics from the ordering node to a `StatsD` endpoint. Because of this, it does not require configuration of the operations service itself. `Prometheus` metrics, by contrast, are pulled from an ordering node. 271 272 For more information about the available `Prometheus` metrics, check out [Prometheus](../metrics_reference.html#prometheus) 273 274 For more information about the available `StatsD` metrics, check out [StatsD](../metrics_reference.html#statsd). 275 276 Because Prometheus utilizes a "pull" model there is not any configuration required, beyond making the operations service available. Rather, Prometheus will send requests to the operations URL to poll for available metrics. 277 278 ``` 279 # The metrics provider is one of statsd, prometheus, or disabled 280 Provider: disabled 281 282 # The statsd configuration 283 Statsd: 284 # network type: tcp or udp 285 Network: udp 286 287 # the statsd server address 288 Address: 127.0.0.1:8125 289 290 # The interval at which locally cached counters and gauges are pushed 291 # to statsd; timings are pushed immediately 292 WriteInterval: 30s 293 294 # The prefix is prepended to all emitted statsd metrics 295 Prefix: 296 ``` 297 298 * **`Provider`**: Set this value to `statsd` if using `StatsD` or `prometheus` if using `Prometheus`. 299 * **`Statsd.Address`**: (required to use `StatsD` metrics for the ordering node) When `StatsD` is enabled, you will need to configure the `hostname` and `port` of the `StatsD` server so that the ordering node can push metric updates. 300 301 ## Consensus.* 302 303 The values of this section vary by consensus plugin. The values below are for the `etcdraft` consensus plugin. If you are using a different consensus plugin, refer to its documentation for allowed keys and recommended values. 304 305 ``` 306 # The allowed key-value pairs here depend on consensus plugin. For etcd/raft, 307 # we use following options: 308 309 # WALDir specifies the location at which Write Ahead Logs for etcd/raft are 310 # stored. Each channel will have its own subdir named after channel ID. 311 WALDir: /var/hyperledger/production/orderer/etcdraft/wal 312 313 # SnapDir specifies the location at which snapshots for etcd/raft are 314 # stored. Each channel will have its own subdir named after channel ID. 315 SnapDir: /var/hyperledger/production/orderer/etcdraft/snapshot 316 ``` 317 318 * **`WALDir`**: (default value should be overridden) This is the path to the write ahead logs on the local filesystem of the ordering node. It can be an absolute path or relative to `FABRIC_CFG_PATH`. It defaults to `/var/hyperledger/production/orderer/etcdraft/wal`. Each channel will have its own subdirectory named after the channel ID. The user running the ordering node needs to own and have write access to this directory. **The best practice is to store this data in persistent storage**. This prevents the write ahead log from being lost if your orderer containers are destroyed for some reason. 319 * **`SnapDir`**: (default value should be overridden) This is the path to the snapshots on the local filesystem of the ordering node. For more information about how snapshots work in a Raft ordering service, check out [Snapshots](../orderer/ordering_service.html#snapshots)/ It can be an absolute path or relative to `FABRIC_CFG_PATH`. It defaults to `/var/hyperledger/production/orderer/etcdraft/wal`. Each channel will have its own subdirectory named after the channel ID. The user running the ordering node needs to own and have write access to this directory. **The best practice is to store this data in persistent storage**. This prevents snapshots from being lost if your orderer containers are destroyed for some reason. 320 321 For more information about ordering node configuration, including how to set parameters that are not available in `orderer.yaml`, check out [Configuring and operating a Raft ordering service](../raft_configuration.html). 322 323 <!--- Licensed under Creative Commons Attribution 4.0 International License 324 https://creativecommons.org/licenses/by/4.0/) -->