kong安装

1

哪些企业在用KONG:

  • Mashapoe Marketplace
  • Buzzlogix
  • Gengo
  • IBM
  • Intel
  • OpenDNS
  • 饿了么

Kong可与两种不同的组件协同工作:

  • Nginx:Kong使用经过修改的Nginx web服务器作为代理服务器,该服务器负责处理API请求。
  • Apache Cassandra或者PostgreSQL:这用作数据存储(Datastore)服务器,负载存储来自Kong操作的数据。

 

Kong VS 其他API网关

  • 开源:没有黑盒。 对于企业或免费使用,Kong是完全开源的。
  • 基于Nginx:Kong嵌入在Nginx并受益于其令人惊叹的代理性能。
  • 可定制:编写插件以涵盖您的所有架构用例。
  • 数据所有权:Kong及其基础数据存储在您的服务器上运行。
  • 容易扩展:所有孔节点是无状态的。 在你的集群中产生新的节点是很容易的。
  • 集成:许多插件与微服务世界中的流行的第三方服务集成。

 

Kong使用方式

  • 一种应用通过携带Host头部来增加API应用。
  • 另一种是通过不同的uri来提供API应用。

两种方式对OpenResty或者nginx的使用方式都是基于动态增加upstream以及对upstream的DNS resolver来实现。

 

kong repo源

wget https://bintray.com/mashape/kong-rpm-el7-0.10.x/rpm -O bintray-mashape-kong-rpm-el7-0.10.x.repo
 
[bintraybintray-mashape-kong-rpm-el7-0.10.x]
name=bintray-mashape-kong-rpm-el7-0.10.x
baseurl=https://dl.bintray.com/mashape/kong-rpm-el7-0.10.x
gpgcheck=0
repo_gpgcheck=0
enabled=1

 

kong的监听端口:

proxy_listen = 0.0.0.0:8000             #API请求的代理层监听端口
proxy_listen_ssl = 0.0.0.0:8443     # 代理的https
admin_listen = 0.0.0.0:8001             # restful的配置管理API
admin_listen_ssl = 0.0.0.0:8444         
cluster_listen = 0.0.0.0:7946        
cluster_listen_rpc = 127.0.0.1:7373 

 

启动kong

[root@k8s2 kong]# kong start
Error: /usr/local/share/lua/5.1/kong/cmd/start.lua:21: [postgres error] could not get current migrations: [postgres error] connection refused

Run with --v (verbose) or --vv (debug) for more details

启动报错,因为没有连接到postgres 或者cassandra上。数据库还未安装


 

cassandra部署

[datastax]
name = DataStax Repo for Apache Cassandra
baseurl = http://rpm.datastax.com/community
enabled = 1
gpgcheck = 0

 

安装cassandra3版本

[root@k8s2 yum.repos.d]# yum -y install  cassandra3

 

启动cassandra 服务

[root@k8s2 yum.repos.d]# /etc/init.d/cassandra start
Reloading systemd: [ OK ]
Starting cassandra (via systemctl): [ OK ]

 

 

posted @ 2017-05-18 17:33  fengjian1585  阅读(657)  评论(0编辑  收藏  举报