Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Stai visualizzando la documentazione di Apigee e Apigee hybrid.
Visualizza la documentazione di
Apigee Edge.
Sintomo
Quando replichi i dati durante un'espansione multiregionale, lo stato CassandraDataReplication
potrebbe mostrare uno stato di errore e la replica dei dati potrebbe non riuscire.
Messaggio di errore
Quando utilizzi
kubectl per visualizzare lo stato della ricompilazione:
kubectl -n apigee get apigeeds \
-o jsonpath="{.items[].status.cassandraDataReplication}{'\n'}"
Uno o più pod Cassandra mostrano uno stato di errore e un messaggio che indica che la ricostruzione
non è riuscita. Ad esempio:
{
"rebuildDetails": {
"apigee-cassandra-default-0": {
"message": "failed to rebuild from us-west1: java.lang.IllegalStateException : Unable to find sufficient sources for streaming range (-8567285182390470134,-8567154549835592965] in keyspace system_distributed",
"state": "error",
"updated": 1641581899
},
…
}
}
Cause possibili
Causa
Descrizione
Istruzioni per la risoluzione dei problemi applicabili a
Potrebbero esserci problemi di connettività di rete tra i pod Cassandra in data center diversi.
Apigee hybrid
Passaggi comuni di diagnostica
Recupera lo stato della replica dei dati:
kubectl -n apigee get apigeeds \ -o jsonpath="{.items[].status.cassandraDataReplication}{'\n'}"
Se viene visualizzato un errore con un messaggio simile a quello specificato in
Messaggio di errore, significa che stai
riscontrando questo problema.
Causa: regione di origine errata
Se specifichi una regione di origine (datacenter) nel file YAML di replica dei dati diversa dall'origine effettiva datacenter, la replica dei dati non andrà a buon fine. Segui i passaggi descritti nella sezione Diagnosi per analizzare questo scenario e
quelli descritti nella sezione Risoluzione per correggerlo.
Diagnosi
Elenca tutti i pod di Cassandra nella regione di origine:
kubectl -n apigee get pods -l app=apigee-cassandra
Recupera il valore datacenter effettivo da uno qualsiasi dei pod Cassandra restituiti
nel passaggio 1:
Ottieni il valore utilizzato per source.region nel file di risorse personalizzate (YAML) di replica dei dati Cassandra che hai creato in
Deployment multiregionale. Se utilizzi il nome file di esempio riportato nella
documentazione sul deployment multiregionale, il file deve essere denominato
datareplication.yaml.
Datacenter: dc-1================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
-- Address Load Tokens Owns (effective) Host ID Rack
UN 10.104.13.2 491.84 KiB 256 100.0% 7254711c-fe0a-4b34-b50f-861109f97936 ra-1
UN 10.104.11.3 527.36 KiB 256 100.0% 5ec389f0-fd67-4de6-9f21-172d5899ff78 ra-1
UN 10.104.12.7 838.46 KiB 256 100.0% 7a88be82-1f81-4117-86e3-2cda434c0878 ra-1
Tieni presente che source.region (us-west1) del file
datareplication.yaml non corrisponde al valore datacenter effettivo
(dc-1) dell'output di stato nodetool. Segui i passaggi descritti nella
soluzione per correggere la configurazione.
Risoluzione
Per correggere la replica dei dati, devi eliminare il job di replica dei dati e crearlo
con il nome datacenter corretto. Segui questi passaggi:
Elimina il processo di replica dei dati corrente. Se utilizzi il nome file di esempio riportato nella documentazione
Deployment multiregionale, il file deve essere denominato
datareplication.yaml.
kubectl delete -f datareplication.yaml
Aggiorna il nome della regione nel file YAML con il valore datacenter corretto, ad esempio:
dc-1:
L'errore di replica dei dati può anche essere il risultato di problemi di connettività tra i nodi Cassandra.
Diagnosi
Per analizzare questo scenario, procedi nel seguente modo:
Elenca tutti i pod di Cassandra:
# list cassandra pods
kubectl -n=apigee get pods -l app=apigee-cassandra
Esegui i seguenti comandi per telnet al primo pod Cassandra nel
secondo data center (dc-2) dal primo pod Cassandra nel primo data center
(dc-1) utilizzando la porta 7001:
k debug -it apigee-cassandra-default-0 -n apigee --image=nginx -- sh curl -v telnet://DC_2_APIGEE_CASSANDRA_DEFAULT_0_POD_IP:7001
Se telnet è riuscito, viene visualizzato un output simile al seguente:
* Rebuilt URL to: telnet://10.0.4.10:7001/
* Trying 10.0.4.10...
* TCP_NODELAY set
* Connected to 10.0.4.10 (10.0.4.10) port 7001 (#0)
In caso contrario, viene visualizzato un errore simile al seguente:
* Rebuilt URL to: telnet://10.0.4.10:7001/
* Trying 10.0.4.10...
* TCP_NODELAY set
* connect to 10.0.4.10 port 7001 failed: Connection refused
* Failed to connect to 10.0.4.10 port 7001: Connection refused
* Closing connection 0
curl: (7) Failed to connect to 10.0.4.10 port 7001: Connection refused
L'errore di connettività dal pod Cassandra in un data center al pod Cassandra in
un altro data center indica che deve esserci una restrizione del firewall o un qualche tipo di
problema di connettività di rete.
Risoluzione
Se questo deployment ibrido di Apigee si trova su GKE, verifica se sono impostate regole firewall che
bloccano il traffico da un data center all'altro e analizza il problema di connettività di rete
consultando la
panoramica delle regole firewall VPC.
Se questo deployment ibrido di Apigee si trova su GKE On-Prem, collabora con il team di networking pertinente e analizza il problema di connettività di rete.
Se il problema persiste anche dopo aver seguito le istruzioni riportate sopra, raccogli le seguenti
informazioni diagnostiche e poi contatta l'assistenza clienti Google Cloud:
L'ID progetto Google Cloud.
L'organizzazione Apigee hybrid.
I file overrides.yaml delle regioni di origine e di quelle nuove,
mascherando qualsiasiinformazioni sensibilie.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-09-04 UTC."],[[["\u003cp\u003eThis documentation addresses data replication failures in Apigee hybrid multi-region deployments, specifically when the \u003ccode\u003eCassandraDataReplication\u003c/code\u003e status indicates an error.\u003c/p\u003e\n"],["\u003cp\u003eA common cause of replication failure is an incorrect source region specified in the Cassandra data replication YAML file, which can be diagnosed by comparing the \u003ccode\u003esource.region\u003c/code\u003e with the \u003ccode\u003edatacenter\u003c/code\u003e value from the \u003ccode\u003enodetool status\u003c/code\u003e command.\u003c/p\u003e\n"],["\u003cp\u003eAnother potential cause of replication failure is network connectivity issues between Cassandra pods in different data centers, which can be diagnosed using \u003ccode\u003ecurl\u003c/code\u003e and \u003ccode\u003etelnet\u003c/code\u003e to check for connection refusals.\u003c/p\u003e\n"],["\u003cp\u003eResolution for an incorrect source region involves deleting the existing data replication job, updating the YAML file with the correct \u003ccode\u003edatacenter\u003c/code\u003e value, and reapplying the configuration.\u003c/p\u003e\n"],["\u003cp\u003eResolution for network issues involves checking firewall rules in GKE or working with the networking team in GKE-on-prem, ensuring connectivity between Cassandra nodes across regions.\u003c/p\u003e\n"]]],[],null,["# Cassandra data replication failure\n\n*You're viewing **Apigee** and **Apigee hybrid** documentation.\nView [Apigee Edge](https://docs.apigee.com/api-platform/troubleshoot/404-support-d) documentation.*\n| **Note:** This document is applicable for Apigee hybrid users only.\n\nSymptom\n-------\n\n\nWhen replicating data during a multi-region expansion, the `CassandraDataReplication`\nstatus may show an error state and data replication may fail.\n\nError message\n-------------\n\nWhen you use\n[kubectl](https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands) to view the rebuild status: \n\n```\n kubectl -n apigee get apigeeds \\\n -o jsonpath=\"{.items[].status.cassandraDataReplication}{'\\n'}\"\n```\n\nYou see that one or more Cassandra pods show an error state and a message stating the rebuild\nhas failed. For example: \n\n```scdoc\n{\n \"rebuildDetails\": {\n \"apigee-cassandra-default-0\": {\n \"message\": \"failed to rebuild from us-west1: java.lang.IllegalStateException : Unable to find sufficient sources for streaming range (-8567285182390470134,-8567154549835592965] in keyspace system_distributed\",\n \"state\": \"error\",\n \"updated\": 1641581899\n },\n …\n }\n}\n```\n\nPossible causes\n---------------\n\nCommon diagnosis steps\n----------------------\n\n1. Fetch the status of the data replication: \n\n ```\n kubectl -n apigee get apigeeds \\\n -o jsonpath=\"{.items[].status.cassandraDataReplication}{'\\n'}\"\n ```\n2. If you see an error with a message similar to the one specified in [Error message](#error-message), then it indicates that you are observing this issue.\n\nCause: Incorrect source region\n------------------------------\n\n\nIf you specify a source region (`datacenter`) in your data replication YAML file that\nis different from the actual source `datacenter`, then the data replication will\nfail. Perform the steps in [Diagnosis](#diagnosis) to analyze this scenario and\nperform the steps in [Resolution](#resolution) to correct it.\n\n### Diagnosis\n\n1. List all the Cassandra pods in the source region: \n\n ```\n kubectl -n apigee get pods -l app=apigee-cassandra\n ```\n2. Get the actual `datacenter` value from any one of the Cassandra pods returned in [step 1](#step-1): \n\n ```\n kubectl -n apigee exec -it apigee-cassandra-default-0 -- \\\n nodetool -u JMX_user -pw JMX_password status\n ```\n3. Get the value used for `source.region` in the Cassandra data replication custom resource (YAML) file you created in [Multi-region deployment](/apigee/docs/hybrid/latest/multi-region#configure-apigee-hybrid-for-multi-region). If you are using the example file name found in the Multi-region deployment documentation, then the file should be named `datareplication.yaml`. \n\n ```\n cat datareplication.yaml\n ```\n\n Example results: \n\n ```actionscript-3\n apiVersion: apigee.cloud.google.com/v1alpha1\n kind: CassandraDataReplication\n metadata:\n name: region-expansion\n namespace: apigee\n spec:\n organizationRef: apigee-hybrid-example-org\n force: false\n source:\n region: \"us-west1\"\n ```\n4. Check the result of the `nodetool status` output and verify whether or\n not the `datacenter` value matches the `source.region` value:\n\n ```\n kubectl -n apigee exec -it apigee-cassandra-default-0 -- \\\n nodetool -u jmxuser -pw iloveapis123 status\n ```\n\n Example results: \n\n ```restructuredtext\n Datacenter: dc-1\n ================\n Status=Up/Down\n |/ State=Normal/Leaving/Joining/Moving\n -- Address Load Tokens Owns (effective) Host ID Rack\n UN 10.104.13.2 491.84 KiB 256 100.0% 7254711c-fe0a-4b34-b50f-861109f97936 ra-1\n UN 10.104.11.3 527.36 KiB 256 100.0% 5ec389f0-fd67-4de6-9f21-172d5899ff78 ra-1\n UN 10.104.12.7 838.46 KiB 256 100.0% 7a88be82-1f81-4117-86e3-2cda434c0878 ra-1\n ```\n5. Note that the `source.region` (`us-west1`) from the `datareplication.yaml` file does not match the actual `datacenter` value (`dc-1`) from the `nodetool` status output. Follow the steps in [Resolution](#resolution) to correct the configuration.\n\n### Resolution\n\n\nTo correct the data replication, you'll need to delete the data replication job and create it\nwith the correct `datacenter` name. Perform the following steps:\n\n1. Delete the current data replication process. If using the example file name found in the [Multi-region deployment](/apigee/docs/hybrid/latest/multi-region#configure-apigee-hybrid-for-multi-region) documentation, then the file should be named `datareplication.yaml`. \n\n ```\n kubectl delete -f datareplication.yaml\n ```\n2. Update the region name in the YAML file to the correct `datacenter` value, e.g. `dc-1`: \n\n ```actionscript-3\n apiVersion: apigee.cloud.google.com/v1alpha1\n kind: CassandraDataReplication\n metadata:\n name: region-expansion\n namespace: apigee\n spec:\n organizationRef: apigee-hybrid-example-org\n force: false\n source:\n region: \"dc-1\"\n ```\n3. Apply the updated data replication: \n\n ```\n kubectl apply -f datareplication.yaml\n ```\n4. Check the rebuild status using the following command and verify that you no longer see the error state previously reported: \n\n ```\n kubectl -n apigee get apigeeds \\\n -o jsonpath=\"{.items[].status.cassandraDataReplication}{'\\n'}\"\n ```\n5. If the problem still persists, proceed to [Cause: Network connectivity issues.](#network-connectivity-issues)\n\nCause: Network connectivity issues\n----------------------------------\n\nThe data replication error may also be the result of connectivity issues between Cassandra\nnodes.\n| **Note:** Connectivity must be checked between all Cassandra nodes in all regions.\n\n### Diagnosis\n\n\nPerform the following steps to analyze this scenario:\n\n1. List all the Cassandra pods: \n\n ```text\n # list cassandra pods\n kubectl -n=apigee get pods -l app=apigee-cassandra\n ```\n2. Execute the following commands to telnet to the first Cassandra pod in the second data center (`dc-2`) from the first Cassandra pod in the first data center (`dc-1`) using port `7001`: \n\n ```scdoc\n k debug -it apigee-cassandra-default-0 -n apigee --image=nginx -- sh curl -v telnet://DC_2_APIGEE_CASSANDRA_DEFAULT_0_POD_IP:7001\n ```\n3. If telnet was successful, an output similar to following is displayed: \n\n ```scdoc\n * Rebuilt URL to: telnet://10.0.4.10:7001/\n * Trying 10.0.4.10...\n * TCP_NODELAY set\n * Connected to 10.0.4.10 (10.0.4.10) port 7001 (#0)\n ```\n4. Otherwise, an error similar to following is displayed: \n\n ```scdoc\n * Rebuilt URL to: telnet://10.0.4.10:7001/\n * Trying 10.0.4.10...\n * TCP_NODELAY set\n * connect to 10.0.4.10 port 7001 failed: Connection refused\n * Failed to connect to 10.0.4.10 port 7001: Connection refused\n * Closing connection 0\n curl: (7) Failed to connect to 10.0.4.10 port 7001: Connection refused\n ```\n\n\n The connectivity failure from the Cassandra pod in one data center to the Cassandra pod in\n another data center indicates that there must be a firewall restriction or some sort of\n network connectivity issue.\n\n### Resolution\n\n1. If this Apigee hybrid deployment is on GKE, check to see if any firewall rules are set that block the traffic from one data center to another and analyze the network connectivity problem by referring to [VPC firewall rules overview](https://cloud.google.com/vpc/docs/firewalls).\n2. If this Apigee hybrid deployment is on GKE-on-prem, work with the relevant networking team and analyze the network connectivity problem.\n\nIf the problem still persists, go to [Must gather diagnostic information](#must-gather).\n\nMust gather diagnostic information\n----------------------------------\n\n\nIf the problem persists even after following the above instructions, gather the following\ndiagnostic information and then contact [Google Cloud Customer Care](https://cloud.google.com/support-hub/):\n\n1. The Google Cloud Project ID.\n2. The Apigee hybrid organization.\n3. The `overrides.yaml` files from both source and new regions, masking any sensitive information.\n4. The `CassandraDataReplication` YAML file.\n5. Cassandra `nodetool status` output: \n\n ```\n kubectl -n apigee exec -it apigee-cassandra-default-0 -- \\\n nodetool -u JMX_user -pw JMX_password status\n ```\n6. Cassandra `nodetool describecluster` output: \n\n ```\n kubectl -n apigee exec -it apigee-cassandra-default-0 -- \\\n nodetool -u JMX_user -pw JMX_password describecluster\n ```"]]