KONG提供了一套CLI(命令行界面)命令,您可以通过它来启动、停止和管理您的Kong实例。CLI管理您的本地节点(如在当前机器上)。

  全局配置

    所有命令都采用一组指定的可选标志作为参数:

      --help:显示命令行帮助信息

      --v:启动详情模式

      --vv:启动debug模式(noisy)

  可用的命令符

    kong check:

Usage: kong check <conf>

Check the validity of a given Kong configuration file.

<conf> (default /etc/kong.conf) configuration file

    kong cluster:

Usage: kong cluster COMMAND [OPTIONS]

Manage Kong's clustering capabilities.

The available commands are:
keygen -c Generate an encryption key for intracluster traffic.
See 'cluster_encrypt_key' setting
members -p Show members of this cluster and their state.
reachability -p Check if the cluster is reachable.
force-leave -p <node_name> Forcefully remove a node from the cluster (useful
if the node is in a failed state).
keys install <key> Install a new key onto Kong's internal keyring. This
will enable the key for decryption. The key will not
be used to encrypt messages until the primary key is
changed.
keys use <key> Change the primary key used for encrypting messages.
All nodes in the cluster must already have this key
installed if they are to continue communicating with
eachother.
keys remove <key> Remove a key from Kong's internal keyring. The key
being removed may not be the current primary key.
keys list List all currently known keys in the cluster. This
will ask all nodes in the cluster for a list of keys
and dump a summary containing each key and the
number of members it is installed on to the console. Options:
-c,--conf (optional string) configuration file
-p,--prefix (optional string) prefix Kong is running at

    kong compile:

Usage: kong compile [OPTIONS]

Compile the Nginx configuration file containing Kong's servers
contexts from a given Kong configuration file. Example usage:
kong compile -c kong.conf > /usr/local/openresty/nginx-kong.conf This file can then be included in an OpenResty configuration: http {
# ...
include 'nginx-kong.conf';
} Note:
Third-party services such as Serf need to be properly configured
and started for Kong to be fully compatible while embedded. Options:
-c,--conf (optional string) configuration file

    kong health:

Usage: kong health [OPTIONS]

Check if the necessary services are running for this node.

Options:
-p,--prefix (optional string) prefix at which Kong should be running

    kong migrations:

Usage: kong migrations COMMAND [OPTIONS]

Manage Kong's database migrations.

The available commands are:
list List migrations currently executed.
up Execute all missing migrations up to the latest available.
reset Reset the configured database (irreversible). Options:
-c,--conf (optional string) configuration file

    kong quit:

Usage: kong quit [OPTIONS]

Gracefully quit a running Kong node (Nginx and other
configured services) in given prefix directory. This command sends a SIGQUIT signal to Nginx, meaning all
requests will finish processing before shutting down.
If the timeout delay is reached, the node will be forcefully
stopped (SIGTERM). Options:
-p,--prefix (optional string) prefix Kong is running at
-t,--timeout (default ) timeout before forced shutdown

    kong reload:

Usage: kong reload [OPTIONS]

Reload a Kong node (and start other configured services
if necessary) in given prefix directory. This command sends a HUP signal to Nginx, which will spawn
new workers (taking configuration changes into account),
and stop the old ones when they have finished processing
current requests. Options:
-c,--conf (optional string) configuration file
-p,--prefix (optional string) prefix Kong is running at
--nginx-conf (optional string) custom Nginx configuration template

    kong restart:

Usage: kong restart [OPTIONS]

Restart a Kong node (and other configured services like Serf)
in the given prefix directory. This command is equivalent to doing both 'kong stop' and
'kong start'. Options:
-c,--conf (optional string) configuration file
-p,--prefix (optional string) prefix at which Kong should be running
--nginx-conf (optional string) custom Nginx configuration template

    kong start:

Usage: kong start [OPTIONS]

Start Kong (Nginx and other configured services) in the configured
prefix directory. Options:
-c,--conf (optional string) configuration file
-p,--prefix (optional string) override prefix directory
--nginx-conf (optional string) custom Nginx configuration template

    kong stop:

Usage: kong stop [OPTIONS]

Stop a running Kong node (Nginx and other configured services) in given
prefix directory. This command sends a SIGTERM signal to Nginx. Options:
-p,--prefix (optional string) prefix Kong is running at

    kong version:

Usage: kong version [OPTIONS]

Print Kong's version. With the -a option, will print
the version of all underlying dependencies. Options:
-a,--all get version of all dependencies
  • --help: print the command's help message

微服务Kong(七)——CLI参考的更多相关文章

  1. spring cloud微服务实践七

    在spring cloud 2.x以后,由于zuul一直停滞在1.x版本,所以spring官方就自己开发了一个项目 Spring Cloud Gateway.作为spring cloud微服务的网关组 ...

  2. 微服务(七)Gateway服务网关

    1 为什么要有网关 权限控制:网关作为微服务入口,需要校验用户是是否有请求资格,如果没有则进行拦截. 路由和负载均衡:一切请求都必须先经过gateway,但网关不处理业务,而是根据某种规则,把请求转发 ...

  3. 微服务Kong(六)——配置参考

    1. 配置加载 如果您通过其中一个官方软件包安装了Kong,Kong会附带默认配置文件,该文件可以在/etc/kong/kong.conf.default中找到.要开始配置Kong,您可以复制此文件: ...

  4. 微服务Kong(九)——认证参考

    客户端访问上游API服务,通常由Kong的认证插件及其配置参数来控制. 通用认证 一般情况下,上游API服务都需要客户端有身份认证,且不允许错误的认证或无认证的请求通过.认证插件可以实现这一需求.这些 ...

  5. 微服务Kong(八)——代理参考

    Kong侦听四个端口的请求,默认情况是: 8000:此端口是Kong用来监听来自客户端的HTTP请求的,并将此请求转发到您的上游服务.这也是本教程中最主要用到的端口. 8443:此端口是Kong监听H ...

  6. 微服务Kong(十)——负载均衡参考

    KONG为请求多个后端服务提供了多种负载均衡方案:一种是简单的基于DNS,另一种是更加动态的环形均衡器,他在不需要DNS服务器的情况下也允许服务注册. 一.基于DNS的负载均衡 当使用基于DNS的负载 ...

  7. 微服务Kong(二)——快速入门

    在本节中,您将学习如何管理您的KONG实例.首先,我们将指导您如何启动Kong,以便您能访问KONG的RESTful形式的管理界面,您可以通过它来管理您的API,consumers等.通过管理型API ...

  8. 微服务Kong(一)——简介

    重要提示: 本教程是根据 KONG 0.10.x 版本进行编写的. 一.什么是KONG Kong是一个可扩展的开源API层(也称为API网关或API中间件).它运行在任何RESTful API之前,并 ...

  9. 微服务Kong(五)——添加一个用户(Consumer)

    在本节中,我们将学习如何添加一个用户(consumer)到KONG实例中.用户是与使用您的API的个人相关联,可用于跟踪,访问管理等. NOTE:本节假设您已经正确启用了密钥验证插件.如果没有,请参考 ...

随机推荐

  1. 读<走出软件作坊>有感

    1.成功的人都是在不可能完成任务的情况下完成的,成功的人也从来不会抱怨客观条件多么糟糕. 2.公司给你的资源,永远小于你做事需要的资源,这就是现实,就这么多人,就这样的素质,必须在现状中想出做事的办法 ...

  2. 使用VPD解决EBS中信息屏蔽问题

    本文描述的是2005年在一个项目中采用Oracle VPD技术解决同一个OU下按照不同办事处屏蔽销售订单的解决方案. VPD技术提供了数据库对象(表,同义词,视图)行级别访问的控制.关于VPD更多的信 ...

  3. Unity3d之Coroutine

    在Unity3d中使用C#时,Coroutine是一个大有用处的好东西,至于怎么用网上多的是讲,我仅在此记录最近一次使用中的小发现. 因为某种需求,要在一个Coroutine实现中使用while循环, ...

  4. [Erlang35]Erlang18的time

    在Erlang 18中, 我们还是可以使用erlang:now/0 但也已经 deprecated啦,大量使用可能引发瓶颈. The default time warp mode has the sa ...

  5. 网络正常只有自己访问网站异常一度让你怀疑,是不是被黑了!域名解析异常是如何发生的,如何解决处理及C#编程实现一键修改Hosts文件

    首先大家要知道在浏览器上浏览虚拟主机,必须使用Hosts文件或域名系统(DNS)实现主机名到IP地址的解析.在局域网中用Hosts文件或DNS都可以,在Internet上只能用DNS了. 1.当用户输 ...

  6. Regular进阶: 几点性能优化的建议

    本文由作者郑海波授权网易云社区发布. 本文旨在用 20% 的精力解决使用Regular过程中 80% 的性能问题. 这里大部分是关于脏检查的性能优化,不了解的可以先看下<Regular脏检查介绍 ...

  7. 使用X-Pack插件来进行权限控制

    1.为elasticsearch安装X-Pack插件.进入 elasticsearch根目录,执行: bin/elasticsearch-plugin install x-pack杀掉进程,重启es, ...

  8. ZooKeeper学习1---简单介绍

    一.分布式协调技术 在给大家介绍ZooKeeper之前先来给大家介绍一种技术——分布式协调技术.那么什么是分布式协调技术?那么我来告诉大家,其实分布式协调技术主要用来解决分布式环境当中多个进程之间的同 ...

  9. mongodb 3.0下载安装、配置及mongodb最新特性、基本命令教程详细介绍

    mongoDB简介(本文由www.169it.com搜集整理) MongoDB是一个高性能,开源,无模式的文档型数据库,是目前在IT行业非常流行的一种非关系型数据库(NoSql).它在许多场景下可用于 ...

  10. 用css做出来一个三角形

    用css做出来一个三角形      <!--不设置宽高  转换行内块  边线设置成宽度-->       <div class="triangle"> 三角 ...