From ecd8f986eb1360d149191f5e002a9148b9ec612e Mon Sep 17 00:00:00 2001 From: Francis Dong Date: Tue, 11 May 2021 17:38:43 +0800 Subject: [PATCH] update installation guide --- README.en-us.md | 43 +++++++++++++++++++++++++++++++------------ README.md | 44 +++++++++++++++++++++++++++++++------------- 2 files changed, 62 insertions(+), 25 deletions(-) diff --git a/README.en-us.md b/README.en-us.md index ddb3407..924ad69 100644 --- a/README.en-us.md +++ b/README.en-us.md @@ -2,7 +2,7 @@ English | [简体中文](./README.md)

Welcome to Fizz Gateway

- Version + Version Documentation @@ -93,6 +93,8 @@ Starting from v1.3.0, the frontend and backend of the management backend are mer | v1.4.0 | v1.4.0 | | v1.4.1 | v1.4.1 | | v1.5.0 | v1.5.0 | +| v1.5.1 | v1.5.1 | +| v2.0.0 | v2.0.0 | Please download the corresponding management backend version according to the version of the community version @@ -140,23 +142,40 @@ Description: 2. If you use the apollo configuration center, you can move the content of the application.yml file to the configuration center (the application name on apollo is: fizz-gateway); if you don't use apollo, you can remove the apollo parameter in the startup command below. 3. The `{version}` that appears in the following installation steps represents the version number of the gateway used, such as `1.3.0`. -Installation method 1: start by script: +Installation method 1: binary package: -1. Download the latest code of fizz-gateway-community, modify the configuration of the configuration center, registry, and redis in the application.yml configuration file (redis configuration needs to be consistent with the management backend), and use the maven command `mvn clean package -DskipTests=true` Build and put the built fizz-gateway-community-{version}.jar and boot.sh in the same directory +1. Download the latest binary package of fizz-gateway-community and upzip to a directory, modify the configuration of the configuration center, registry, and redis in the application.yml configuration file (redis configuration needs to be consistent with the management backend). 2. Modify the apollo connection and JVM memory configuration of the boot.sh script 3. Execute `./boot.sh start` command to start the service, support start/stop/restart/status command -Installation method 2: start by IDE: - -1. The latest code on the local clone repository -2. Import the project fizz-gateway into the IDE -3. After the import is complete, config the project startup configuration and modify the configuration center, registry, and redis in the application.yml configuration file (redis configuration needs to be consistent with the management backend) configuration, and add `-Denv=dev -Dapollo.meta to the VM option =http://localhost:66`(Apollo configuration center address) - -Installation method 3: start by jar: +Installation method 2: source code: 1. The latest code on the local clone warehouse, modify the configuration of the configuration center, registry, and redis in the application.yml configuration file (redis configuration needs to be consistent with the management backend) -2. Execute the Maven command `mvn clean package -DskipTests=true` package in the project root directory fizz-gateway-community -3. Enter the target directory and use the command `java -jar -Denv=DEV -Dapollo.meta=http://localhost:66 fizz-gateway-community-{version}.jar` to start the service +2. Execute the Maven command `mvn clean package install -DskipTests=true` package in the project root directory fizz-gateway-community +3. Execute the Maven command `mvn clean package -DskipTests=true` package in the project directory fizz-gateway-community/fizz-bootstrap +4. Enter fizz-gateway-community/fizz-bootstrap/target/fizz-gateway-community directory and Execute `./boot.sh start` command to start the service, support start/stop/restart/status command + +Installation method 3: docker: + +1. Download docker image:docker pull fizzgate/fizz-gateway-community:{version} +2. Modify Redis configuration by env parameters and run with below docker command +```sh +docker run --rm -d -p 8600:8600 \ +-e "aggregate.redis.host={your redis host IP}" \ +-e "aggregate.redis.port={your redis port}" \ +-e "aggregate.redis.password={your redis password}" \ +-e "aggregate.redis.database={your redis database}" \ +fizzgate/fizz-gateway-community +``` + +or using external configuration file and output log to host server by mount volume, configuration file could be achieved from source code or binary package, create fizz-gateway-community/config and fizz-gateway-community/logs directories in host server, place application.yml and log4j2-spring.xml configuration files to config folder, run with below docker command in fizz-gateway-community folder: + +```sh +cd fizz-gateway-community +docker run --rm -d -p 8600:8600 --privileged \ +-v $PWD/config:/opt/fizz-gateway-community/config \ +-v $PWD/logs:/opt/fizz-gateway-community/logs fizzgate/fizz-gateway-community +``` Finally visit the gateway, the address format is: http://127.0.0.1:8600/proxy/[Service name]/[API Path] diff --git a/README.md b/README.md index 2b59875..e7b6826 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@

Welcome to Fizz Gateway

- Version + Version Documentation @@ -93,6 +93,8 @@ API地址:http://demo.fizzgate.com/proxy/[服务名]/[API_Path] | v1.4.0 | v1.4.0 | | v1.4.1 | v1.4.1 | | v1.5.0 | v1.5.0 | +| v1.5.1 | v1.5.1 | +| v2.0.0 | v2.0.0 | 请根据社区版的版本下载对应的管理后台版本 @@ -140,23 +142,39 @@ API地址:http://demo.fizzgate.com/proxy/[服务名]/[API_Path] 2. 如果使用apollo配置中心,可把application.yml文件内容迁到配置中心(apollo上应用名为:fizz-gateway);如果不使用apollo可去掉下面启动命令里的apollo参数。 3. 以下安装步骤出现的`{version}`表示所使用网关的版本号,例如`1.3.0`。 -安装方式一:脚本启动: +安装方式一:二进制安装包 -1. 下载fizz-gateway-community的最新代码,修改application.yml配置文件里配置中心、注册中心、redis(redis配置需与管理后台一致)的配置,使用maven命令`mvn clean package -DskipTests=true`构建并把构建好的fizz-gateway-community-{version}.jar和boot.sh放同一目录 -2. 修改boot.sh脚本的apollo连接,JVM内存配置 +1. 下载fizz-gateway-community的二进制安装包,解压修改application.yml配置文件里配置中心、注册中心、redis(redis配置需与管理后台一致)的配置 +2. 根据需要修改boot.sh脚本的apollo连接,不使用apollo配置中心可跳过 3. 执行 `./boot.sh start` 命令启动服务,支持 start/stop/restart/status命令 -安装方式二:IDE启动: - -1. 本地clone仓库上的最新代码 -2. 将项目fizz-gateway导入IDE -3. 导入完成后设置项目启动配置及修改application.yml配置文件里配置中心、注册中心、redis(redis配置需与管理后台一致)的配置,在VM选项中加入`-Denv=dev -Dapollo.meta=http://localhost:66`(Apollo配置中心地址) - -安装方式三:jar启动: +安装方式二:源码安装: 1. 本地clone仓库上的最新代码,修改application.yml配置文件里配置中心、注册中心、redis(redis配置需与管理后台一致)的配置 -2. 在项目根目录fizz-gateway-community下执行Maven命令`mvn clean package -DskipTests=true`打包 -3. 进入target目录,使用命令`java -jar -Denv=DEV -Dapollo.meta=http://localhost:66 fizz-gateway-community-{version}.jar`启动服务 +2. 在项目根目录fizz-gateway-community下执行Maven命令`mvn clean package install -DskipTests=true` +3. 在项目目录fizz-gateway-community/fizz-bootstrap下执行Maven命令`mvn clean package -DskipTests=true` +4. 进入fizz-gateway-community/fizz-bootstrap/target/fizz-gateway-community目录,执行 `./boot.sh start` 命令启动服务,支持 start/stop/restart/status命令 + +安装方式三(v2.0.0或以上版本):docker: +1. 下载对应版本的镜像:docker pull fizzgate/fizz-gateway-community:{version} +2. 通过环境变量方式修改redis配置(其它配置同理)并运行镜像 +```sh +docker run --rm -d -p 8600:8600 \ +-e "aggregate.redis.host={your redis host IP}" \ +-e "aggregate.redis.port={your redis port}" \ +-e "aggregate.redis.password={your redis password}" \ +-e "aggregate.redis.database={your redis database}" \ +fizzgate/fizz-gateway-community +``` + +或通过映射目录方式使用外部配置文件和输出日志到宿主机, 配置文件可从安装包或源码里获取,在宿主机创建fizz-gateway-community/config和fizz-gateway-community/logs目录,把application.yml和log4j2-spring.xml配置文件放置config下,在fizz-gateway-community目录下运行镜像 + +```sh +cd fizz-gateway-community +docker run --rm -d -p 8600:8600 --privileged \ +-v $PWD/config:/opt/fizz-gateway-community/config \ +-v $PWD/logs:/opt/fizz-gateway-community/logs fizzgate/fizz-gateway-community +``` 最后访问网关,地址形式为:http://127.0.0.1:8600/proxy/[服务名]/[API_Path]