u run initdb.
Success. You can now start the database server using:
pg_ctl -D /usr/local/pgsql-10.5/data -l logfile start
[postgres@web1 ~]$
***在此就已经部署成功了,现在要做的就是修改下配置文件,优化下***
17、前往文件安装所在地,修改pg_hba.conf配置文件
[postgres@web1 data]$ cp pg_hba.conf pg_hba.conf.`date +%F`
[postgres@web1 data]$ vim pg_hba.conf
#######################################
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
#host all all 127.0.0.1/32 trust
host all all 0.0.0.0/0 md5 #所有ip都可以通过密码连接
# IPv6 local connections:
host all all ::1/128 trust
# Allow replication connections from localhost, by a user with the
# replication privilege.
local replication all trust
host replication all 127.0.0.1/32 trust
######################################
18、前往文件安装所在地,修改postgresql.conf配置文件
[postgres@web1 data]$ cd /usr/local/pgsql/data/
[postgres@web1 data]$ cp postgresql.conf postgresql.conf.`date +%F`
[postgres@web1 data]$ vim postgresql.conf
#########################################
# - Connection Settings -
listen_addresses = '*' #为了方便,监听所有# what IP address(es) to listen on;
# comma-separated list of addresses;
# defaults to 'localhost'; use '*' for all
# (change requires restart)
#port = 5432 # (change requires restart)
max_connections = 100 # (change requires restart)
#superuser_reserved_connections = 3 # (change requires restart)
#unix_socket_directories = '/tmp' # comma-separated list of directories
# (change requires restart)
#unix_socket_group = '' # (change requires restart)
#unix_socket_permissions = 0777