User Tools

Site Tools


сервис_postgresql

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
сервис_postgresql [2025/05/12 14:49]
val [pg_restore]
сервис_postgresql [2025/05/13 20:52] (current)
val [CloudNativePG Recovery]
Line 144: Line 144:
  
 keycloak=# \d user_entity keycloak=# \d user_entity
 +
 +keycloak=# SELECT id, username FROM user_entity;​
  
 keycloak=# SELECT * FROM user_entity WHERE username='​admin';​ keycloak=# SELECT * FROM user_entity WHERE username='​admin';​
Line 217: Line 219:
 ===== Потоковая репликация ===== ===== Потоковая репликация =====
  
-  * [[https://prudnitskiy.pro/ru/post/2018-01-05-pgsql-replica/|Потоковая репликация в PostgreSQL ​– короткое введение]]+  * [[https://selectel.ru/blog/​tutorials/how-to-set-up-replication-in-postgresql/|Как настроить ​репликацию в PostgreSQL]]
  
 ===== Резервное копирование и восстановление ===== ===== Резервное копирование и восстановление =====
Line 255: Line 257:
 kube1:~# kubectl -n my-postgres-ns exec -ti pod/​my-postgres-postgresql-0 -- env PGPASSWORD="​strongpassword"​ psql -U postgres -c "​CREATE USER keycloak WITH PASSWORD '​strongpassword';"​ kube1:~# kubectl -n my-postgres-ns exec -ti pod/​my-postgres-postgresql-0 -- env PGPASSWORD="​strongpassword"​ psql -U postgres -c "​CREATE USER keycloak WITH PASSWORD '​strongpassword';"​
  
-kube1:~# ssh gate cat /​tmp/​keycloak.dump | kubectl -n my-postgres-ns exec -i pod/​my-postgres-postgresql-0 -- env PGPASSWORD="​strongpassword"​ pg_restore -C -d postgres -U postgres+kube1:~# ssh gate.corp13.un ​cat /​tmp/​keycloak.dump | kubectl -n my-postgres-ns exec -i pod/​my-postgres-postgresql-0 -- env PGPASSWORD="​strongpassword"​ pg_restore -C -d postgres -U postgres
 </​code>​ </​code>​
  
Line 335: Line 337:
 kube1:​~/​my-pgcluster#​ kubectl -n my-pgcluster-ns apply -f my-scheduled-backup.yaml kube1:​~/​my-pgcluster#​ kubectl -n my-pgcluster-ns apply -f my-scheduled-backup.yaml
  
-kube1# kubectl -n my-pgcluster-ns describe ​backup ​my-scheduled-backup+kube1# kubectl -n my-pgcluster-ns describe ​backups.postgresql.cnpg.io ​my-scheduled-backup
  
-kube1# kubectl -n my-pgcluster-ns get backup+kube1# kubectl -n my-pgcluster-ns get backups.postgresql.cnpg.io
 </​code>​ </​code>​
  
Line 345: Line 347:
  
 <​code>​ <​code>​
-kube1:~/my-pgcluster#​ kubectl -n my-pgcluster-ns create secret generic minio-secret \+kube1:~# kubectl create ns my-pgcluster-ns 
 + 
 +kube1:~# kubectl -n my-pgcluster-ns create secret generic minio-secret \
   --from-literal=ACCESS_KEY_ID=root \   --from-literal=ACCESS_KEY_ID=root \
   --from-literal=ACCESS_SECRET_KEY=strongpassword   --from-literal=ACCESS_SECRET_KEY=strongpassword
сервис_postgresql.1747050595.txt.gz · Last modified: 2025/05/12 14:49 by val