下面來給各位介紹一個fedora 20 下 postgresql 修改端口的教程,希望此教程可以讓各位知道在fedora 20 下 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 --Vevb.com
- 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
新聞熱點
疑難解答