Kong v0.9.0 发布
jopen 8年前
<p style="text-align: center;"><img alt="" src="https://simg.open-open.com/show/22cdaab266499458882a505cb199be22.png" /></p> <p>Kong是在客户端和(微)服务间转发API通信的API网关,通过插件扩展功能。Kong有两个主要组件:</p> <ul> <li>Kong Server :基于nginx的服务器,用来接收API请求。</li> <li>Apache Cassandra :用来存储操作数据。</li> </ul> <p>你可以通过增加更多Kong Server机器对Kong服务进行水平扩展,通过前置的负载均衡器向这些机器分发请求。根据文档描述,两个Cassandra节点就足以支撑绝大多数情况,但如果网络非常拥挤,可以考虑适当增加更多节点。</p> <p>对于开源社区来说,Kong 中最诱人的一个特性是可以通过插件扩展已有功能,这些插件在 API 请求响应循环的生命周期中被执行。插件使用 Lua 编写,而且 Kong 还有如下几个基础功能:</p> <ul> <li> HTTP 基本认证</li> <li> 密钥认证</li> <li> CORS( Cross-origin Resource Sharing,跨域资源共享)</li> <li> TCP/UDP</li> <li> 文件日志</li> <li> API 请求限流</li> <li> 请求转发</li> <li> nginx 监控</li> </ul> <p> </p> <p><img src="file:///C:/Users/wqm/AppData/Local/Temp/enhtmlclip/Image(5).png" /> <img alt="" src="https://simg.open-open.com/show/8cc1737a2b0ff1e31dcec627751ec625.png" /></p> <h3>更新日志</h3> <h3>Changed</h3> <ul> <li> New CLI, with new commands and refined arguments. This new CLI uses the <code>resty-cli</code> interpreter (see <a href="/misc/goto?guid=4958992678298818615">lua-resty-cli</a>) instead of LuaJIT. As a result, the <code>resty</code> executable must be available in your <code>$PATH</code> (resty-cli is shipped in the OpenResty bundle) as well as the <code>bin/kong</code> executable. Kong does not rely on Luarocks installing the <code>bin/kong</code>executable anymore. This change of behavior is taken care of if you are using one of the official Kong packages.</li> <li> Kong uses a new configuration file, with an easier syntax than the previous YAML file.</li> <li>New arguments for the CLI, such as verbose, debug and tracing flags. We also avoid requiring the configuration file as an argument to each command as per the previous CLI.</li> <li>Customization of the Nginx configuration can now be taken care of using two different approaches: with a custom Nginx configuration template and using <code>kong start --template <file></code>, or by using <code>kong compile</code> to generate the Kong Nginx sub-configuration, and <code>include</code> it in a custom Nginx instance.</li> <li>Plugins: <ul> <li>Rate Limiting: the <code>continue_on_error</code> property is now called <code>fault_tolerant</code>.</li> <li>Response Rate Limiting: the <code>continue_on_error</code> property is now called <code>fault_tolerant</code>.</li> </ul> </li> </ul> <h3>Added</h3> <ul> <li> Support for overriding configuration settings with environment variables.</li> <li> Support for SSL connections between Kong and PostgreSQL. <a href="/misc/goto?guid=4958992678394107564">#1425</a></li> <li> Ability to apply plugins with more granularity: per-consumer, and global plugins are now possible. <a href="/misc/goto?guid=4958992678468230941">#1403</a></li> <li>New <code>kong check</code> command: validates a Kong configuration file.</li> <li>Better version check for third-party dependencies (OpenResty, Serf, dnsmasq). <a href="/misc/goto?guid=4958992678545480741">#1307</a></li> <li>Ability to configure the validation depth of database SSL certificates from the configuration file. <a href="/misc/goto?guid=4958992678626749591">#1420</a></li> <li><code>request_host</code>: internationalized url support; utf-8 domain names through punycode support and paths through %-encoding. <a href="/misc/goto?guid=4958992678704326775">#1300</a></li> <li>Implements caching locks when fetching database configuration (APIs, Plugins...) to avoid dog pile effect on cold nodes.<a href="/misc/goto?guid=4958992678786888164">#1402</a></li> <li>Plugins: <ul> <li> <strong>New bot-detection plugin</strong>: protect your APIs by detecting and rejecting common bots and crawlers. <a href="/misc/goto?guid=4958992678859821612">#1413</a></li> <li>correlation-id: new "tracker" generator, identifying requests per worker and connection. <a href="/misc/goto?guid=4958992678933589912">#1288</a></li> <li>request/response-transformer: ability to add strings including colon characters. <a href="/misc/goto?guid=4958992679016927064">#1353</a></li> <li>rate-limiting: support for new rate-limiting policies (<code>cluster</code>, <code>local</code> and <code>redis</code>), and for a new <code>limit_by</code> property to force rate-limiting by <code>consumer</code>, <code>credential</code> or <code>ip</code>.</li> <li>response-rate-limiting: support for new rate-limiting policies (<code>cluster</code>, <code>local</code> and <code>redis</code>), and for a new <code>limit_by</code>property to force rate-limiting by <code>consumer</code>, <code>credential</code> or <code>ip</code>.</li> <li>galileo: performance improvements of ALF serialization. ALFs are not discarded when exceeding 20MBs anymore.<a href="/misc/goto?guid=4958993175303664870">#1463</a></li> <li>statsd: new <code>upstream_stream</code> latency metric. <a href="/misc/goto?guid=4958993175444358851">#1466</a></li> <li>datadog: new <code>upstream_stream</code> latency metric and tagging support for each metric. <a href="/misc/goto?guid=4958993175542725402">#1473</a></li> </ul> </li> </ul> <h3>Removed</h3> <ul> <li>We now use <a href="/misc/goto?guid=4958993175649147254">lua-resty-jit-uuid</a> for UUID generation, which is a pure Lua implementation of <a href="/misc/goto?guid=4958993175748001980">RFC 4122</a>. As a result, libuuid is not a dependency of Kong anymore.</li> </ul> <h3>Fixed</h3> <ul> <li>Sensitive configuration settings are not printed to stdout anymore. <a href="/misc/goto?guid=4958992679093158331">#1256</a></li> <li>Fixed bug that caused nodes to remove themselves from the database when they attempted to join the cluster. <a href="/misc/goto?guid=4958992679177273312">#1437</a></li> <li>Plugins: <ul> <li>request-size-limiting: use proper constant for MB units while setting the size limit. <a href="/misc/goto?guid=4958992679257803239">#1416</a></li> <li>OAuth2: security and config validation fixes. <a href="/misc/goto?guid=4958992679328427250">#1409</a> <a href="/misc/goto?guid=4958990866855162045">#1112</a></li> <li>request/response-transformer: better validation of fields provided without a value. <a href="/misc/goto?guid=4958992679437864583">#1399</a></li> <li>JWT: handle some edge-cases that could result in HTTP 500 errors. <a href="/misc/goto?guid=4958992679514401887">#1362</a></li> </ul> </li> </ul> <blockquote> <p><strong>internal</strong></p> <ul> <li>new test suite using resty-cli and removing the need to monkey-patch the <code>ngx</code> global.</li> <li>custom assertions and new helper methods (<code>wait_until()</code>) to gracefully fail in case of timeout.</li> <li>increase atomicity of the testing environment.</li> <li>lighter testing instance, only running 1 worker and not using dnsmasq by default.</li> </ul> </blockquote> <h2>下载</h2> <ul> <li><a href="/misc/goto?guid=4958993293615167596" rel="nofollow"><strong>Source code</strong> (zip)</a></li> <li><a href="/misc/goto?guid=4958993293697668872" rel="nofollow"><strong>Source code</strong> (tar.gz)</a></li> </ul> <p> </p> <p>本站原创,转载时保留以下信息:<br /> 本文转自:深度开源(open-open.com)<br /> 原文地址:<a href="http://www.open-open.com/news/view/243c89f4">http://www.open-open.com/news/view/243c89f4</a></p>