How to stop /start /status of PostgreSQL service
<linux_server>>:/postgresql_SW> psql --version
psql (PostgreSQL) 12.1pg_ctl status
<linux_server>>:/postgresql_SW>pg_ctl: server is running (PID: 16915)
/usr/pgsql-11/bin/postgres "-D" "/var/lib/pgsql/11/data"
<linux_server>>:/postgresql_SW> pg_ctl stop
waiting for server to shut down.... done
server stopped
<linux_server>>:/postgresql_SW> pg_ctl status
pg_ctl: no server running
<linux_server>>:/postgresql_SW> pg_ctl start
waiting for server to start....2021-09-13 13:16:43.724 UTC [24156] LOG: listening on IPv4 address "0.0.0.0", port 5432
2021-09-13 13:16:43.724 UTC [24156] LOG: listening on IPv6 address "::", port 5432
2021-09-13 13:16:43.725 UTC [24156] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2021-09-13 13:16:43.731 UTC [24156] LOG: listening on Unix socket "/tmp/.s.PGSQL.5432"
2021-09-13 13:16:43.747 UTC [24156] LOG: redirecting log output to logging collector process
2021-09-13 13:16:43.747 UTC [24156] HINT: Future log output will appear in directory "log".
done
server started
<linux_server>>:/postgresql_SW> pg_ctl -D /var/lib/pgsql/11/data stop
waiting for server to shut down.... done
server stopped
<linux_server>>:/postgresql_SW> pg_ctl -D /var/lib/pgsql/11/data status
pg_ctl: no server running
<linux_server>>:/postgresql_SW> pg_ctl -D /var/lib/pgsql/11/data start
waiting for server to start....2021-09-13 13:17:19.374 UTC [24204] LOG: listening on IPv4 address "0.0.0.0", port 5432
2021-09-13 13:17:19.374 UTC [24204] LOG: listening on IPv6 address "::", port 5432
2021-09-13 13:17:19.376 UTC [24204] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2021-09-13 13:17:19.381 UTC [24204] LOG: listening on Unix socket "/tmp/.s.PGSQL.5432"
2021-09-13 13:17:19.397 UTC [24204] LOG: redirecting log output to logging collector process
2021-09-13 13:17:19.397 UTC [24204] HINT: Future log output will appear in directory "log".
done
server started
No comments:
Post a Comment