설정파일을 편집기로 열고 max_connections의 수치를 늘려준다.
[root@localhost data]# pwd
/var/lib/pgsql/16/data
[root@localhost data]# ll
합계 68
-rw-------. 1 postgres postgres 3 7월 30 14:13 PG_VERSION
drwx------. 5 postgres postgres 33 7월 30 14:13 base
-rw-------. 1 postgres postgres 30 7월 30 14:20 current_logfiles
drwx------. 2 postgres postgres 4096 7월 30 14:21 global
drwx------. 2 postgres postgres 32 7월 30 14:14 log
drwx------. 2 postgres postgres 6 7월 30 14:13 pg_commit_ts
drwx------. 2 postgres postgres 6 7월 30 14:13 pg_dynshmem
-rw-------. 1 postgres postgres 5527 7월 30 14:20 pg_hba.conf
-rw-------. 1 postgres postgres 2640 7월 30 14:13 pg_ident.conf
drwx------. 4 postgres postgres 68 7월 30 14:25 pg_logical
drwx------. 4 postgres postgres 36 7월 30 14:13 pg_multixact
drwx------. 2 postgres postgres 6 7월 30 14:13 pg_notify
drwx------. 2 postgres postgres 6 7월 30 14:13 pg_replslot
drwx------. 2 postgres postgres 6 7월 30 14:13 pg_serial
drwx------. 2 postgres postgres 6 7월 30 14:13 pg_snapshots
drwx------. 2 postgres postgres 6 7월 30 14:20 pg_stat
drwx------. 2 postgres postgres 6 7월 30 14:13 pg_stat_tmp
drwx------. 2 postgres postgres 18 7월 30 14:13 pg_subtrans
drwx------. 2 postgres postgres 6 7월 30 14:13 pg_tblspc
drwx------. 2 postgres postgres 6 7월 30 14:13 pg_twophase
drwx------. 3 postgres postgres 60 7월 30 14:13 pg_wal
drwx------. 2 postgres postgres 18 7월 30 14:13 pg_xact
-rw-------. 1 postgres postgres 88 7월 30 14:13 postgresql.auto.conf
-rw-------. 1 postgres postgres 29683 7월 30 14:16 postgresql.conf
-rw-------. 1 postgres postgres 58 7월 30 14:20 postmaster.opts
-rw-------. 1 postgres postgres 92 7월 30 14:20 postmaster.pid
[root@localhost data]# vi postgresql.conf
해당 항목 100 -> 1000 변경
max_connections = 1000
* 꿀팁!
vi 편집기에서 ESC누르고 /치고 원하는 글자 입력하고 엔터치면 검색됨
재시작 필수
[postgres@localhost data]$ systemctl stop postgresql-16.service
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ====
'postgresql-16.service' 서비스 유닛을 멈추려면 인증이 필요합니다.
Authenticating as: jmpark
Password:
==== AUTHENTICATION COMPLETE ====
[postgres@localhost data]$ systemctl start postgresql-16.service
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ====
'postgresql-16.service' 서비스 유닛을 시작하려면 인증이 필요합니다.
Authenticating as: jmpark
Password:
==== AUTHENTICATION COMPLETE ====
[postgres@localhost data]$ systemctl status postgresql-16.service
● postgresql-16.service - PostgreSQL 16 database server
Loaded: loaded (/usr/lib/systemd/system/postgresql-16.service; enabled; vendor preset: disabled)
Active: active (running) since Wed 2024-07-31 22:10:03 EDT; 6s ago
Docs: https://www.postgresql.org/docs/16/static/
Process: 22720 ExecStartPre=/usr/pgsql-16/bin/postgresql-16-check-db-dir ${PGDATA} (code=exited, status=0/SUCCESS)
Main PID: 22725 (postgres)
Tasks: 7 (limit: 22875)
Memory: 46.2M
CGroup: /system.slice/postgresql-16.service
├─22725 /usr/pgsql-16/bin/postgres -D /var/lib/pgsql/16/data/
├─22727 postgres: logger
├─22728 postgres: checkpointer
├─22729 postgres: background writer
├─22731 postgres: walwriter
├─22732 postgres: autovacuum launcher
└─22733 postgres: logical replication launcher