官网:https://konghq.com/

各种方式安装汇总:https://konghq.com/install/

命令列表:https://docs.konghq.com/0.14.x/admin-api/

官方插件列表:https://docs.konghq.com/hub/

相关学习笔记链接:https://www.lijiaocn.com/%E9%A1%B9%E7%9B%AE/2018/09/29/nginx-openresty-kong.html

相关博客:https://www.itcodemonkey.com/article/5980.html

Kong集群搭建博客:https://www.cnblogs.com/zhoujie/p/kong6.html

github:https://github.com/Kong

可视化程序dashboard github:https://github.com/PGBI/kong-dashboard

缓存插件github:https://github.com/globocom/kong-plugin-proxy-cache

kong配置文件默认地址:/etc/kong/kong.conf

kong插件默认地址:/usr/local/share/lua/5.1/kong/plugins

添加新插件时安装后需要在kong.conf中配置引入,proxy-cache插件安装前需要 luarocks install lua-resty-redis-connector

构建包含响应缓存插件的docker包:

Dockerfile:

From kong:latest

RUN apk update
RUN apk add git
RUN luarocks install lua-resty-redis-connector
RUN luarocks install kong-plugin-proxy-cache
RUN cp /etc/kong/kong.conf.default /etc/kong/kong.conf
RUN echo "plugins = bundled, proxy-cache" >> /etc/kong/kong.conf EXPOSE 8000 8001 8443 8444
docker build -t custom-kong .

导出image:

docker save > kong.tar custom-kong:latest

导入image:

docker load < kong.tar

Kong集群(完全无状态):

主节点启动(与数据库在一个docker network):

docker run -d --name kong \
--network=kong-net \
-e "KONG_DATABASE=postgres" \
-e "KONG_PG_HOST=kong-database" \
-e "KONG_PROXY_ACCESS_LOG=/dev/stdout" \
-e "KONG_ADMIN_ACCESS_LOG=/dev/stdout" \
-e "KONG_PROXY_ERROR_LOG=/dev/stderr" \
-e "KONG_ADMIN_ERROR_LOG=/dev/stderr" \
-e "KONG_ADMIN_LISTEN=0.0.0.0:8001, 0.0.0.0:8444 ssl" \
-p : \
-p : \
-p : \
-p : \
custom-kong:latest

其他节点:

docker run -d --name kong \
-e "KONG_DATABASE=postgres" \
-e "KONG_PG_HOST=10.95.55.185" \
-e "KONG_PROXY_ACCESS_LOG=/dev/stdout" \
-e "KONG_ADMIN_ACCESS_LOG=/dev/stdout" \
-e "KONG_PROXY_ERROR_LOG=/dev/stderr" \
-e "KONG_ADMIN_ERROR_LOG=/dev/stderr" \
-e "KONG_ADMIN_LISTEN=0.0.0.0:8001, 0.0.0.0:8444 ssl" \
-p : \
-p : \
-p : \
-p : \
custom-kong:latest

Kong集群前负载均衡nginx配置:

配置文件地址:/etc/nginx/nginx.conf

# include /...

upstream kongs {
server xx:xx:xx:xx:xx weight=;
server xx:xx:xx:xx:xx weight=;
}
# 修改http的请求头为源请求头
proxy_set_header Host $http_host;
proxy_set_header X-Forward-For $remote_addr; # 修改hearder支持加"_"
underscores_in_headers on; 
server {
listen ;
server_name kongs;
location / {
proxy_pass http://kongs;
}
}

最新文章

  1. linux Mint18 backspace怎么不能连续删除
  2. 每天进步一点点——五分钟理解一致性哈希算法(consistent hashing)
  3. CAS学习笔记(一)
  4. MFCC可视化
  5. UITableView表视图以及重建机制
  6. Art Gallery - POJ 1279(求内核面积)
  7. HDOJ/HDU 1088 Write a simple HTML Browser(HTML字符串)
  8. SDWebImage 原理及使用
  9. 采用openFileOutput获取输出流
  10. CRC8反转校验
  11. spring程序打包使用该插件,不然容易报错xsd找不到
  12. JS中的算法与数据结构——排序(Sort)
  13. 程序员、互联网从业者必读KK三大力作之《必然》总结
  14. Jquery对于input事件的处理
  15. Android开发点点滴滴——一些基础的但实用的知识(2)
  16. 转载【TP3.2】:使用PHP生成二维码
  17. Oracle:create pfile from spfile:rac下要小心该操作啊!
  18. STM32的操作过程,寄存器配置与调试过程(转载)
  19. java线程-java多线程之可见性
  20. python字典的常用操作

热门文章

  1. OracleXE 11g user莫名过期
  2. Python笔记_第四篇_高阶编程_GUI编程之Tkinter_6.附录
  3. memset为int型数组初始化问题
  4. c语言中对字段宽度的理解?
  5. 用PrintStream向文件输入内容
  6. 大言不惭 swank? talk about sth or speak too confidently
  7. DOM(Document Object Model)
  8. redis中间件
  9. SPACESNIFFER查看文件大小
  10. JavaScript 的DOM操作及实例