Invia feedback
Gestione del failover di un database PostgreSQL
Durante il failover di un database PostgreSQL, esegui le operazioni seguenti:
Arresta apigee-postgresql
sul master attuale se è ancora in esecuzione:
/opt/apigee/apigee-service/bin/apigee-service apigee-postgresql stop
Vai al nodo in standby e richiama il seguente comando per impostarlo come master:
/opt/apigee/apigee-service/bin/apigee-service apigee-postgresql promote-standby-to-master IPorDNSofOldMaster
Se il master precedente viene ripristinato in un momento successivo, impostalo come nodo in standby:
Nel master attuale, modifica il file di configurazione impostando:
PG_MASTER=IPorDNSofNewMaster
PG_STANDBY=IPorDNSofOldMaster
Nota: Apigee consiglia vivamente di utilizzare indirizzi IP
anziché i nomi host di PG_MASTER
e PG_STANDBY
del file di configurazione invisibile. Inoltre, devi essere coerente su entrambi
nodi.
Se utilizzi nomi host anziché indirizzi IP, devi assicurarti che i nomi host
correttamente utilizzando il DNS.
Abilita la replica sul nuovo master:
/opt/apigee/apigee-service/bin/apigee-service apigee-postgresql setup-replication-on-master -f configFIle
Nel master precedente, modifica il file di configurazione in modo da impostare:
PG_MASTER=IPorDNSofNewMaster
PG_STANDBY=IPorDNSofOldMaster
Interrompi apigee-postgresql
sul vecchio master:
/opt/apigee/apigee-service/bin/apigee-service apigee-postgresql stop
Nel vecchio master, pulisci tutti i vecchi dati di Postgres:
rm -rf /opt/apigee/data/apigee-postgresql/
Nota : se necessario, puoi eseguire il backup di questi dati prima
la eliminiamo.
Configura il master precedente come standby:
/opt/apigee/apigee-service/bin/apigee-service apigee-postgresql setup-replication-on-standby -f configFile
Al termine della replica, verifica lo stato della replica inviando quanto segue
su entrambi i server. Il sistema dovrebbe mostrare risultati identici su entrambi i server per
per eseguire una replica corretta:
Sul nodo master, esegui:
/opt/apigee/apigee-service/bin/apigee-service apigee-postgresql postgres-check-master
Verifica che si tratti dell'istanza principale.
Sul nodo in standby:
/opt/apigee/apigee-service/bin/apigee-service apigee-postgresql postgres-check-standby
Verifica che sia indicato che è in standby.
Invia feedback
Salvo quando diversamente specificato, i contenuti di questa pagina sono concessi in base alla licenza Creative Commons Attribution 4.0 , mentre gli esempi di codice sono concessi in base alla licenza Apache 2.0 . Per ulteriori dettagli, consulta le norme del sito di Google Developers . Java è un marchio registrato di Oracle e/o delle sue consociate.
Ultimo aggiornamento 2024-08-23 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Mancano le informazioni di cui ho bisogno"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Troppo complicato/troppi passaggi"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Obsoleti"
},{
"type": "thumb-down",
"id": "translationIssue",
"label":"Problema di traduzione"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Problema relativo a esempi/codice"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Altra"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Facile da capire"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Il problema è stato risolto"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Altra"
}]
Vuoi dirci altro?
{"lastModified": "Ultimo aggiornamento 2024-08-23 UTC."}
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Mancano le informazioni di cui ho bisogno","missingTheInformationINeed","thumb-down"],["Troppo complicato/troppi passaggi","tooComplicatedTooManySteps","thumb-down"],["Obsoleti","outOfDate","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Problema relativo a esempi/codice","samplesCodeIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2024-08-23 UTC."],[],[]]