docker环境安装
1、创建docker网络
docker network create kong-net
2、创建database
docker run -d --name kong-database --network=kong-net -p 9042:9042 cassandra:3
3、数据库准备
docker run --rm --network=kong-net -e "KONG_DATABASE=cassandra" -e "KONG_PG_HOST=kong-database" -e "KONG_CASSANDRA_CONTACT_POINTS=kong-database" kong:latest kong migrations bootstrap
4、创建kong
docker run -d --name kong --network=kong-net -e "KONG_DATABASE=cassandra" -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 -v /Users/mqiqe/conf/kong/kong.conf:/etc/kong/kong.conf kong:latest
4、查看启动状态
curl -i http://localhost:8001/
5、创建konga界面
docker pull pantsel/konga
docker run -d -p 1337:1337 --network kong-net --name konga -e "NODE_ENV=production" -e "TOKEN_SECRET=wfg" pantsel/konga
consul安装
docker pull consul
docker run -d -p 8500:8500 -p 8600:8600 --network kong-net -v /Users/mqiqe/conf/consul/data:/consul/data -e CONSUL_BIND_INTERFACE='eth0' --name=consul consul agent -server -bootstrap -ui -client='0.0.0.0' -node=consul
/Users/mqiqe/soft/consul agent -dev -server -bootstrap -ui -client='0.0.0.0' -node=consul