2022PostgreSQL服务器启动及关闭方法PostgreSQL服务器启动及关闭方法PostgreSQL采纳C/S(客户机/服务器)模式结构
应用层通过INET或者UnixSocket利用既定的协议与数据库服务器进行通信
下面yjbys我为大家搜集相关的PostgreSQL服务器启动及关闭方法
启动数据库服务器(posgres用户):[postgres@localhostbin]$postgres-D/opt/postgresql/data/>/opt/postgresql/log/pg_server
log第1页共11页2>&1&[1]4508当然假如设置了环境变量PGDATA=/opt/postgresql/dataexportPGDATA后,可运用pg_ctl工具进行启动:[postgres@localhostlog]$pg_ctlstart-l/opt/postgresql/log/pg_server
logpg_ctl:anotherservermightberunning;tryingtostart第2页共11页serveranywaypg_ctl:couldnotstartserverExaminethelogoutput
[postgres@localhostlog]$因为之前已经启动,所以打印;anotherservermightberunning;
此时,查看日志,有如下信息:[postgres@localhostlog]$catpg_server
logFATAL:lockfile"postmaster
pid"alreadyexists第3页共11页HINT:Isanotherpostmaster(PID4491)runningindatadirectory"/opt/postgresql/data"
[postgres@localhostl