快速开始

1.环境说明

Gateway不依赖类似tomcat及其它类容器,而是作为一个独立运行在jvm上。JDK版本为1.8

解压后目录为:

+lib +bin
+conf +logs

目录介绍:

bin 启动和停止脚本目录;

conf 配置文件目录,包括主配置文件、环境配置文件、日志配置(logback.xml);

lib gatewaylib包目录,以jar结尾的jar文件会被追加到gateway类加载路径;

logs log文件输出目录;

conf/config.properties是启动的主配置文件,用来配置gateway启动时的相关配置。

bin/gateway-start.bat,windows下的启动脚本,可自行进行修改

bin/gateway-start.sh,linux下的启动脚本,可自行进行修改

bin/gateway.yaml,采用yaml配置文件作为基本的启动方式时的配置文件

bin/gateway-agent-start.bat, windows单独启动agent模块

bin/gateway-agent-start.sh, linux单独启动agent模块

bin/gateway-shutdown.bat, window关闭网关

bin/gateway-shutdown.sh, linux关闭网关

bin/nohupgateway-start.sh linux后台线程方式启动网关

bin/nohupgateway-agent-start.sh linux后台线程方式启动agent

conf/logback.xml,日志配置

2.启动

  1. 将gateway打包后的目录,包括插件库和配置文件统一拷贝至服务器

  2. 打开conf/yaml/gateway.yaml文件,根据需求修改inbound_channel的监听端口和outbound_channel中接收请求的服务端地址,如下图所示:

    1-2-1

  3. 配置完成后,执行nohup sh gateway-start.sh &(windows下执行gateway-start.bat),启动gateway,看到如下图所示,则gateway启动成功1-2-2

  4. 客户端发送http请求,在服务端则可以收到通过网关转发后的请求信息
Copyright © 民生科技有限公司 2019 all right reserved,powered by Gitbook联系方式: wanglihang@mskj.com
修订时间: 2019-08-02 16:19:33

results matching ""

    No results matching ""