Configuring IBM Blockchain monitoring in Unified Agent
When you deploy the Unified Agent, you can select to enable IBM Blockchain plug-in to collect metrics of IBM Blockchain Platform v2.1.x.
Preparing
Before you enable the IBM Blockchain plug-in, you must complete the following tasks.
Preparation steps for IBM Blockchain Platform v2.1.2 and later
- Create a path to store the bulk package of nodes and identities, for example,
/bcAgentWorkDir/bulkzip
. - Create the client identities for all peer and orderer nodes.
Note: The client identity must be named astls_<mspid>
that can be shared for all nodes with the same<mspid>
.
Do the following steps on all peer and orderer CA nodes:- Click the peer or orderer CA node in the Node tab.
- Click the actions menu next to the
admin
user and click Enroll identity. - Select TLS Certificate Authority from the Certificate Authority drop-down list.
- Enter the Enroll secret for the
admin
user and click Next. - Enter
tls_<mspid>
for Identity display name and click Add identity to Wallet.<mspid>
is the MSP ID of the peer or orderer nodes, and the sametls_<mspid>
identify is shared by the nodes with<mspid>
.
- Export all of the nodes and identities of your console in bulk.
- Navigate to the Settings tab in the navigation. You can see a section that is called Bulk data management.
- Keep all checkboxes selected, and then click the Export button.
- Click Export to download the
.zip
file that includes the nodes and identities to your local file system. - Copy the
.zip
package file to/bcAgentWorkDir/bulkzip
.
Preparation steps for IBM Blockchain v2.1.1 and before
Without Bulk data management, it's necessary to manually package the bulk .zip package.
- Create a path to store all peer and orderer nodes certificates and keys, for example,
/bcAgentWorkDir/certs
. - Export all peer and orderer nodes TLS CA certificate to JSON files. Do the following steps on all peer and orderer nodes:
- Click the peer or orderer in the Node tab.
- On the peer or orderer page, click Export to save the peer or orderer JSON file and name it as `_orderer.json
* or *
_peer.json`. - Copy the JSON files to
/bcAgentWorkDir/certs
.
- Create and export client identities for all peer and orderer nodes.
Note: The client identify must be named as
tls_<mspid>
that can be shared for all nodes with the same<mspid>
.
Do the following steps on all peer and orderer CA nodes:- Click the peer or orderer CA node in the Node tab.
- On the certificate authority page, select TLS Certificate Authority tab page, click the actions menu next to the
admin
user and click Enroll identity. - Enter the Enroll secret for the
admin
user and click Next. - Enter
tls_<mspid>
for Identity display name and click Add identity to Wallet.<mspid>
is the MSP ID of the peer or orderer nodes, the sametls_<mspid>
identity is shared by the nodes with<mspid>
*. - Open the Wallet tab and click the identity that you create.
- Click Export identity to download the JSON file and name it as
tls_<mspid>_identity.json
. - Copy the JSON files to
/bcAgentWorkDir/certs
.
- Manually package all JSON files to the
.zip
file, and then copy it to the specified path.- Package all JSON files to a
.zip
file, for example,certs.zip
- Create a path to store the
.zip
file, for example,/bcAgentWorkDir/bulkzip
. - Copy the
.zip
file to the path/bcAgentWorkDir/bulkzip
.
- Package all JSON files to a
Enable the IBM Blockchain plug-in
- Convert
certs.zip
that you get in the preparation step toibp-tls-certs.tar
.
To convert the.zip
file to.tar
file, extractcerts.zip
and then create a.tar
packageibp-tls-certs.tar
for these extracted files. You can also use a script to do the conversion:- Download the script file
blockchain_cert_convert.sh
from GitHub.
You can directly run the following command to download:wget https://raw.githubusercontent.com/IBM/cp4mcm-samples/master/monitoring/2.2/blockchain_cert_convert.sh
- Run the script.
- Input the directory where you store the
certs.zip
file, for example,/bcAgentWorkDir/bulkzip
. Then, you can get a new certs fileibp-tls-certs.tar
in/bcAgentWorkDir/bulkzip
.
- Download the script file
-
Create
ibp-secrets
.kubectl delete secret ibp-secrets kubectl -n $NAMESPACE create secret generic ibp-secrets --from-file=ibp-tls-certs.tar
Where
NAMESPACE
is the namespace where you install Unified Agent. -
Edit the
ua-blockchain
CR by running the following command:kubectl edit UA ua-blockchain
Note: The auto discovery for IBM Blockchain plug-in is disabled by default. You need to set it to always and then the CR is created. For more information, see Edit plug-in auto discovery pattern.
-
Make sure that the enabled state is true and save the CR.
Results
The IBM Blockchain plug-in is successfully enabled and configured in Unified Agent.