Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
ahaoyao committed Aug 10, 2023
1 parent f60a68c commit 8b05ab4
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 51 deletions.
6 changes: 3 additions & 3 deletions blog/2023-07-28-gateway-process-analysis.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ GateWay adopts Reactive programming of webFlux, and its whole process is similar
### flow chart

![](/static/Images/gateway/flow-chart.png)
![](/Images/gateway/flow-chart.png)


### Linkis 1.3.2 Process Description
Expand All @@ -28,7 +28,7 @@ Authenticate SecurityFilter. doFilter ->Parse phase to determine Application Nam
```
Simplify the process as follows:

![](/static/Images/gateway/simplify-the-process.png)
![](/Images/gateway/simplify-the-process.png)

### Authentication
In terms of functionality, the core SecurityFilter.doFilter method is separated from authentication, and the main operations include:
Expand All @@ -50,7 +50,7 @@ Special note: All parses are executed serially and will not interrupt, so the re
#### General Parse processing
- DefaultGatewayParser
After calling the custom parse class for processing, it also performs general processing. When there is no ServiceInstance, it will match the ServiceInstance (publicservice, metadataquery, etc.) with general rules based on the RequestURI. Alternatively, it can be understood that if the parse implementation is written separately, it is a service that requires special processing.
![](/static/Images/gateway/general-parse-processing.png)
![](/Images/gateway/general-parse-processing.png)

### Route stage
The Route stage mainly determines the Instance
Expand Down
8 changes: 4 additions & 4 deletions blog/2023-08-03-analysis-of-engine-material-mg-function.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Analysis of the Material Management Function of the Linkis Engine
title: Source Code Interpretation-Analysis of the Material Management Function of the Linkis Engine
---
### Catalog Guide

Expand All @@ -10,7 +10,7 @@ Introduction: This article takes the engine related material management process
#### 1. BML Material Warehouse Service

The BML material library is a functional module under the Public Enhancement Service (PS) - public enhanced service architecture in Linkis.
![](/static/Images/blog/public-enhancement-service.png)
![](/Images/blog/public-enhancement-service.png)

In the architecture system of Linkis, the concept of materials refers to various file data that is uniformly stored and managed, including script code, resource files, third-party jars, relevant class libraries and configuration files required for engine startup, and keytab files used for security authentication.

Expand All @@ -25,13 +25,13 @@ The material file adopts an appending method, which can merge multiple versions
Material service provides lifecycle management for operational tasks such as file upload, update, and download. At the same time, there are two forms of using material services: rest interface and SDK, and users can choose according to their own needs.

The BML architecture diagram is as follows:
![](/static/Images/blog/bml-service.png)
![](/Images/blog/bml-service.png)

The above overview of BML architecture can be found in the official website documentation:https://linkis.apache.org/zh-CN/docs/latest/architecture/public_enhancement_services/bml

#### 2. BML Material Warehouse Service Bottom Table Model
Before delving into the process details of BML material management, it is necessary to first sort out the database table models that BML material management services rely on at the bottom.
![](/static/Images/blog/linkis-ps-bml.png)
![](/Images/blog/linkis-ps-bml.png)

Linkis that can be combined with Linkis_ The ddl. SQL file and the engine material upload and update process described in the following content are used to understand the field meanings of bml resources related tables and the field relationships between tables.

Expand Down
19 changes: 6 additions & 13 deletions blog/2023-08-03-cdh-linkis-dss.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
---
title: [Practical Experience] Deploying Linkis1.1.1 and DSS1.1.0 based on CDH6.3.2
authors: [Casion]
tags: [blog,linkis1.1.1,cdh]
title: Practical Experience-Deploying Linkis1.1.1 and DSS1.1.0 based on CDH6.3.2
---
### Preface

Expand Down Expand Up @@ -73,14 +71,14 @@ wds.linkis.keytab.host.enabled=false
wds.linkis.keytab.host=your_host
```
2、Starting an error after replacing the Hadoop dependency package: java.lang.NoClassDefFoundError:org/apache/commons/configuration2/Configuration
![](/static/Images/blog/hadoop-start-error.png)
![](/Images/blog/hadoop-start-error.png)
Reason: Configuration class conflict, add a commons configuration 2-2.1.1.jar under the linkis commons module to resolve the conflict
3、Running Spark, Python, etc. in the script reports an error of no plugin for XXX
Phenomenon: After modifying the Spark/Python version in the configuration file, starting the engine reports an error of no plugin for XXX
![](/static/Images/blog/no-plugin-error.png)
![](/Images/blog/no-plugin-error.png)
Reason: The versions of the engine have been written dead in the LabelCommonConfig.java and GovernanceCommonConf.scala classes. The corresponding versions have been modified, and after compilation, all jars containing these two classes (linkis computation governance common-1.1.1. jar and linkis label common-1.1.1. jar) have been replaced in linkis and other components (including schedules)
Expand All @@ -92,21 +90,16 @@ Reason: The versions of the engine have been written dead in the LabelCommonConf
pythonVersion=/usr/local/bin/python3.6
```
5、Failed to run pyspark task and reported an error
![](/static/Images/blog/pyspark-task-error.png)
![](/Images/blog/pyspark-task-error.png)
Reason: PYSPARK not set VERSION
Solution:
Set two parameters under/etc/profile
```
export PYSPARK_PYTHON=/usr/local/bin/python3.6

export PYSPARK_DRIVER_PYTHON=/usr/local/bin/python3.6
```
6、Error in executing pyspark task
java.lang.NoSuchFieldError: HIVE_STATS_JDBC_TIMEOUT
![](/static/Images/blog/pyspark-no-such-field-error.png)
![](/Images/blog/pyspark-no-such-field-error.png)
Reason: Spark2.4.8 uses the hive1.2.1 package, but our hive has been upgraded to version 2.1.1. This parameter has been removed from hive2, and the code in Spark-SQL still needs to call this parameter of hive, resulting in an error,
So HIVE was removed from the spark SQL/live code_ STATS_ JDBC_ The TIMEOUT parameter is recompiled and packaged to replace the spark hive in Spark2.4.8_ 2.11-2.4.8.jar
Expand All @@ -117,7 +110,7 @@ Phenomenon: User A was used to execute a jdbc task 1, and the engine selected it
Analyze the reason:
ConnectionManager::getConnection
![](/static/Images/blog/jdbc-connection-manager.png)
![](/Images/blog/jdbc-connection-manager.png)
When creating a datasource here, it is determined whether to create it based on the key, which is a jdbc URL. However, this granularity may be a bit large because different users may access the same datasource, such as hive. Their URLs are the same, but their account passwords are different. Therefore, when the first user creates a datasource, the username is already specified, and when the second user enters, When this data source was found to exist, it was directly used instead of creating a new datasource, resulting in the code submitted by user B being executed through A.
Solution: Reduce the key granularity of the data source cache map and change it to jdbc. URL+jdbc. user.
Expand Down
14 changes: 6 additions & 8 deletions blog/2023-08-03-entrance-execution-analysis.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
---
title: [Source Code Interpretation] Linkis1.1.1 Entry Execution Analysis
authors: [Casion]
tags: [blog,linkis1.1.1,entrance]
title: Source Code Interpretation-Linkis1.1.1 Entry Execution Analysis
---
### Preface

The following is a diagram based on the source code analysis of Linkisv1.1.1: Entry service execution process.
All subsequent explanations revolve around this picture, so when reading the explanation, please refer to the entire picture to understand. The explanation idea is to break the whole into parts, accumulate points into lines, and gather lines into surfaces.
![](/static/Images/blog/entry-service-execution-process.jpg)
![](/Images/blog/entry-service-execution-process.jpg)

Roughly divide the above figure into:
Environment initialization area: The EntranceContext that needs to be initialized when the entire Entrance service starts
Submit task area: Users call the EntranceRestfulApi interface to submit tasks, as well as job construction, interceptor operations, etc
Execution area: The job submitted from the submission area contains all operations throughout the entire job lifecycle
![](/static/Images/blog/entrance-context.png)
![](/Images/blog/entrance-context.png)

### Environment initialization area
![](/static/Images/blog/env-init.png)
![](/Images/blog/env-init.png)
```
The Entry function is finely divided and each performs its own duties, making it easy to expand. The injection of the entire environment can be viewed in the EnteranceSpringConfiguration configuration class, which is introduced from left to right in sequence below
Expand All @@ -39,7 +37,7 @@ EnteranceEventListenerBus event listener service: a general event listener servi
```

### Submit Task Area
![](/static/Images/blog/submit-task.png)
![](/Images/blog/submit-task.png)
```
Mainly explained by the user calling the execute() method of EnteranceRestfulApi. There are mainly four important steps
Expand All @@ -50,7 +48,7 @@ Submit the job to the scheduler to obtain the execId
```

### Execution region
![](/static/Images/blog/excute-area.png)
![](/Images/blog/excute-area.png)
```
ParallelGroup: Stores some parameters that FIFOUserConsumer will use, but parameter changes should not take effect in real time
Expand Down
6 changes: 2 additions & 4 deletions blog/2023-08-03-linkis-dss-ansible.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
---
title: [Installation and Deployment] Linkis1.3.0+DSS1.1.1 Ansible Single Machine One Click Installation Script
authors: [Casion]
tags: [blog,linkis1.3.0,ansible]
title: Installation and Deployment-Linkis1.3.0+DSS1.1.1 Ansible Single Machine One Click Installation Script
---
### 一、Brief Introduction

Expand Down Expand Up @@ -95,7 +93,7 @@ ok: [dss-service] => {
}
```
After execution, you can access: http://192.168.1.52 View the information page, which records the access addresses and account passwords of all services.
![](/static/Images/blog/view-information-page.png)
![](/Images/blog/view-information-page.png)

#### 3.3 Deploy other services
```
Expand Down
36 changes: 17 additions & 19 deletions blog/2023-08-03-linkis-dss-compile-deployment.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
---
title: [Development Experience] Compilation to Deployment of Apache Linkis+DSS
authors: [Casion]
tags: [blog,linkis,dss]
title: Development Experience-Compilation to Deployment of Apache Linkis+DSS
---
### Background

With the development of our business and the updating and iteration of community products, we have found that linkis1.2.0 and dss1.1.1 can better meet our needs for real-time data warehousing and machine learning. Compared to the currently used linkis 0.9.3 and dss 0.7.0, there have been significant structural adjustments and design optimizations in task scheduling and plugin access. Based on the above reasons, we now need to upgrade the existing version. Due to the large version span, our upgrade idea is to redeploy a new version and migrate the original business data. The following are specific practical operations, hoping to provide reference for everyone.

### Obtain source code
![](/static/Images/blog/resource-code.png)
![](/Images/blog/resource-code.png)

```
git clone [email protected]:yourgithub/incubator-linkis.git
Expand Down Expand Up @@ -119,7 +117,7 @@ Install the new version of links1.2.0 and dss1.1.0 on the app machine first. Kee

#### Collect installation package

![](/static/Images/blog/collect-installation-package.png)
![](/Images/blog/collect-installation-package.png)

#### Install MySQL
```
Expand All @@ -132,7 +130,7 @@ tar zxvf apache-linkis-1.2.0-incubating-bin.tar.gz -C linkis
cd linkis
vi deploy-config/db.sh # Configuration database
```
![](/static/Images/blog/install-linkis.png)
![](/Images/blog/install-linkis.png)

Key parameter configuration
```
Expand Down Expand Up @@ -170,7 +168,7 @@ Implement safety insurance chekcEnv.sh
```
bin]# ./checkEnv.sh
```
![](/static/Images/blog/check-env.png)
![](/Images/blog/check-env.png)
Because I am using the Docker locally to install MySQL, I need to install an additional MySQL client
```
wget https://repo.mysql.com//mysql80-community-release-el7-7.noarch.rpm
Expand All @@ -190,16 +188,16 @@ Attempt to install linkis
```
sh bin/install.sh
```
![](/static/Images/blog/sh-bin-install-sh.png)
![](/Images/blog/sh-bin-install-sh.png)
Open the management interface of Spark2 in Ambari, add environment variables, and restart the related services of Spark2
![](/static/Images/blog/advanced-spark2-env.png)
![](/Images/blog/advanced-spark2-env.png)
Finally passed verification
![](/static/Images/blog/check-env1.png)
![](/Images/blog/check-env1.png)
```
sh bin/install.sh
```
For the first installation, the database needs to be initialized. Simply select 2
![](/static/Images/blog/data-source-init-choose-2.png)
![](/Images/blog/data-source-init-choose-2.png)

According to the official website prompt, you need to download the MySQL driver package yourself and place it in the corresponding directory. I used to check and found that there is already a MySQL package. It should be because the MySQL scope was removed during the previous compilation, but the version is incorrect. We are using 5.7 in production, but the driver is the MySQL 8 driver package. So it's best to adjust the MySQL driver version first when compiling.![](/static/Images/blog/choose-true-mysql-version.png)

Expand All @@ -213,7 +211,7 @@ mv mysql-connector-java-8.0.28.jar mysql-connector-java-8.0.28.jar.bak#需要cd
sh sbin/linkis-start-all.sh
```
Browser Open,http://app:20303/,There are a total of 10 services, and it seems like there is no problem
![](/static/Images/blog/open-eureka-service.png)
![](/Images/blog/open-eureka-service.png)

#### Installing linkis-web
```
Expand All @@ -229,16 +227,16 @@ user root; # Change the default user to their own root
nginx -s reload
```
Visiting again seems to be correct
![](/static/Images/blog/login.png)
![](/Images/blog/login.png)

View default username and password
```
cat LinkisInstall/conf/linkis-mg-gateway.properties
```
![](/static/Images/blog/linkis-mg-gateway.png)
![](/Images/blog/linkis-mg-gateway.png)

Log in to the linkis management console
![](/static/Images/blog/linkis-console.png)
![](/Images/blog/linkis-console.png)

Quick verification using linkis cli
```
Expand All @@ -256,7 +254,7 @@ errDesc: 21304, Task is Failed,errorMsg: errCode: 12003 ,desc: app:9101_4 Failed
```

Management Console View Log Information
![](/static/Images/blog/console-log-info.png)
![](/Images/blog/console-log-info.png)

My hive uses the Tez engine, and I need to manually copy the Tez engine related packages to the hive plugin's lib
```
Expand All @@ -266,7 +264,7 @@ sh bin/linkis-cli -submitUser root -engineType hive-3.1.0 -codeType hql -code "s
```

Running again, but still not running, seems to be missing Jackson's library
![](/static/Images/blog/miss-jackson-jar.png)
![](/Images/blog/miss-jackson-jar.png)

```
// Links commons/links hadoop common needs to be added manually, dependencies need to be added and repackaged
Expand Down Expand Up @@ -328,7 +326,7 @@ Run again, run successfully, and there seems to be no problem with the deploymen
Explanation: Since DSS was installed by another colleague, I will not show it here. For details, please refer to the installation on the official website. Here, I will mainly explain the problems encountered during the integration of DSS and Linkis.
1. When logging in to dss, the log of linkis mg gateway displays TooManyServiceException
As shown in the figure:
![](/static/Images/blog/install-dss.png)
![](/Images/blog/install-dss.png)
The specific logs in the gateway are as follows
```
2022-11-11 11:27:06.194 [WARN ] [reactor-http-epoll-6 ] o.a.l.g.r.DefaultGatewayRouter (129) [apply] - org.apache.linkis.gateway.exception.TooManyServiceException: errCode: 11010 ,desc: Cannot find a correct serviceId for parsedServiceId dss, service list is: List(dss-framework-project-server, dss-apiservice-server, dss-scriptis-server, dss-framework-orchestrator-server-dev, dss-flow-entrance, dss-guide-server, dss-workflow-server-dev) ,ip: app ,port: 9001 ,serviceKind: linkis-mg-gateway
Expand All @@ -337,7 +335,7 @@ Explanation: Since DSS was installed by another colleague, I will not show it he
at org.apache.linkis.gateway.route.AbstractGatewayRouter.findService(GatewayRouter.scala:70) ~[linkis-gatew
```
The general idea is that the dss cannot be found. Coincidentally, I found a piece of gawayParser code under the plugin in the dss and tried to copy it to the case COMMON of the parse method in the GatewayParser_ Before REGEX, introduce dependent methods, variables, and packages based on compilation prompts. As shown in the figure:
![](/static/Images/blog/gateway-parse-code.png)
![](/Images/blog/gateway-parse-code.png)

Successfully logged in (remember to restart the mg geteway service on linkis).

Expand Down

0 comments on commit 8b05ab4

Please sign in to comment.