【www.bbyears.com--PostgreSQL】
service 启动方式
# For example, if you want to change the server"s port number to 5433,
# create a file named "/etc/systemd/system/postgresql.service" containing:
# .include /lib/systemd/system/postgresql.service
# [Service]
# Environment=PGPORT=5433
# This will override the setting appearing below.
sudo vim /etc/systemd/system/postgresql.service
按照这个官方说明改好以后, 发现....
根本没有作用.还是用 5432 启动的
直接修改吧.蛋疼
sudo vim /lib/systemd/system/postgresql.service
然后重新加载
sudo systemctl daemon-reload
于是....
启动不起来了
postgresql.service - PostgreSQL database server
Loaded: loaded (/etc/systemd/system/postgresql.service; enabled)
Active: failed (Result: exit-code) since 二 2015-03-03 19:06:19 CST; 9s ago
Process: 8305 ExecStop=/usr/bin/pg_ctl stop -D ${PGDATA} -s -m fast (code=exited, status=0/SUCCESS)
Process: 8359 ExecStart=/usr/bin/pg_ctl start -D ${PGDATA} -s -o -p ${PGPORT} -w -t 300 (code=exited, status=1/FAILURE)
Process: 8353 ExecStartPre=/usr/bin/postgresql-check-db-dir ${PGDATA} (code=exited, status=0/SUCCESS)
Main PID: 32289 (code=exited, status=0/SUCCESS)
这不是蛋疼,这是蛋碎了
改回去,还是启动不能.估计增加了/etc下的文件后, 还要再执行一次 reload
好吧.那我把/etc...的文件端口改回去
于是可以启动了..尼玛!!
不玩了,我用原始方式启动吧
pg_ctl -D /var/lib/pgsql/data -p 5433 -l logfile start