You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by go...@apache.org on 2021/07/07 06:02:26 UTC

[incubator-inlong-website] branch master updated: [INLONG-668] adjust quick_start.md content of inlong-manager (#80)

This is an automated email from the ASF dual-hosted git repository.

gosonzhang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-inlong-website.git


The following commit(s) were added to refs/heads/master by this push:
     new ba3f875  [INLONG-668] adjust quick_start.md content of inlong-manager (#80)
ba3f875 is described below

commit ba3f87537e8575821dfdf06ace6fe11f601b5812
Author: 瘦风 <he...@gmail.com>
AuthorDate: Wed Jul 7 14:02:17 2021 +0800

    [INLONG-668] adjust quick_start.md content of inlong-manager (#80)
    
    Co-authored-by: healzhou <he...@tencent.com>
---
 docs/zh-cn/modules/manager/quick_start.md | 184 ++++++++++++++----------------
 1 file changed, 86 insertions(+), 98 deletions(-)

diff --git a/docs/zh-cn/modules/manager/quick_start.md b/docs/zh-cn/modules/manager/quick_start.md
index 3cd87c9..91cabc3 100644
--- a/docs/zh-cn/modules/manager/quick_start.md
+++ b/docs/zh-cn/modules/manager/quick_start.md
@@ -1,121 +1,109 @@
-
-
 ---
- 快速开始 - Apache inlong-manager
+快速开始 - Apache inlong-manager
 ---
 
-# 1. 编译
+# 1. 环境准备
 
-+ 环境准备:已正确安装 Java(1.8+)、Maven(3.3+) 工具。
-+ 通过 macOS 的终端(或 Windows 的 cmd)进入项目根目录`Inlong`执行编译打包命令:
-```
-mvn clean package -DskipTests
+- 安装并配置 JDK(1.8+)、Maven(3.3+);
+
+- 安装并启动 ZooKeeper 3.5+;
+
+- 安装并启动 Tube 集群;
+
+- 安装并启动 Hadoop 2.10.x 和 Hive 2.3.x;
+
+- 安装并启动 MySQL 5.7+,创建数据库,如 `CREATE DATABASE IF NOT EXISTS inlong; USE inlong;`,然后把 inlong-manager
+  模块中的 `doc/sql/apache_inlong_manager.sql` 文件拷贝到 MySQL 数据库所在的服务器(比如拷贝到 `/data/` 目录下,通过下述命令加载此文件,完成表结构及基础数据的初始化:
+
+  ```shell
+  # 通过用户名和密码,登录 MySQL 服务器:
+  mysql -u xxx -p xxx
+  ...
+  # 通过 source 命令加载上述 SQL 文件:
+  mysql> source /data/apache_inlong_manager.sql;
+  ```
+
+# 2. 修改配置
+
+`inlong-manager/manager-web/src/resources/application.yml` 中默认使用开发环境的配置:
+
+```yaml
+spring:
+  profiles:
+    active: dev
 ```
-+  进入Inlong-manager子项目`inlong-manager` 目录,运行以下 Maven 命令打包项目,仅编译打包manager子项目:
+
+所以需要修改 `inlong-manager/manager-web/src/resources/application-dev.yml` 中的相关配置:
+
+1) 修改数据库 URL、用户名和密码:
+
+   ```yaml
+   spring:
+     datasource:
+       jdbc-url: jdbc:mysql://127.0.0.1:3306/apache_inlong_manager?serverTimezone=GMT%2b8&useSSL=false&allowPublicKeyRetrieval=true&characterEncoding=UTF-8&nullCatalogMeansCurrent=true
+       username: xxxxxx
+       password: xxxxxx
+   ```
+
+2) 修改 Tube 和 ZooKeeper 集群的连接信息,其中 `cluster.zk.root` 建议使用默认值:
+
+   ```yaml
+   cluster:
+     tube:
+       manager: http://127.0.0.1:8081
+       master: 127.0.0.1:8000,127.0.0.1:8010
+     zk:
+       url: 127.0.0.1:2181
+       root: inlong_hive
+   ```
+
+# 3. 编译打包
+
+通过 macOS 的终端(或 Windows 的 cmd)进入项目根目录 `incubator-inlong`,然后执行以下编译命令:
+
 ```
-mvn clean package -DskipTests
+mvn clean install -DskipTests
 ```
 
-+ 正确打包完成后,可在各个子模块的 `target` 目录下看到打好的tar包,manager-web-xxx-incubating-SNAPSHOT.tar.gz
+编译成功后,前往项目的 `inlong-manager/manager-web` 和 `inlong-manager/manager-openapi` 模块,在各自的 `target` 目录下有打好的 tar
+包,名称为 `apache-inlong-manager-web-*.tar.gz`。
 
+# 4. 部署、启动服务
 
-# 2 依赖准备
-## 2.1 数据库初始化
-+ 基于mysql 5.7+,提前创建好数据库,如``CREATE DATABASE IF NOT EXISTS inlong; USE inlong``, 并导入inlong-manager/doc/sql/apache_inlong_manager.sql完成表结构及基础数据的初始化
-+ 修改inlong-manager/manager-web/src/resources/application-xx.yml中数据库连接地址
-+ zookeeper 3.5+ ,信息配置到inlong-manager/manager-web/src/resources/application-xx.yml文件对应位置
-+ Tube集群信息,修改inlong-manager/manager-web/src/resources/application-xx.yml中tube相关配置信息
-+ hadoop2.10.x 集群 , hive 2.3.x需提前构建并启动完成
+## 4.1 部署 manager-web
 
-# 3. 后台服务部署&启动
+1) 将上面打好的 tar 包 `inlong-manager/manager-web/target/apache-inlong-manager-web-*.tar.gz` 拷贝到要部署的服务器;
 
-## 3.1 manager-web部署
+2) 前往部署服务器,解压安装包:`tar -zxvf apache-inlong-manager-web-*.tar.gz`;
 
-+ (1)找到安装包,进入 /apache-inlong/inlong-manager/manager-web/target 找到 manager-web-xxx-incubating-SNAPSHOT.tar.gz
-+ (2)部署安装包,压到即将部署服务的服务器对应目录  tar -zxvf manager-web-xxx-incubating-SNAPSHOT.tar.gz
-+ (3) 修改配置文件,将manager-web/conf中的配置文件, 以application.yml中profile.active=dev为例,将application-dev.yml文件按真实内容修改
-+ (4)启动服务,执行bin目录下的start.sh脚本,观察日志manager-web/log/manager-web.log和后端端口是否正常监听,manager-web默认使用8083端口
+3) 进入解压后的目录,执行 `sh bin/start.sh` 启动服务,查看日志 `log/manager-web.log`,若出现类似下面的日志,说明服务启动成功:
 
-## 3.2 manager-openapi部署
-+ (1) 找到安装包,进入 /apache-inlong/inlong-manager/manager-openapi/target 找到 manager-openapi-xxx-incubating-SNAPSHOT.tar.gz
-+ (2) 部署安装包,压到即将部署服务的服务器对应目录  tar -zxvf manager-web-0.9.0-incubating-SNAPSHOT.tar.gz
-+ (3)修改配置文件,将manager-openapi/conf中的配置文件, 以application.yml中profile.active=dev为例,将配置application-dev.yml文件内容改为真实内容
-+ (4)启动服务,执行bin目录下的start.sh脚本,观察日志manager-openapi/log/manager-openapi.log和后端端口是否正常监听,manager-openapi默认使用8082端口
+   ```shell
+   Started InLongWebApplication in 6.795 seconds (JVM running for 7.565)
+   ```
 
+## 4.2 部署 manager-openapi
 
-## 3.3 后端配置详解
-+ `manager-web/conf/application-xx.yml` 示例
+1) 将上面打好的 tar 包 `inlong-manager/manager-openapi/target/apache-inlong-manager-openapi-*.tar.gz` 拷贝到要部署的服务器;
 
-```yml
+2) 前往部署服务器,解压安装包:`tar -zxvf apache-inlong-manager-openapi-*.tar.gz`;
 
-logging:
-  level:
-    root: INFO
-    org:
-      apache:
-        inlong:
-          manager:
-            dao:
-              mapper: debug
-            third:
-              debug
+3) 进入解压后的目录,执行 `sh bin/start.sh` 启动服务,查看日志 `log/manager-openapi.log`,若出现类似下面的日志,说明服务启动成功:
 
-spring:
-  datasource:
-    jdbc-url: jdbc:mysql://127.0.0.1:3306/apache_inlong_manager?serverTimezone=GMT%2b8&useSSL=false&allowPublicKeyRetrieval=true&characterEncoding=UTF-8&nullCatalogMeansCurrent=true
-    username: xxxxxx
-    password: xxxxxx
-    driver-class-name: com.mysql.cj.jdbc.Driver
-    type: com.alibaba.druid.pool.DruidDataSource
-    druid:
-      # Configure test query
-      validationQuery: SELECT 'x'
-      # Initialization size, minimum, maximum
-      initialSize: 20
-      minIdle: 20
-      maxActive: 300
-      # Configure the timeout period to wait for the connection to be acquired
-      maxWait: 600000
-      # Configure the minimum survival time of a connection in the pool, in milliseconds
-      minEvictableIdleTimeMillis: 3600000
-      # Detect when applying for connection. It is recommended to configure it to true, which does not affect performance and ensures safety
-      testWhileIdle: true
-      # Perform detection when obtaining a connection, it is recommended to close it, which affects performance
-      testOnBorrow: false
-      # Perform detection when returning the connection, it is recommended to close it, which affects performance
-      testOnReturn: false
-      # Configure filters for monitoring statistics interception,stat:Monitoring statistics  log4j:log  wall:Defense against SQL injection
-      filters: stat,wall
-      # Open the mergeSql function through the connectProperties property;Slow SQL records
-      connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
-
-# InLong configuration
-inlong:
-  schedule:
-    user:
-      enable: false
-      update-cron: '0 0 2 * * ?'
-  common:
-    machineNum: 1
-    path: ~/
-    modules:
-      - agent
-
-# Cluster info
-cluster:
-  tube:
-    manager: http://127.0.0.1:8081
-    master: 127.0.0.1:8000,127.0.0.1:8010
-  zk:
-    url: 127.0.0.1:2181
-    root: inlong_hive
-  hive:
-    metastoreAddress: jdbc:mysql://127.0.0.1:3306/hive?useSSL=false
+   ```shell
+   Started InLongOpenApiApplication in 5.341 seconds (JVM running for 6.002)
+   ```
 
-```
+## 4.3 服务访问验证
+
+1) 验证 manager-web 服务:
+
+   访问地址:<http://x.x.x.x:8083/api/inlong/manager/doc.html#/home>
+
+   将 `x.x.x.x` 修改为 manager-web 服务对应的 IP 地址,端口号默认是 8083。
 
-## 3.4 后台服务验证:
+2) 验证 manager-openapi 服务:
 
-<http://x.x.x.x:8083/api/inlong/manager/doc.html#/home>
+   访问地址:<http://x.x.x.x:8082/openapi/inlong/manager/doc.html#/home>
 
-其中 `x.x.x.x` 修改为manager-web所部署的机器IP地址
+   将 `x.x.x.x` 修改为 manager-openapi 服务对应的 IP 地址,端口号默认是 8082。