Postgreslq service active but stopped
Postgreslq service active but stopped
Use
sudo systemctl status 'postgresql*'
to see the status of all PostgreSQL services.root@server:~# sudo systemctl status 'postgresql*'
● postgresql@15-main.service - PostgreSQL Cluster 15-main
Loaded: loaded (/lib/systemd/system/postgresql@.service; enabled-runtime; vendor preset: enabled)
Active: failed (Result: exit-code) since Sat 2022-12-03 09:05:57 CET; 1h 32min ago
Process: 564654 ExecStart=/usr/bin/pg_ctlcluster --skip-systemctl-redirect 15-main start (code=exited, status=0/SUC> Process: 574148 ExecStop=/usr/bin/pg_ctlcluster --skip-systemctl-redirect -m fast 15-main stop (code=exited, status> Main PID: 564678 (code=exited, status=0/SUCCESS)
Dec 03 09:05:57 server.cloudhostingus.com crontab[574088]: (postgres) LIST (postgres)
Dec 03 09:05:57 server.cloudhostingus.com crontab[574091]: (postgres) LIST (postgres)
Dec 03 09:05:57 server.cloudhostingus.com crontab[574094]: (postgres) LIST (postgres)
Dec 03 09:05:57 server.cloudhostingus.com crontab[574097]: (postgres) LIST (postgres)
Dec 03 09:05:57 server.cloudhostingus.com crontab[574100]: (postgres) LIST (postgres)
Dec 03 09:05:57 server.cloudhostingus.com crontab[574129]: (postgres) REPLACE (postgres)
Dec 03 09:05:57 server.cloudhostingus.com crontab[574135]: (postgres) REPLACE (postgres)
Dec 03 09:05:57 server.cloudhostingus.com postgresql@15-main[574148]: Cluster is not running.
Dec 03 09:05:57 server.cloudhostingus.com systemd[1]: postgresql@15-main.service: Control process exited, code=exited, >Dec 03 09:05:57 server.cloudhostingus.com systemd[1]: postgresql@15-main.service: Failed with result 'exit-code'.
● postgresql@12-main.service - PostgreSQL Cluster 12-main
Loaded: loaded (/lib/systemd/system/postgresql@.service; enabled-runtime; vendor preset: enabled)
Active: failed (Result: protocol) since Sat 2022-12-03 08:16:56 CET; 2h 21min ago
Process: 564653 ExecStart=/usr/bin/pg_ctlcluster --skip-systemctl-redirect 12-main start (code=exited, status=1/FAI>
Dec 03 08:16:56 server.cloudhostingus.com postgresql@12-main[564653]: 2022-12-03 08:16:56.325 CET [564677] LOG: could >Dec 03 08:16:56 server.cloudhostingus.com postgresql@12-main[564653]: 2022-12-03 08:16:56.325 CET [564677] HINT: Is an>Dec 03 08:16:56 server.cloudhostingus.com postgresql@12-main[564653]: 2022-12-03 08:16:56.325 CET [564677] WARNING: co>Dec 03 08:16:56 server.cloudhostingus.com postgresql@12-main[564653]: 2022-12-03 08:16:56.325 CET [564677] FATAL: coul>Dec 03 08:16:56 server.cloudhostingus.com postgresql@12-main[564653]: 2022-12-03 08:16:56.325 CET [564677] LOG: databa>Dec 03 08:16:56 server.cloudhostingus.com postgresql@12-main[564653]: pg_ctl: could not start server
lines 1-29...skipping...
● postgresql@15-main.service - PostgreSQL Cluster 15-main
Loaded: loaded (/lib/systemd/system/postgresql@.service; enabled-runtime; vendor preset: enabled)
Active: failed (Result: exit-code) since Sat 2022-12-03 09:05:57 CET; 1h 32min ago
Process: 564654 ExecStart=/usr/bin/pg_ctlcluster --skip-systemctl-redirect 15-main start (code=exited, status=0/SUCCESS)
Process: 574148 ExecStop=/usr/bin/pg_ctlcluster --skip-systemctl-redirect -m fast 15-main stop (code=exited, status=2)
Main PID: 564678 (code=exited, status=0/SUCCESS)
root@server:~# systemctl stop postgresql@12-main.service
root@server:~# systemctl status postgresql@15-main.service
root@server:~# systemctl status postgresql@15-main.service
● postgresql@15-main.service - PostgreSQL Cluster 15-main
Loaded: loaded (/lib/systemd/system/postgresql@.service; enabled-runtime; vendor preset: enabled)
Active: active (running) since Sat 2022-12-03 10:45:07 CET; 1s ago
Process: 591031 ExecStart=/usr/bin/pg_ctlcluster --skip-systemctl-redirect 15-main start (code=exited, status=0/SUCCESS)
Main PID: 591045 (postgres)
Tasks: 6 (limit: 9479)
Memory: 34.0M
CGroup: /system.slice/system-postgresql.slice/postgresql@15-main.service
├─591045 /usr/lib/postgresql/15/bin/postgres -D /var/lib/postgresql/15/main -c config_file=/etc/postgresql/15/main/postgresql.conf
├─591046 postgres: 15/main: checkpointer
├─591047 postgres: 15/main: background writer
├─591049 postgres: 15/main: walwriter
├─591050 postgres: 15/main: autovacuum launcher
└─591051 postgres: 15/main: logical replication launcher
Dec 03 10:45:05 server.cloudhostingus.com systemd[1]: Starting PostgreSQL Cluster 15-main...
Dec 03 10:45:07 server.cloudhostingus.com systemd[1]: Started PostgreSQL Cluster 15-main.
I was having both 12 and 15 so i stoped 12 and enabled 15 only
root@server:~# systemctl disable postgresql@12-main.service
root@server:~# systemctl enable postgresql@15-main.service
Created symlink /etc/systemd/system/multi-user.target.wants/postgresql@15-main.service → /lib/systemd/system/postgresql@.service.
Comments
Post a Comment