kong数据库postgre centos安装一条龙


安装版本可以参考kong.conf PostgreSQL版本,这里要求9.5以上 安装rpm文件 #yum install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm 安装客户端 #yum install postgresql10 安装服务端 #yum install postgresql10-server 初始化 #/usr/pgsql-10/bin/postgresql-10-setup initdb 设置自动启动并且启动postgresql服务 #systemctl enable postgresql-10 #systemctl start postgresql-10 默认安装在/var/lib/pgsql/10 默认会创建一个数据库用户 #su postgres #psql 创建kong默认用户和数据库 CREATE USER kong WITH PASSWORD '123456'; CREATE DATABASE kong OWNER kong; grant all privileges on database kong to kong; // 授权 查询刚刚创建的用户 select * from pg_user; 退出命令 #\quit 修改kong.conf配置连接数据库 导入kong数据库到 #kong migrations bootstrap 如果报错:postgresql的一个配置文件pg_hba.conf中没有信任该服务器ip导致报错 Ident authentication failed for user 修改pg_hba.conf配置文件相应的地方,将其改为trust 默认不允许远程连接5432端口只能本机连,远程需要打开; #vim /var/lib/pgsql/10/data/postgresql.conf listen_addresses = '*' 找到并修改