Checking the health metrics of Q Replication API
You can check the health of individual components such as capture, apply, and the network connectivity between source and target REST servers for Q Replication.
Before you begin
This task is done on the cluster host for the replication source. Ensure that you collect the following information before you run the API call:
- The basic authorization token of the source on the cluster host.1
- The hostname of the replication source database.
- The external port number of the replication source database.2
echo <source_db_username>:<source_db_password> | base64
oc get svc | grep <db2_instance_id> | grep db2u-engn-svc | grep 50001 | sed 's/.*50001://' | sed 's/\/TCP.*//')
About this task
Check the health of Q Replication API components in detail. You can check the health of Capture
(qrepCaptureState
), MQ manager for Capture (qrepCaptureMqState
),
Apply (qrepApplyState
), and MQ manager for Apply
(qrepApplyMqState
), and the network connectivity between source and target
(qrepRemoteConnectivity
) REST servers. The API call is run on the cluster host.
Procedure
Results
The checking of capture, apply, source, and target connectivity is complete when all configured
components are active. Active configured component states contain a
"resultValue":"0"
in the response body. When the component is not configured, the
state of the component has a []
value. For a configured component, the
"resultValue"
of the component state can have a value from "0"
to
"5"
.
The following table lists the possible values for the "resultValue"
key of a
configured component.
resultValue | Reason |
---|---|
0 | Active |
1 | Inactive |
2 | Unknown |
3 | Inactive message queue (MQ) channel detected |
4 | Inactive send queue detected |
5 | Inactive receive queue detected |
- The log files for Capture and Apply can be found in the
/mnt/qrepdata/bludr/logs/replication
. - The log file for REST API server can be found in
/mnt/qrepdata/bludr/logs/server
. - The log file for
asnclp
can be found in/mnt/qrepdata/bludr/logs/asnclp
.
The following table lists the possible HTTP status codes and response messages for checking the
overall health of capture, apply, source, and target connectivity by using the API call. It also
includes sample code to show the response syntax. Wait for the API call to return with
"resultValue"
in the response code for all configured components. Examine the
components with nonzero "resultValue"
inside the replication container.
HTTP Status Code | Reason | Response Model |
---|---|---|
200 | Details for replication | The user request returns a successful health check of configured and unconfigured components
(sample value):
|
4xx | Client request error | The user request was not fulfilled due to malformed request syntax or other client
issues:
|
5xx | Server error | The user request appeared valid, but was not fulfilled due to an issue with the
server:
|
Example
curl --insecure -X GET --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'Authorization: Basic ZHNhZG06aFRjT3dTTjR1RFo0N1Ew' 'https://dr-source1.ibm.com:31023/dr/v1/health/metrics'