欢迎大家赞助一杯啤酒🍺 我们准备了下酒菜:Formal mathematics/Isabelle/ML, Formal verification/Coq/ACL2/Agda, C++/Lisp/Haskell
Kong
来自开放百科 - 灰狐
(版本间的差异)
小 (→常见问题) |
小 (→组件) |
||
| 第33行: | 第33行: | ||
运行 | 运行 | ||
$ curl http://127.0.0.1:8001 | $ curl http://127.0.0.1:8001 | ||
| + | |||
| + | ==Vagrant== | ||
| + | $ git clone https://github.com/Mashape/kong | ||
| + | cd kong | ||
| + | $ git checkout next | ||
| + | $ git clone https://github.com/Mashape/kong-vagrant | ||
| + | $ cd kong-vagrant/ | ||
| + | $ KONG_PATH=/Users/huihoo/kong vagrant up | ||
| + | $ vagrant ssh | ||
| + | $ cd /kong | ||
| + | $ sudo make dev | ||
| + | $ kong start -c kong_DEVELOPMENT.yml | ||
| + | $ curl http://localhost:8001 | ||
==组件== | ==组件== | ||
2016年3月16日 (三) 01:08的版本
Kong 是一个基于Nginx构建的Microservices和API开源(Apache v2)管理层。
目录 |
安装
brew tap mashape/kong brew install kong kong --help kong start curl 127.0.0.1:8001
Cassandra
测试数据库,/etc/kong/kong.yml
database: cassandra
cassandra:
contact_points:
- "ec2-52-5-200-155.compute-1.amazonaws.com:35005"
Docker
Pull官方镜像
$ docker pull cassandra:2.2.4 $ docker pull mashape/kong
启动Cassandra
docker run -p 9042:9042 -d --name cassandra cassandra:2.2.4
启动Kong
$ docker run -d --name kong \
--link cassandra:cassandra \
-p 8000:8000 \
-p 8443:8443 \
-p 8001:8001 \
-p 7946:7946 \
-p 7946:7946/udp \
mashape/kong
运行
$ curl http://127.0.0.1:8001
Vagrant
$ git clone https://github.com/Mashape/kong cd kong $ git checkout next $ git clone https://github.com/Mashape/kong-vagrant $ cd kong-vagrant/ $ KONG_PATH=/Users/huihoo/kong vagrant up $ vagrant ssh $ cd /kong $ sudo make dev $ kong start -c kong_DEVELOPMENT.yml $ curl http://localhost:8001
组件
Kong可与两种不同的组件协同工作:
- Nginx: Kong使用经过修改的Nginx web服务器作为代理服务器,负责处理API请求。
- Apache Cassandra: 用作数据存储(datastore)服务器,负载存储来自Kong操作的数据。
相关项目
常见问题
/usr/local/bin/luajit: not found
git clone http://luajit.org/git/luajit-2.0.git cd luajit-2.0 git pull make sudo make install
error loading module 'lfs' from file '/usr/local/lib/lua/5.1/lfs.so':
sudo luarocks install luafilesystem
用户
图集
链接
- Kong官网
- Kong @ GitHub
- Cassandra for Kong
- Kongdb - On demand Cassandra database for testing Kong
- Docker distribution for Kong
分享您的观点