Debugging related

Before version 1.0.3, linkis has not yet entered apache incubation. The organization still belongs to webank. The package name of the main class is `org.apache.linkis`. Pay attention to the distinction when debugging.

For the configuration file under incubator-linkis/assembly-combined-package/assembly-combined/conf/, you need to configure the database and hive meta and other necessary startup parameters.

In order to facilitate the printing of logs to the console during debugging, you need to modify the default log4j2.xml file and modify the appender to default to console. You need to remove the append of the default RollingFile and add the appender of the console, as shown below: log4j2.xml path incubator-linkis/assembly-combined-package/assembly-combined/conf/log4j2.xml

  1. <configuration status="error" monitorInterval="30">
  2. <appenders>
  3. <RollingFile name="RollingFile" append="false" fileName="logs/${sys:serviceName}.log"
  4. filePattern="logs/$${date:yyyy-MM}/${sys:serviceName}/linkis-log-%d{yyyy-MM-dd}-%i.log">
  5. <PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} [%-5level] [%-40t] %c{1.} (%L) [%M]-%msg%xEx %n"/>
  6. <SizeBasedTriggeringPolicy size="100MB"/>
  7. <DefaultRolloverStrategy max="10"/>
  8. </RollingFile>
  9. <Console name="Console" target="SYSTEM_OUT">
  10. <ThresholdFilter level="INFO" onMatch="ACCEPT" onMismatch="DENY"/>
  11. <PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level [%t] %logger{36} %L %M-%msg%xEx%n"/>
  12. </Console>
  13. </appenders>
  14. <loggers>
  15. <appender-ref ref="RollingFile"/>
  16. <appender-ref ref="Console"/>
  17. </root>
  18. </loggers>
  19. </configuration>

Both Linkis and DSS services rely on Eureka, so you need to start the Eureka service first, and the Eureka service can also use the Eureka you have started. After Eureka is started, other services can be started.

Because linkis internally uses the -DserviceName parameter to set the application name and the configuration file used, so -DserviceName is a necessary startup VM parameter

By checking Include dependencies with “Provided” scope, you can introduce provided-level dependency packages during debugging.

Microservice Governance Services component

  1. [main Class]
  2. org.apache.linkis.eureka.SpringCloudEurekaApplication
  3. [VM Opitons]
  4. -DserviceName=linkis-mg-eureka -Xbootclasspath/a:D:\yourDir\incubator-linkis\assembly-combined-package\assembly-combined\conf
  5. [Program arguments]
  6. --spring.profiles.active=eureka --eureka.instance.preferIpAddress=true
  7. [User classpath of module]
  8. linkis-eureka

If you don’t want the default port 20303, you can modify the port configuration:

The specific configuration is as follows Linkis Debug - 图2

Linkis-mg-gateway startup configuration

  1. [main Class]
  2. org.apache.linkis.gateway.springcloud.LinkisGatewayApplication
  3. [VM Opitons]
  4. -DserviceName=linkis-mg-gateway -Xbootclasspath/a:D:\yourDir\incubator-linkis\assembly-combined-package\assembly-combined\conf
  5. [User classpath of module]
  6. linkis-gateway-server-support

Note If there is a problem of’org.apache.logging.log4j.LoggingException: log4j-slf4j-impl cannot be present with log4j-to-slf4j’ Please exclude, the dependency on spring-boot-starter-logging

Public Enhancement Services component

  1. org.apache.linkis.jobhistory.LinkisPublicServiceApp
  2. -DserviceName=linkis-ps-publicservice -Xbootclasspath/a:D:\yourDir\incubator-linkis\assembly-combined-package\assembly-combined\conf
  3. [User classpath of module]
  4. linkis-jobhistory

Linkis-ps-cs startup configuration

Computation Governance Services component

  1. [main Class]
  2. org.apache.linkis.manager.am.LinkisManagerApplication
  3. [VM Opitons]
  4. -DserviceName=linkis-cg-linkismanager -Xbootclasspath/a:D:\yourDir\incubator-linkis\assembly-combined-package\assembly-combined\conf
  5. [User classpath of module]
  6. linkis-application-manager

linkis-cg-entrance start

  1. [main Class]
  2. org.apache.linkis.entrance.LinkisEntranceApplication
  3. [VM Opitons]
  4. -DserviceName=linkis-cg-entrance -Xbootclasspath/a:D:\yourDir\incubator-linkis\assembly-combined-package\assembly-combined\conf
  5. [User classpath of module]

Note: Windows local debugging service is not currently supported

linkis-cg-engineplugin(ecp): Need to read local ecp materials, local debugging needs to prepare the corresponding materials first, it is recommended to debug remotely

todo