When we are in openLooKeng project tasks, many situations need to be developed and debugged under openLooKeng, but what should we do if we only have Windows computers? In this issue, the little assistant will introduce the method of setting up openLooKeng development environment under Windows, hope to help friends. If you have anything you want to communicate, feel free to make an Issue in the community. Also welcome to add small assistant wechat, into the exclusive technical exchange group.

Welcome to the official websiteopenlookeng.io


Set up openLooKeng development environment

(win run presto)

First, make sure you have git clone permission for the code, preferably the clone code, otherwise, there will be configuration problems later

(1) Environmental dependence

  • JDK: 1.8 (8U161 +) 64bit

  • Maven: 3.3.9

    If the source package is directly downloaded from Github, you need to perform the following operations:

    1.Go to the source directory2.In the <build> <pluginManagement> element, add the following configuration:<groupId>pl.project13.maven</groupId>        
        <artifactId>git-commit-id-plugin</artifactId>        
        <configuration>            
            <skip>true</skip>        
        </configuration>    
    </plugin>
    Copy the code

    Do not add the following error:

    Failed to execute goal pl.project13.maven:git-commit-id-plugin:3.01.:revision (default) on project hetu-common: .git directory is not found! Please specify a valid [dotGitDirectory] in your pom.xml
    
    Copy the code

    If you clone code from Github, you don’t need to do this.

  • Change the code bin:

    In Maven setting, modify:

    <mirror>
          <id>alimaven</id>
          <name>aliyun maven</name>
          <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
          <mirrorOf>central</mirrorOf>        
        </mirror>
    Copy the code

    Mirror warehouse.

 <localRepository>D:\document\Maven\repository</localRepository>
Copy the code

This is my local warehouse address

(2) Compilation

2.1 Preparations before Compilation

  1. presto-main/etc/event-listener.properties

    - hetu.event.listener.type=AUDIT
    + hetu.event.listener.type=LOGGER
    Copy the code
  2. presto-main/src/main/java/io/prestosql/server/PluginDiscovery.java

    - if(! file.getPath().endsWith("/target/classes"))
    + if(! file.getPath().replace('\ \'.'/').endsWith("/target/classes"))
    Copy the code

    Path characters change in the WIN system

  3. presto-main/src/main/java/io/prestosql/server/PrestoSystemRequirements.java

    Note:

else {
    failRequirement("Hetu requires Linux or Mac OS X (found %s)", osName);
}
Copy the code

In fact, comments can be modified:

Modification:

// Comment out the operating system constraints and change to warnRequirement
// failRequirement("Presto requires Linux or Mac OS X (found %s)", osName);
warnRequirement("Presto requires Linux or Mac OS X (found %s)", osName);
Copy the code

Either comment or modify

  1. presto-main/src/main/java/io/prestosql/server/PrestoSystemRequirements.java

Modification:

- Object maxFileDescriptorCount = mbeanServer.getAttribute(ObjectName.getInstance(OPERATING_SYSTEM_MXBEAN_NAME), "MaxFileDescriptorCount");
+ Object maxFileDescriptorCount = 10000;
Copy the code
  1. presto-main/pom.xml

Comment out exclusions in the dependency of IO. Airlift. resolver

        <dependency>
            <groupId>io.airlift.resolver</groupId>
            <artifactId>resolver</artifactId><! --<exclusions>-->
<! -- <exclusion>-->
<! -- <artifactId>netty</artifactId>-->
<! -- <groupId>io.netty</groupId>-->
<! -- </exclusion>-->
<! -- <exclusion>-->
<! -- <artifactId>async-http-client</artifactId>-->
<! -- <groupId>com.ning</groupId>-->
<! -- </exclusion>-->
<! -- <exclusion>-->
<! -- <artifactId>maven-compat</artifactId>-->
<! -- <groupId>org.apache.maven</groupId>-->
<! -- </exclusion>-->
<! -- </exclusions>-->
        </dependency>
Copy the code

Comment out the dependency:

(If not annotated later will be wrong), you can refer to the appendix to learn

<! --<dependency>-->
<! -- <groupId>org.apache.maven</groupId>-->
<! -- <artifactId>maven-compat</artifactId>-->
<! - < version > 3.5.0 < / version > -- >
<! -- <scope>runtime</scope>-->
<! -- <exclusions>-->
<! -- <exclusion>-->
<! -- <artifactId>maven-core</artifactId>-->
<! -- <groupId>org.apache.maven</groupId>-->
<! -- </exclusion>-->
<! -- <exclusion>-->
<! -- <artifactId>maven-model</artifactId>-->
<! -- <groupId>org.apache.maven</groupId>-->
<! -- </exclusion>-->
<! -- <exclusion>-->
<! -- <artifactId>maven-repository-metadata</artifactId>-->
<! -- <groupId>org.apache.maven</groupId>-->
<! -- </exclusion>-->
<! -- <exclusion>-->
<! -- <artifactId>plexus-classworlds</artifactId>-->
<! -- <groupId>org.codehaus.plexus</groupId>-->
<! -- </exclusion>-->
<! -- <exclusion>-->
<! -- <artifactId>jsr250-api</artifactId>-->
<! -- <groupId>javax.annotation</groupId>-->
<! -- </exclusion>-->
<! -- <exclusion>-->
<! -- <artifactId>maven-resolver-provider</artifactId>-->
<! -- <groupId>org.apache.maven</groupId>-->
<! -- </exclusion>-->
<! -- <exclusion>-->
<! -- <artifactId>org.eclipse.sisu.plexus</artifactId>-->
<! -- <groupId>org.eclipse.sisu</groupId>-->
<! -- </exclusion>-->
<! -- <exclusion>-->
<! -- <artifactId>maven-resolver-api</artifactId>-->
<! -- <groupId>org.apache.maven.resolver</groupId>-->
<! -- </exclusion>-->
<! -- <exclusion>-->
<! -- <artifactId>maven-resolver-impl</artifactId>-->
<! -- <groupId>org.apache.maven.resolver</groupId>-->
<! -- </exclusion>-->
<! -- <exclusion>-->
<! -- <artifactId>maven-resolver-spi</artifactId>-->
<! -- <groupId>org.apache.maven.resolver</groupId>-->
<! -- </exclusion>-->
<! -- <exclusion>-->
<! -- <artifactId>maven-resolver-util</artifactId>-->
<! -- <groupId>org.apache.maven.resolver</groupId>-->
<! -- </exclusion>-->
<! -- </exclusions>-->
<! -- </dependency>-->
Copy the code

If not commented, an error is reported:

org.codehaus.plexus.component.repository.exception.ComponentLifecycleException: Error constructing component role: 'org.apache.maven.repository.RepositorySystem', implementation: 'org.apache.maven.repository.legacy.LegacyRepositorySystem', role hint: 'default'
Copy the code
  1. presto-main/etc/config.properties

Delete hive and Oracle plug-ins from plugin.bundles:

Running Hive and Oracal in Win requires additional plugins. There will be time to fix this later).

-.. /presto-hive-hadoop2/pom.xml,\ - .. /hetu-oracle/pom.xml, \Copy the code
  1. presto-main/etc/catalog/

    Hive and Oracle can be used only after the related programs are installed on Windows. In this section, delete the Hive and Oracle configuration files

    CD presto-main/etc/catalog/ mv hive.properties. Bak mv oracle.properties oracle.properties.bakCopy the code

2.2 Compile build

 mvn clean package -DskipTests
Copy the code

Here is another way to compile a build if you run into the following problems:

Problem: There are check errors and other check errors when packing. MVN Clean install-dskipTests cannot skip check, it needs to be added to hetu-core poM properties

<air.check.skip-extended>true</air.check.skip-extended>
Copy the code

Then execute:

mvn clean install -Dcheckstyle.skip=true -DskipTests  
Copy the code

Compile result:

(3) Operation

3.1 Preparation before operation

1) open the idea

2)Crtl+Alt+S to enter the Settings page (File-Settings)

  • Build,Excution,Deployment > Complier > JavaComplier

  • Deselect Use ‘– release’ option for corss-compilation

  • Set project bytecode version to 8

  1. Operation parameter Setting

run->edit confurations

Main class : -ea -XX:+UseG1GC -XX:G1HeapRegionSize=32M -XX:+UseGCOverheadLimit -XX:+ExplicitGCInvokesConcurrent -Xmx2G -Dconfig=etc/config.properties -Dlog.levels-file=etc/log.properties -Duser.home=D:\document\Maven Working directory: $MODULE_DIR$Use classpath of module: presto-main Note -duser. home=D:/Marven is the parent directory of the maven repository. M2 folder, and the last two directories must be repositor /.m2/Copy the code

-duser. home=D: document\Maven -duser. home=D: document\Maven

Caused by: org.apache.maven.project.ProjectBuildingException: 1 problem was encountered while building the effective model for IO. Hetu. core:presto-resource-group-managers: 1.2.0-snapshot [FATAL] non-resolvable parent POM for IO. Hetu. Core: presto - root: 1.2.0 - the SNAPSHOT: Could not transfer artifact io.airlift:airbase:pom:97 from/to central (http://repo.maven.apache.org/maven2): connection timed out to http://repo.maven.apache.org/maven2/io/airlift/airbase/97/airbase-97.pom and 'parent-relativePath' points at wrong local [email protected]. core:presto-root: 1.2.0-snapshot, D:\document\hetu-core\pom.xml, line 6, Column 13 for project io.hetu.core: Presto-resource-group-managers :1.2.0-SNAPSHOT at D: document\ Hetu-core \ Presto-main \.. \presto-resource-group-managers\pom.xmlCopy the code

4)presto-main\etc\config.properties

Add:

hetu.queryeditor-ui.allow-insecure-over-http=true
Copy the code

HTTP insecure error:

3.2 Running Results

Click Run on IDEA and type http://localhost:8080/ in your browser

(4) Enter openLooKeng

OpenLooKeng Java -jar presto-cli/target/hetu-cli-*-executable. Jar --server localhost:8080 SHOW CATALOGS; SHOW SCHEMAS FROM jmx; use jmx.current; show tables;Copy the code

Normal GUI query:

Solutions to other problems:

Question 1:

Failed to execute goal org.skife. Maven :really executable-jar-maven-plugin:1.0.5:really executable-jar (default) on project presto-benchmark-driver: FAILURE!Copy the code

Flush out all dependent references directly. There are a lot of modules involved, so I won’t include a screenshot. Search it and note out any quotes.

Question 2:

(imports) UnusedImports: useless import - javax.mail. Management MBeanServer.Copy the code

Enter the specified class and remove this import

Question 3:

When some classes fail to load, reload Maven

Question 4:

Failed to execute goal org, apache maven. Plugins: maven - enforcer - plugin: 3.0.0 - M3: enforce (default) on the project hetu-state-store: Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed. [WARNING] Rule 2: org.apache.maven.plugins.enforcer.BanDuplicatePomDependencyVersions failed with message: Found 1 duplicate dependency declaration in this project: - dependencies.dependency[com.hazelcast:hazelcast:jar] ( 2 times )Copy the code

Duplicate dependency is a duplicate configuration. Delete it if you find it.

Question 5:

1)org.codehaus.plexus.component.repository.exception.ComponentLifecycleException: Error constructing component role: 'org.apache.maven.repository.RepositorySystem', implementation: 'org.apache.maven.repository.legacy.LegacyRepositorySystem', role hint: 'default'

2)Error loading pom......
Copy the code

By positioning:

line356 pomFile .. \presto-resource-group-managers\pom.xml PlexusContainer container = container();Copy the code

Unable to load some JAR packages:

Modification method:

presto-main/pom.xml

Comment out the file:

<! --<dependency>-->
<! -- <groupId>org.apache.maven</groupId>-->
<! -- <artifactId>maven-compat</artifactId>-->
<! - < version > 3.5.0 < / version > -- >
<! -- <scope>runtime</scope>-->
<! -- <exclusions>-->
<! -- <exclusion>-->
<! -- <artifactId>maven-core</artifactId>-->
<! -- <groupId>org.apache.maven</groupId>-->
<! -- </exclusion>-->
<! -- <exclusion>-->
<! -- <artifactId>maven-model</artifactId>-->
<! -- <groupId>org.apache.maven</groupId>-->
<! -- </exclusion>-->
<! -- <exclusion>-->
<! -- <artifactId>maven-repository-metadata</artifactId>-->
<! -- <groupId>org.apache.maven</groupId>-->
<! -- </exclusion>-->
<! -- <exclusion>-->
<! -- <artifactId>plexus-classworlds</artifactId>-->
<! -- <groupId>org.codehaus.plexus</groupId>-->
<! -- </exclusion>-->
<! -- <exclusion>-->
<! -- <artifactId>jsr250-api</artifactId>-->
<! -- <groupId>javax.annotation</groupId>-->
<! -- </exclusion>-->
<! -- <exclusion>-->
<! -- <artifactId>maven-resolver-provider</artifactId>-->
<! -- <groupId>org.apache.maven</groupId>-->
<! -- </exclusion>-->
<! -- <exclusion>-->
<! -- <artifactId>org.eclipse.sisu.plexus</artifactId>-->
<! -- <groupId>org.eclipse.sisu</groupId>-->
<! -- </exclusion>-->
<! -- <exclusion>-->
<! -- <artifactId>maven-resolver-api</artifactId>-->
<! -- <groupId>org.apache.maven.resolver</groupId>-->
<! -- </exclusion>-->
<! -- <exclusion>-->
<! -- <artifactId>maven-resolver-impl</artifactId>-->
<! -- <groupId>org.apache.maven.resolver</groupId>-->
<! -- </exclusion>-->
<! -- <exclusion>-->
<! -- <artifactId>maven-resolver-spi</artifactId>-->
<! -- <groupId>org.apache.maven.resolver</groupId>-->
<! -- </exclusion>-->
<! -- <exclusion>-->
<! -- <artifactId>maven-resolver-util</artifactId>-->
<! -- <groupId>org.apache.maven.resolver</groupId>-->
<! -- </exclusion>-->
<! -- </exclusions>-->
<! -- </dependency>-->
Copy the code

References:

Blog.csdn.net/ren88320036…

Please contact openLooKeng for reprint of this article