La documentazione per questo prodotto è stata redatta cercando di utilizzare un linguaggio senza pregiudizi. Ai fini di questa documentazione, per linguaggio senza di pregiudizi si intende un linguaggio che non implica discriminazioni basate su età, disabilità, genere, identità razziale, identità etnica, orientamento sessuale, status socioeconomico e intersezionalità. Le eventuali eccezioni possono dipendere dal linguaggio codificato nelle interfacce utente del software del prodotto, dal linguaggio utilizzato nella documentazione RFP o dal linguaggio utilizzato in prodotti di terze parti a cui si fa riferimento. Scopri di più sul modo in cui Cisco utilizza il linguaggio inclusivo.
Cisco ha tradotto questo documento utilizzando una combinazione di tecnologie automatiche e umane per offrire ai nostri utenti in tutto il mondo contenuti di supporto nella propria lingua. Si noti che anche la migliore traduzione automatica non sarà mai accurata come quella fornita da un traduttore professionista. Cisco Systems, Inc. non si assume alcuna responsabilità per l’accuratezza di queste traduzioni e consiglia di consultare sempre il documento originale in inglese (disponibile al link fornito).
In questo documento viene descritto come implementare la soluzione alternativa per i problemi di riavvio del pool di dispositivi (pod) (pgpool) di Subscriber Microservices Infrastructure (SMI) Common Execution Environment (CEE).
Cisco raccomanda la conoscenza dei seguenti argomenti:
Le informazioni fornite in questo documento si basano sulle seguenti versioni software e hardware:
Le informazioni discusse in questo documento fanno riferimento a dispositivi usati in uno specifico ambiente di emulazione. Su tutti i dispositivi menzionati nel documento la configurazione è stata ripristinata ai valori predefiniti. Se la rete è operativa, valutare attentamente eventuali conseguenze derivanti dall'uso dei comandi.
Cisco SMI è uno stack a più livelli di tecnologie e standard cloud che abilitano applicazioni basate su microservizi provenienti dalle unità aziendali Cisco Mobility, Cable e Broadband Network Gateway (BNG) - tutte con funzioni di gestione degli abbonati e requisiti simili per i datastore.
Gli attributi sono:
CEE è una soluzione software sviluppata per monitorare le applicazioni mobili e via cavo installate sull'interfaccia SMI. La CEE acquisisce le informazioni (metriche chiave) dalle applicazioni in modo centralizzato per consentire ai tecnici di eseguire il debug e risolvere i problemi.
CEE è l'insieme di strumenti comuni installati per tutte le applicazioni. È dotato di un centro operativo dedicato, che fornisce l'interfaccia utente (CLI) e le API per gestire gli strumenti di monitoraggio. Per ogni cluster è disponibile un solo CEE.
Un POD è un processo eseguito sul cluster Kubernetes. Il POD incapsula un'unità granulare nota come contenitore. Un POD contiene uno o più contenitori.
Kubernetes distribuisce uno o più POD su un singolo nodo che può essere una macchina fisica o virtuale. Ogni POD ha un'identità discreta con un indirizzo IP interno e uno spazio di porta. Tuttavia, i contenitori all'interno di un POD possono condividere le risorse di storage e di rete. CEE dispone di numerosi POD con funzioni univoche. Pgpool e postgress sono tra diversi POD CEE.
Pgpool gestisce il pool di risorse Postgres per la connessione, la replica, il bilanciamento del carico e così via. Pgpool è un middleware che funziona tra i server PostgreSQL e un database PostgreSQL.
Postgres supporta il database SQL (Structured Query Language) con ridondanza per memorizzare gli avvisi e i dashboard Grafana.
I POD pgpool vengono riavviati regolarmente mentre i POD postgresql vengono eseguiti senza problemi.
Per visualizzare gli avvisi, immettere questo comando:
show alerts active summary | include "POD_|k8s-pod-"
Di seguito è riportato un esempio di avviso della rete CEE.
[pod-name-smf-data/podname] cee# show alerts active summary | include "POD_|k8s-pod-" k8s-pod-crashing-loop 1d9d2b113073 critical 12-15T21:47:39 pod-name-smf-data-mas
Pod cee-podname/grafana-65cbdb9846-krgfq (grafana) is restarting 1.03 times / 5 minutes. POD_Restarted 04d42efb81de major 12-15T21:45:44 pgpool-67f48f6565-vjt Container=
k8s_pgpool_pgpool-67f48f6565-vjttd_cee-podname_a9f68607-eac4-40a9-86ef-db8176e0a22a_1474 of pod= pgpool-... POD_Restarted f7657a0505c2 major 12-15T21:45:44 postgres-0 Container=
k8s_postgres_postgres-0_cee-podname_59e0a768-6870-4550-8db3-32e2ab047ce2_1385 of pod= postgres-0 in name... POD_Restarted 6e57ae945677 major 12-15T21:45:44 alert-logger-d96644d4 Container=
k8s_alert-logger_alert-logger-d96644d4-dsc8h_cee-podname_2143c464-068a-418e-b5dd-ce1075b9360e_2421 of po... k8s-pod-crashing-loop 5b8e6a207aad critical 12-15T21:45:09 pod-name-smf-data-mas Pod
cee-podname/pgpool-67f48f6565-vjttd (pgpool) is restarting 1.03 times / 5 minutes. POD_Down 45a6b9bf73dc major 12-15T20:30:44 pgpool-67f48f6565-qbw Pod= pgpool-67f48f6565-qbw52 in namespace=
cee-podname is DOWN for more than 15min POD_Down 4857f398a0ca major 12-15T16:40:44 pgpool-67f48f6565-vjt Pod= pgpool-67f48f6565-vjttd in namespace=
cee-podname is DOWN for more than 15min k8s-pod-not-ready fc65254c2639 critical 12-11T21:07:29 pgpool-67f48f6565-qbw Pod
cee-podname/pgpool-67f48f6565-qbw52 has been in a non-ready state for longer than 1 minute. k8s-pod-not-ready 008b859e7333 critical 12-11T16:35:49 pgpool-67f48f6565-vjt Pod
cee-podname/pgpool-67f48f6565-vjttd has been in a non-ready state for longer than 1 minute.
Dal master Kubernetes, immettere questo comando:
kubectl describe pods -npostgres-0"
Di seguito è riportato l'output di esempio della descrizione POD. L'output viene troncato.
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 14m default-scheduler Successfully assigned cee-pod-name-l1/postgres-2
to pod-name-master-3
Normal Pulling 14m kubelet Pulling image "docker.10.192.x.x.nip.io/cee-2020.02.2.i38/
smi-libraries/postgresql/2020.02.2/postgres:1.3.0-946d87d"
Normal Pulled 13m kubelet Successfully pulled image "docker.10.192.x.x.nip.io/cee-2020.02.2.i38/
smi-libraries/postgresql/2020.02.2/postgres:1.3.0-946d87d" in 29.048094722s
Warning Unhealthy 12m kubelet Readiness probe failed: [bin][h][ir] >>> [2021-10-11 18:09:48]
pod is not ready
Warning Unhealthy 10m kubelet Readiness probe failed: [bin][h][ir] >>> [2021-10-11 18:11:18]
pod is not ready
Warning Unhealthy 10m kubelet Readiness probe failed: [bin][h][ir] >>> [2021-10-11 18:11:48]
pod is not ready
Warning Unhealthy 9m49s kubelet Readiness probe failed: [bin][h][ir] >>> [2021-10-11 18:12:18]
pod is not ready
Warning Unhealthy 9m19s kubelet Readiness probe failed: [bin][h][ir] >>> [2021-10-11 18:12:48]
pod is not ready
Warning Unhealthy 8m49s kubelet Readiness probe failed: [bin][h][ir] >>> [2021-10-11 18:13:18]
pod is not ready
Warning Unhealthy 8m19s kubelet Readiness probe failed: [bin][h][ir] >>> [2021-10-11 18:13:48]
pod is not ready
Warning Unhealthy 7m49s kubelet Readiness probe failed: [bin][h][ir] >>> [2021-10-11 18:14:18]
pod is not ready
Warning Unhealthy 7m19s kubelet Readiness probe failed: [bin][h][ir] >>> [2021-10-11 18:14:48]
pod is not ready
Warning BackOff 6m44s kubelet Back-off restarting failed container
O
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Warning FailedScheduling 13m default-scheduler 0/5 nodes are available: 2 node(s)
didn't match Pod's node affinity/selector, 3 node(s) didn't find available persistent
volumes to bind.
Normal Scheduled 13m default-scheduler Successfully assigned cee-pod-name-l1/postgres-0
to pod-name-master-1
Warning FailedScheduling 13m default-scheduler 0/5 nodes are available: 2 node(s)
didn't match Pod's node affinity/selector, 3 node(s) didn't find available
persistent volumes to bind.
Normal Pulling 13m kubelet Pulling image "docker.10.192.x.x.nip.io/cee-2020.02.2.i38/
smi-libraries/postgresql/2020.02.2/postgres:1.3.0-946d87d"
Normal Pulled 12m kubelet Successfully pulled image "docker.10.192.x.x.nip.io/
cee-2020.02.2.i38/smi-libraries/postgresql/2020.02.2/postgres:1.3.0-946d87d"
in 43.011763302s
Warning Unhealthy 7m20s kubelet Liveness probe failed: [bin][h][imm] >>>
[2021-10-11 18:09:16] My name is pg-postgres-0
Nota: Questa procedura non causa tempi di inattività nell'applicazione.
Per arrestare il sistema, immettere i seguenti comandi da CEE:
[pod-name-smf-data/podname] cee#
[pod-name-smf-data/podname] cee# config terminal
Entering configuration mode terminal
[pod-name-smf-data/podname] cee(config)# system mode shutdown
[pod-name-smf-data/podname] cee(config)# commit
Commit complete.
Attendere che il sistema passi al 100%
Da master-vip, SSH su ciascuna delle VM master e rimuovere il contenuto di queste cartelle: /data/cee-podname/data-postgres-[0-2].
Master 1
cloud-user@pod-name-smf-data-master-1:~$ sudo rm -rf /data/cee-podname/data-postgres-0
Master 2
cloud-user@pod-name-smf-data-master-2:~$ sudo rm -rf /data/cee-podname/data-postgres-1
Master 3
cloud-user@pod-name-smf-data-master-3:~$ sudo rm -rf /data/cee-podname/data-postgres-2
Per ripristinare il CEE, immettere i seguenti comandi dal CEE:
[pod-name-smf-data/podname] cee#
[pod-name-smf-data/podname] cee# config terminal
Entering configuration mode terminal
[pod-name-smf-data/podname] cee(config)# system mode running
[pod-name-smf-data/podname] cee(config)# commit
Commit complete.
Aspettate che il sistema raggiunga il 100%.
Verificare Kubernetes dal master.
cloud-user@pod-name-smf-data-master-1:~$ kubectl get pods -A -o wide | egrep 'postgres|pgpool'
All pods should display up and running without any restarts
Per verificare che gli avvisi vengano cancellati dalla rete CEE, immettere questo comando:
show alerts active summary | include "POD_|k8s-pod-"
Inoltre, è possibile immettere questo comando per assicurarsi che vi siano un database master e due database in standby:
echo "0----------------------------------";kubectl exec -it postgres-0 -n $(kubectl get pods -A | grep postgres | awk '{print $1}' | head -1) -- /usr/local/bin/cluster/healthcheck/is_major_master.sh;echo "1-------------------------- --------";kubectl exec -it postgres-1 -n $(kubectl get pods -A | grep postgres | awk '{print $1}' | head -1) -- /usr/local/bin/cluster/healthcheck/is_major_master.sh;echo "2--------------- -------------------"; kubectl exec -it postgres-2 -n $(kubectl get pods -A | grep postgres | awk '{print $1}' | head -1) -- /usr/local/bin/cluster/healthcheck/is_major_master.sh;
L'output previsto del campione è:
cloud-user@pod-name-smf-data-master-1:~$ echo "0----------------------------------";kubectl
exec -it postgres-0 -n $(kubectl get pods -A | grep postgres | awk '{print $1}' | head -1)
-- /usr/local/bin/cluster/healthcheck/is_major_master.sh;echo "1--------------------------
--------";kubectl exec -it postgres-1 -n $(kubectl get pods -A | grep postgres | awk '{print $1}'
| head -1) -- /usr/local/bin/cluster/healthcheck/is_major_master.sh;echo "2---------------
-------------------"; kubectl exec -it postgres-2 -n $(kubectl get pods -A | grep postgres |
awk '{print $1}' | head -1) -- /usr/local/bin/cluster/healthcheck/is_major_master.sh;
0----------------------------------
[bin][h][imm] >>> [2021-12-15 22:05:18] My name is pg-postgres-0
[bin][h][imm] >>> My state is good.
[bin][h][imm] >>> I'm not a master, nothing else to do!
1----------------------------------
[bin][h][imm] >>> [2021-12-15 22:05:19] My name is pg-postgres-1
[bin][h][imm] >>> My state is good.
[bin][h][imm] >>> I think I'm master. Will ask my neighbors if they agree.
[bin][h][imm] >>> Will ask nodes from PARTNER_NODES list
[bin][h][imm] >>> Checking node pg-postgres-0
[bin][h][imm] >>>>>>>>> Count of references to potential master pg-postgres-1 is 1 now
[bin][h][imm] >>> Checking node pg-postgres-1
[bin][h][imm] >>> Checking node pg-postgres-2
[bin][h][imm] >>>>>>>>> Count of references to potential master pg-postgres-1 is 2 now
[bin][h][imm] >>> Potential masters got references:
[bin][h][imm] >>>>>> Node: pg-postgres-1, references: 2
[bin][h][imm] >>> I have 2/2 incoming reference[s]!
[bin][h][imm] >>>> 2 - Does anyone have more?
[bin][h][imm] >>> Yahoo! I'm real master...so I think!
2----------------------------------
[bin][h][imm] >>> [2021-12-15 22:05:21] My name is pg-postgres-2
[bin][h][imm] >>> My state is good.
[bin][h][imm] >>> I'm not a master, nothing else to do!
Revisione | Data di pubblicazione | Commenti |
---|---|---|
1.0 |
25-Jan-2022 |
Versione iniziale |