Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The installation and configuration method of Kong

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains "how to install and configure Kong". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Now let the editor take you to learn how to install and configure Kong.

See: https://docs.konghq.com/

Installation and configuration

The easiest way to use docker is, so install docker.

# create docker networkdocker network create kong-net# to launch kong databasedocker run-d-name kong-database-- network=kong-net-p 5432 KONG_PG_HOST=kong-database 5432-e "POSTGRES_USER=kong"-e "POSTGRES_DB=kong" postgres:9.6# initialize database 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 bootstrap# launch Kongdocker 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.0IP 8444 ssl "- p 8000 IP 8000-p 8443 IP 8443-p 8001 IP 8001-p 844414 8444 configuration service 192.168.20.137 Because the curl under windows is a fake, a centos is installed using docker and the curl command is executed on it. For centos configuration under # docker, please see curl-I-X POST-- url http://192.168.20.137:8001/services/-- data 'name=example-service'-- data' url= http://baidu.com'# configuration routing curl-I-X POST-- url http://192.168.20.137:8001/services/example-service/routes-- data 'hosts [] = example.com'# Test Route curl-I-X GET-- url http : / / 192.168.20.137 header 'Host: example.com'# authentication plug-in curl-I-X POST-- url http://192.168.20.137:8001/services/example-service/plugins/-- data' name=key-auth'# test plug-in curl-I-X GET-- url http://192.168.20.137:8000/-- header 'Host: example.com'# create user curl- I-X POST-- url http://192.168.20.137:8001/consumers/-- data "username=Jason" # create the user's KEYcurl-I-X POST-- url http://192.168.20.137:8001/consumers/Jason/key-auth/-- data 'key=ENTER_KEY_HERE'# verify the consumer curl-I-X GET-- url http://192.168.20.137:8000-- header "Host: example. Install and configure centos under com "--header" apikey: ENTER_KEY_HERE "docker

Main commands:

Docker run-it-- name=centos centos / bin/bashdocker exec-it centos / bin/bashyum-y install wget# can refer to the method on the Internet and modify the yum source to a domestic image to improve the installation speed. But must install wget first, # otherwise may cause yum temporarily unavailable in the modification process, and wget is not available, I believe you have a deeper understanding of the "Kong installation and configuration method", you might as well do it in practice! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report