日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程资源 > 编程问答 >内容正文

编程问答

Docker Installation : Docker 中安装并启动 Kong

發(fā)布時(shí)間:2023/12/18 编程问答 30 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Docker Installation : Docker 中安装并启动 Kong 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

前些天發(fā)現(xiàn)了一個(gè)巨牛的人工智能學(xué)習(xí)網(wǎng)站,通俗易懂,風(fēng)趣幽默,忍不住分享一下給大家。點(diǎn)擊跳轉(zhuǎn)到教程。

Details about how to use Kong in Docker can be found on the DockerHub repository hosting the image:?kong. We also have a?Docker Compose template?with built-in orchestration and scalability.

Here is a quick example showing how to connect a Kong container to a Cassandra or PostgreSQL container:

  • Create a Docker network

    You will need to create a custom network to allow the containers to discover and communicate with each other. In this example?kong-net?is the network name, you can use any name.

    $ docker network create kong-net
  • Start your database

    If you wish to use a Cassandra container:

    $ docker run -d --name kong-database \--network=kong-net \-p 9042:9042 \cassandra:3

    If you wish to use a PostgreSQL container:

    $ docker run -d --name kong-database \--network=kong-net \-p 5432:5432 \-e "POSTGRES_USER=kong" \-e "POSTGRES_DB=kong" \postgres:9.6
  • Prepare your database

    Run the migrations with an ephemeral Kong container:

    $ docker run --rm \--network=kong-net \-e "KONG_DATABASE=postgres" \-e "KONG_PG_HOST=kong-database" \-e "KONG_CASSANDRA_CONTACT_POINTS=kong-database" \kong:latest kong migrations up

    In the above example, both Cassandra and PostgreSQL are configured, but you should update the?KONG_DATABASE?environment variable with either?cassandra?or?postgres.

    Note: migrations should never be run concurrently; only one Kong node should be performing migrations at a time.

  • Start Kong

    When the migrations have run and your database is ready, start a Kong container that will connect to your database container, just like the ephemeral migrations container:

    $ docker run -d --name kong \--network=kong-net \-e "KONG_DATABASE=postgres" \-e "KONG_PG_HOST=kong-database" \-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 8000:8000 \-p 8443:8443 \-p 8001:8001 \-p 8444:8444 \kong:latest
  • Use Kong

    Kong is running:

    $ curl -i http://localhost:8001/

    Quickly learn how to use Kong with the?5-minute Quickstart.

  • 轉(zhuǎn)自Docker官網(wǎng):https://docs.konghq.com/install/docker/

    總結(jié)

    以上是生活随笔為你收集整理的Docker Installation : Docker 中安装并启动 Kong的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。