Postgre安装
官网
rpm方式安装
https://yum.postgresql.org/rpmchart.php
postgresql11-11.4-1PGDG.rhel7.x86_64.rpm
postgresql11-contrib-11.4-1PGDG.rhel7.x86_64.rpm
postgresql11-libs-11.4-1PGDG.rhel7.x86_64.rpm
postgresql11-server-11.4-1PGDG.rhel7.x86_64.rpm
rpm -ivh postgresql11*
初始化DB
/usr/pgsql-11/bin/postgresql-11-setup initdb
or
postgresql-setup initdb
启动
systemctl enable postgresql-11
systemctl start postgresql-11
修改配置
cd /var/lib/pgsql/11/data
vi postgresql.conf
listen_addresses = '*'
vi pg_hba.conf
host all all 0.0.0.0/0 md5
添加名为kong的用户
useradd kong;
su - postgres
psql
CREATE USER kong; CREATE DATABASE kong OWNER kong;
CREATE USER kong WITH PASSWORD '123456';
psql -U kong -d kong -h 127.0.0.1 -p 5432
Kong安装
Kong官网
参考文档
https://docs.konghq.com/install/centos/?_ga=2.146470708.1859714253.1563239338-1792454818.1563239338
RPM方式安装
rpm -ivh kong-1.2.1.el7.noarch.rpm
配置
cp /etc/kong/kong.conf.defaul /etc/kong/kong.conf
vi /etc/kong/kong.conf
database = postgres # Determines which of PostgreSQL or Cassandra
pg_host = 127.0.0.1 # The PostgreSQL host to connect to.
pg_port = 5432 # The port to connect to.
pg_user = kong # The username to authenticate if required.
pg_password = 123456 # The password to authenticate if required.
pg_database = kong # The database name to connect to.
pg_ssl = off # Toggles client-server TLS connections
pg_ssl_verify = off # Toggles server certificate verification if
初始化
kong migrations bootstrap -c /etc/kong/kong.conf
kong start /etc/kong/kong.conf
测试
curl -i http://localhost:8001/
GUI
Kong Admin GUI
https://docs.konghq.com/enterprise/0.31-x/admin-gui/