Kong 部署 - 网关API安装部署以及应用 docker API postgres


https://docs.konghq.com/

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

https://github.com/PGBI/kong-dashboard

https://blog.csdn.net/forezp/article/details/79383631

http://blog.51cto.com/xinsir/2058768

https://blog.csdn.net/freewebsys/article/details/80428830

https://blog.csdn.net/li396864285/article/details/77371385

http://cloud.51cto.com/art/201808/580228.htm

https://blog.csdn.net/qq_34463875/article/details/77866072

https://www.jb51.net/article/161408.htm

https://hub.docker.com/r/pantsel/konga


# 编译安装kong

https://abc.htmltoo.com/thread-46021.htm


应用: monitor -> 添加服务: kong

镜像: debian:stretch

卷:

/data/file:/data/file

/data/docker/tools/kong/kong.conf:/etc/kong/kong.conf:ro

端口:8001

保存ip: 升级或替换 不变

主机名: 使用容器名称


vi   /data/docker/tools/kong/kong.conf

database = postgres             # Determines which of PostgreSQL or Cassandra
pg_host = 105.domsn.com             # Host of the Postgres server.
pg_port = 5432                  # Port of the Postgres server.
pg_timeout = 5000               # Defines the timeout (in ms), for connecting,
pg_user = root                  # Postgres user.
pg_password = wdqdmm@p                # Postgres user's password.
pg_database = kong              # The database name to connect to.


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

#进入kong-debian9系统后,继续安装:
cd /data/file/
wget kong-1.4.0.stretch.amd64.deb
apt-get update
apt-get install openssl libpcre3 procps perl
dpkg -i kong-1.4.0.stretch.amd64.deb
kong migrations bootstrap  [-c /etc/kong/kong.conf]
kong config init
kong start [-c /etc/kong/kong.conf]
curl -i http://localhost:8001/
kong  stop
kong  reload


kong migrations up               # kong 迁移

kong start [-c /path/to/kong.conf]  # kong 开启

kong stop # 关闭

kong reload # 重加载


kong的监听端口:

8000: API请求的代理层。

8001: restful的配置管理API。

8443: 代理HTTPS

7946: 用于和其他Kong节点通讯,支持TCP/UDP流量

7373: 用于本地集群代理通讯


#应用: monitor -> 添加服务: kong-dashboard

镜像: pgbi/kong-dashboard:latest 

命令: start --kong-url http://kong:8001 --basic-auth ihunter=wdqdmm@0

卷:

/data/file:/data/file

端口:8087(http)-8080

保存ip: 升级或替换 不变

主机名: 使用容器名称


docker run -p 1337:1337 \

     --network kong-net \

     -e "TOKEN_SECRET=mark666" \

     -e "DB_ADAPTER=postgres" \

     -e "DB_HOST=0.0.0.0" \ //注意你的ip,不是0.0.0.0或者127.0.0.1

     -e "DB_PORT=5432:5432" \

     -e "DB_USER=kong" \

     -e "DB_PASSWORD=kong" \

     -e "DB_DATABASE=kong_database" \

     --name konga \

     pantsel/konga


docker run -p 1337:1337 

          --network {{kong-network}} \ // optional

          -e "TOKEN_SECRET={{somerandomstring}}" \

          -e "DB_ADAPTER=the-name-of-the-adapter" \ // 'mongo','postgres','sqlserver'  or 'mysql'

          -e "DB_HOST=your-db-hostname" \

          -e "DB_PORT=your-db-port" \ // Defaults to the default db port

          -e "DB_USER=your-db-user" \ // Omit if not relevant

          -e "DB_PASSWORD=your-db-password" \ // Omit if not relevant

          -e "DB_DATABASE=your-db-name" \ // Defaults to 'konga_database'

          -e "DB_PG_SCHEMA=my-schema"\ // Optionally define a schema when integrating with prostgres

          -e "NODE_ENV=production" \ // or 'development' | defaults to 'development'

          --name konga \

          pantsel/konga:lastet




https://hub.docker.com/_/postgres  # PostgreSQL

https://hub.docker.com/_/kong   # kong
https://hub.docker.com/r/pgbi/kong-dashboard  # dashboard

https://hub.docker.com/r/pantsel/konga              # 

https://hub.docker.com/r/dpage/pgadmin4   # postgree gui的web界面 

https://getkong.org/docs/   # kong的文档


特点:

可扩展,支持分布式

模块化 功能:授权、日志、ip限制、限流、api 统计分析(存在商业插件Galileo等、也可自己研发)、请求转化、跨域(CORS)、其他功能通过lua编写插件实现


# 启动ui管理界面konga,

https://abc.htmltoo.com/thread-46022.htm


签名:这个人很懒,什么也没有留下!
最新回复 (0)
返回