CentOs 7 kong 2.3.X oss 部署安装

PostgreSQL 9.6部署

参考:https://www.cnblogs.com/shhnwangjian/p/14680679.html

 

Kong 2.3.x部署

https://docs.konghq.com/install/centos/

1、添加RPM

https://bintray.com/kong/kong-rpm/download_file?file_path=centos/7/kong-2.3.3.el7.amd64.rpm

2、yum安装

yum install kong-2.3.3.el7.amd64.rpm --nogpgcheck

3、pg添加Kong账号

# 创建postgres数据库账号
su postgres
psql
CREATE USER kong; CREATE DATABASE kong OWNER kong;
ALTER USER kong WITH PASSWORD '123456';
\q

4、配置Kong DataSource

创建配置 cd /etc/kong;cp kong.conf.default kong.conf

vim /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.

5、迁移Kong (在数据库Kong中创建需要的表)

kong migrations bootstrap -c /etc/kong/kong.conf

6、启动kong

kong start -c /etc/kong/kong.conf

7、验证

curl -i http://localhost:8001/

 

Konga 0.14.9部署

https://github.com/pantsel/konga#installation

1、 镜像下载

docker pull pantsel/konga:0.14.9

2、创建pg库

su postgres
psql
CREATE DATABASE konga OWNER kong;
\q

3、初始化

docker run --rm pantsel/konga:0.14.9 -c prepare -a postgres -u postgresql://kong:密码@ip:5432/konga

4、启动

docker run -p 1337:1337 \
             -e "DB_ADAPTER=postgres" \
             -e "DB_URI=postgres://kong:密码@IP:5432/konga" \
             -e "NODE_ENV=production" \
             --name konga \
             pantsel/konga:0.14.9

  

posted @ 2021-04-20 13:44  shhnwangjian  阅读(452)  评论(0编辑  收藏  举报