Kong部署
简介Kong是一个在Nginx中运行的Lua应用程序,可以通过lua-nginx模块实现,Kong不是用这个模块编译Nginx,而是与OpenRestry一起发布,OpenRestry已经包含了lua-nginx-module,OpenRestry是Nginx的一组扩展功能模块。
Kong可以支持很多平台的部署,如:
Docker部署
参考地址:https://docs.konghq.com/install/docker/?_ga=2.50698281.1814713303.1591591105-1505776667.1591591105
所有部署都来至于上面的文档。
1、创建Docker网络
[root@localhost ~]# docker network create kong-net
a8f4ae6901ab86c7f28298b5b0133bcf88116de5eb3d19ac2ba73604057ac76f
2、安装 PostgreSQL 数据库
[root@localhost ~]# docker run -d --name kong-database \
--network=kong-net \
-p 5432:5432 \
-e "POSTGRES_USER=kong" \
-e "POSTGRES_DB=kong" \
-e "POSTGRES_PASSWORD=kong" \
postgres:9.6
[root@localhost ~]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9f4ce11bad53 postgres:9.6 "docker-entrypoint.s…" About a minute ago Up About a minute 0.0.0.0:5432->5432/tcp kong-database
3、初始化数据库
[root@localhost ~]# docker run --rm \
--network=kong-net \
-e "KONG_DATABASE=postgres" \
-e "KONG_PG_HOST=kong-database" \
-e "KONG_PG_PASSWORD=kong" \
-e "KONG_CASSANDRA_CONTACT_POINTS=kong-database" \
kong:latest kong migrations bootstrap
Unable to find image 'kong:latest' locally
latest: Pulling from library/kong
cbdbe7a5bc2a: Already exists
79162f4c0961: Pull complete
362c162bd110: Pull complete
8e4da51840b6: Pull complete
Digest: sha256:32a09516a4fad6a7d42a90f7f754970555027a73e349b980a72c7120e00488b4
Status: Downloaded newer image for kong:latest
Bootstrapping database...
migrating core on database 'kong'...
core migrated up to: 000_base (executed)
core migrated up to: 003_100_to_110 (executed)
core migrated up to: 004_110_to_120 (executed)
core migrated up to: 005_120_to_130 (executed)
core migrated up to: 006_130_to_140 (executed)
core migrated up to: 007_140_to_150 (executed)
core migrated up to: 008_150_to_200 (executed)
migrating hmac-auth on database 'kong'...
hmac-auth migrated up to: 000_base_hmac_auth (executed)
hmac-auth migrated up to: 002_130_to_140 (executed)
migrating oauth2 on database 'kong'...
oauth2 migrated up to: 000_base_oauth2 (executed)
oauth2 migrated up to: 003_130_to_140 (executed)
migrating jwt on database 'kong'...
jwt migrated up to: 000_base_jwt (executed)
jwt migrated up to: 002_130_to_140 (executed)
migrating basic-auth on database 'kong'...
basic-auth migrated up to: 000_base_basic_auth (executed)
basic-auth migrated up to: 002_130_to_140 (executed)
migrating key-auth on database 'kong'...
key-auth migrated up to: 000_base_key_auth (executed)
key-auth migrated up to: 002_130_to_140 (executed)
migrating rate-limiting on database 'kong'...
rate-limiting migrated up to: 000_base_rate_limiting (executed)
rate-limiting migrated up to: 003_10_to_112 (executed)
migrating acl on database 'kong'...
acl migrated up to: 000_base_acl (executed)
acl migrated up to: 002_130_to_140 (executed)
migrating acme on database 'kong'...
acme migrated up to: 000_base_acme (executed)
migrating response-ratelimiting on database 'kong'...
response-ratelimiting migrated up to: 000_base_response_rate_limiting (executed)
migrating session on database 'kong'...
session migrated up to: 000_base_session (executed)
24 migrations processed
24 executed
Database is up-to-date
4、运行Kong
[root@localhost ~]# docker run -d --name kong \
--network=kong-net \
-e "KONG_DATABASE=postgres" \
-e "KONG_PG_HOST=kong-database" \
-e "KONG_PG_PASSWORD=kong" \
-e "KONG_CASSANDRA_CONTACT_POINTS=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 80:8000 \
-p 443:8443 \
-p 8001:8001 \
-p 8444:8444 \
kong:latest
[root@localhost ~]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
254b7f22fe9d kong:latest "/docker-entrypoint.…" 23 seconds ago Up 21 seconds 127.0.0.1:8001->8001/tcp, 127.0.0.1:8444->8444/tcp, 0.0.0.0:80->8000/tcp, 0.0.0.0:443->8443/tcp kong
9f4ce11bad53 postgres:9.6 "docker-entrypoint.s…" 5 minutes ago Up 5 minutes 0.0.0.0:5432->5432/tcp kong-database
[root@localhost ~]# netstat -ntlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1302/master
tcp 0 0 127.0.0.1:8444 0.0.0.0:* LISTEN 3009/docker-proxy
tcp 0 0 127.0.0.1:8001 0.0.0.0:* LISTEN 3033/docker-proxy
tcp 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN 1303/php-fpm: maste
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1110/sshd
tcp6 0 0 :::5432 :::* LISTEN 2633/docker-proxy
tcp6 0 0 ::1:25 :::* LISTEN 1302/master
tcp6 0 0 :::443 :::* LISTEN 3021/docker-proxy
tcp6 0 0 :::80 :::* LISTEN 3045/docker-proxy
tcp6 0 0 :::22 :::* LISTEN 1110/sshd
5、使用Kong
[root@localhost ~]# curl -i http://localhost:8001/
网页扫描二维码库:Html5-Qrcode,官网地址:https://scanapp.org/html5-qrcode-docs/
nodejs中使用npm和yarn,使用最新阿里云镜像 aliyun mirror,网上很多还是文章用的是下面这个地址~~yarn config set registry https://registry.npm.taobao.org~~
《康熙王朝》是一部非常优秀的电视连续剧,陈道明演的康熙是我觉得最有帝王气魄,让人意犹未尽,本文主要记录一小段非常经典的对白。
HI博客上线啦!这一刻不知道等待了多少年,做为以为技术开发人员,没有自己的博客怎么能行呢!最近利用换工作的空余的时间,为自己搭建了该博客,也在自己人生中很重要的日子上线了该博客。也希望该博客能将自己在工作中比较好的技术整理成文章和一些其他比较好文章转载过来,为需要用到相关技术的同行提供有用的帮助。还希望以后大家能指出相关文章中出现的错误,让看到相关博文的人受益,别被我的个人错误而误导他人。
默认情况下 pip 使用的是国外的镜像,在下载的时候速度非常慢,本文我们介绍使用国内源对pip进行加速。
快速生成表格
Electron页面跳转、浏览器打开链接和打开新窗口
Docker编译镜像出现:fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/main/x86_64/APKINDEX.tar.gz
ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.12/main: temporary error (try again later)
WARNING: Ignoring APKINDEX.2c4ac24e.tar.gz: No such file or directory问题
在Mac电脑中,如何对Git的用户名和密码进行修改呢?起初不懂Mac,所以整了很久,本文将记录如何对这个进行操作,以便后期使用。
在使用Git的过程中,不想每次都输入用户名和密码去拉取代码,所以就需要保存这些信息,那么既然有保存了,就必须有清除功能。