This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.Questo contenuto non è disponibile nella lingua selezionata.
Chapter 7. Troubleshooting and debugging metering
Use the following sections to help troubleshoot and debug specific issues with metering.
In addition to the information in this section, be sure to review the following topics:
7.1. Troubleshooting metering Copia collegamentoCollegamento copiato negli appunti!
A common issue with metering is Pods failing to start. Pods might fail to start due to lack of resources or if they have a dependency on a resource that does not exist, such as a StorageClass or Secret.
7.1.1. Not enough compute resources Copia collegamentoCollegamento copiato negli appunti!
A common issue when installing or running metering is lack of compute resources. Ensure that metering is allocated the minimum resource requirements described in the installation prerequisites.
To determine if the issue is with resources or scheduling, follow the troubleshooting instructions included in the Kubernetes document Managing Compute Resources for Containers.
7.1.2. StorageClass not configured Copia collegamentoCollegamento copiato negli appunti!
Metering requires that a default StorageClass be configured for dynamic provisioning.
See the documentation on configuring metering for information on how to check if there are any StorageClasses configured for the cluster, how to set the default, and how to configure metering to use a StorageClass other than the default.
7.1.3. Secret not configured correctly Copia collegamentoCollegamento copiato negli appunti!
A common issue with metering is providing the incorrect secret when configuring your persistent storage. Be sure to review the example configuration files and create you secret according to the guidelines for your storage provider.
7.2. Debugging metering Copia collegamentoCollegamento copiato negli appunti!
Debugging metering is much easier when you interact directly with the various components. The sections below detail how you can connect and query Presto and Hive as well as view the dashboards of the Presto and HDFS components.
All of the commands in this section assume you have installed metering through OperatorHub in the openshift-metering
namespace.
7.2.1. Get reporting operator logs Copia collegamentoCollegamento copiato negli appunti!
The command below will follow the logs of the reporting-operator
.
oc -n openshift-metering logs -f "$(oc -n openshift-metering get pods -l app=reporting-operator -o name | cut -c 5-)" -c reporting-operator
$ oc -n openshift-metering logs -f "$(oc -n openshift-metering get pods -l app=reporting-operator -o name | cut -c 5-)" -c reporting-operator
7.2.2. Query Presto using presto-cli Copia collegamentoCollegamento copiato negli appunti!
The following command opens an interactive presto-cli session where you can query Presto. This session runs in the same container as Presto and launches an additional Java instance, which can create memory limits for the Pod. If this occurs, you should increase the memory request and limits of the Presto Pod.
By default, Presto is configured to communicate using TLS. You must to run the following command to run Presto queries:
oc -n openshift-metering exec -it "$(oc -n openshift-metering get pods -l app=presto,presto=coordinator -o name | cut -d/ -f2)" -- /usr/local/bin/presto-cli --server https://presto:8080 --catalog hive --schema default --user root --keystore-path /opt/presto/tls/keystore.pem
$ oc -n openshift-metering exec -it "$(oc -n openshift-metering get pods -l app=presto,presto=coordinator -o name | cut -d/ -f2)" -- /usr/local/bin/presto-cli --server https://presto:8080 --catalog hive --schema default --user root --keystore-path /opt/presto/tls/keystore.pem
Once you run this command, a prompt appears where you can run queries. Use the show tables from metering;
query to view the list of tables:
7.2.3. Query Hive using beeline Copia collegamentoCollegamento copiato negli appunti!
The following opens an interactive beeline session where you can query Hive. This session runs in the same container as Hive and launches an additional Java instance, which can create memory limits for the Pod. If this occurs, you should increase the memory request and limits of the Hive Pod.
oc -n openshift-metering exec -it $(oc -n openshift-metering get pods -l app=hive,hive=server -o name | cut -d/ -f2) -c hiveserver2 -- beeline -u 'jdbc:hive2://127.0.0.1:10000/default;auth=noSasl'
$ oc -n openshift-metering exec -it $(oc -n openshift-metering get pods -l app=hive,hive=server -o name | cut -d/ -f2) -c hiveserver2 -- beeline -u 'jdbc:hive2://127.0.0.1:10000/default;auth=noSasl'
Once you run this command, a prompt appears where you can run queries. Use the show tables;
query to view the list of tables:
7.2.4. Port-forward to the Hive web UI Copia collegamentoCollegamento copiato negli appunti!
Run the following command:
oc -n openshift-metering port-forward hive-server-0 10002
$ oc -n openshift-metering port-forward hive-server-0 10002
You can now open http://127.0.0.1:10002 in your browser window to view the Hive web interface.
7.2.5. Port-forward to hdfs Copia collegamentoCollegamento copiato negli appunti!
To the namenode:
oc -n openshift-metering port-forward hdfs-namenode-0 9870
$ oc -n openshift-metering port-forward hdfs-namenode-0 9870
You can now open http://127.0.0.1:9870 in your browser window to view the HDFS web interface.
To the first datanode:
oc -n openshift-metering port-forward hdfs-datanode-0 9864
$ oc -n openshift-metering port-forward hdfs-datanode-0 9864
To check other datanodes, run the above command, replacing hdfs-datanode-0
with the Pod you want to view information on.
7.2.6. Metering Ansible Operator Copia collegamentoCollegamento copiato negli appunti!
Metering uses the Ansible Operator to watch and reconcile resources in a cluster environment. When debugging a failed metering installation, it can be helpful to view the Ansible logs or status of your MeteringConfig custom resource.
7.2.6.1. Accessing ansible logs Copia collegamentoCollegamento copiato negli appunti!
In the default installation, the metering Operator is deployed as a Pod. In this case, we can check the logs of the ansible container within this Pod:
oc -n openshift-metering logs $(oc -n openshift-metering get pods -l app=metering-operator -o name | cut -d/ -f2) -c ansible
$ oc -n openshift-metering logs $(oc -n openshift-metering get pods -l app=metering-operator -o name | cut -d/ -f2) -c ansible
Alternatively, you can view the logs of the Operator container (replace -c ansible
with -c operator
) for condensed output.
7.2.6.2. Checking the MeteringConfig Status Copia collegamentoCollegamento copiato negli appunti!
It can be helpful to view the .status
field of your MeteringConfig custom resource to debug any recent failures. You can do this with the following command:
oc -n openshift-metering get meteringconfig operator-metering -o json | jq '.status'
$ oc -n openshift-metering get meteringconfig operator-metering -o json | jq '.status'