2021.04.11
1. PostgreSQL 파라미터 값 수정
a. 수정 할 configmap 찾기
$ k get configmaps -n pgo | egrep 'NAME|-pgha-config'
NAME DATA AGE
gmd-prd-pgha-config 4 15d
$
b. 파라미터 수정하기
$ k edit configmaps gmd-prd-pgha-config -n pgo
apiVersion: v1
data:
gmd-prd-dcs-config: |
postgresql:
parameters:
archive_command: source /opt/cpm/bin/pgbackrest/pgbackrest-set-env.sh && pgbackrest
archive-push "%p"
archive_mode: true
…
max_connections: 200 # Appended this line
shared_buffers: 128MB
…
c. 수정한 파라미터 적용하기
$ pgo show cluster --all | head -n 6
cluster : gmd-prd (crunchy-postgres-ha:centos7-11.9-4.4.1)
pod : gmd-prd-6968599947-kzwjp (Running) on gmd02 (2/2) (replica)
pvc: gmd-prd (500Gi)
pod : gmd-prd-mpnr-5f4754cd85-f6vhk (Running) on gmd01 (2/2) (primary)
pvc: gmd-prd-mpnr (500Gi)
$ k rollout restart deployments gmd-prd -n pgo
deployment.apps/gmd-prd-mpnr restarted
$ k rollout restart deployments gmd-prd -n pgo
deployment.apps/gmd-prd restarted
$
$ pgo show cluster --all | head -n 6
cluster : gmd-prd (crunchy-postgres-ha:centos7-11.9-4.4.1)
pod : gmd-prd-6968599947-kzwjp (Running) on gmd02 (2/2) (primary)
pvc: gmd-prd (500Gi)
pod : gmd-prd-mpnr-9968b865b-9w75p (Running) on gmd01 (2/2) (replica)
pvc: gmd-prd-mpnr (500Gi)
[admin1@gmd01 ~]$ k exec gmd-prd-6968599947-kzwjp -n pgo -it -- psql -c "SHOW max_connections"
max_connections
-----------------
200
(1 row)
$ k exec gmd-prd-mpnr-9968b865b-9w75p -n pgo -it -- psql -c "SHOW max_connections"
max_connections
-----------------
200
(1 row)
$ k exec gmd-prd-6968599947-kzwjp -c database -n pgo -it -- grep max_connections /pgdata/gmd-prd/postgresql.conf
max_connections = '200'
$
'Kubernetes > DBMS' 카테고리의 다른 글
MariaDB - replication (0) | 2021.10.29 |
---|---|
MariaDB (0) | 2021.10.04 |
Crunchy PostgreSQL Operator #2 (0) | 2021.09.23 |
Crunchy PostgreSQL Operator #1 (0) | 2021.09.23 |
댓글