手把手教你如何在windows下搭建openLooKeng开发环境

当我们在进行openLooKeng的项目任务时,很多情况下需要在openLooKeng下进行开发调试,但只有windows 电脑的我们该怎么做?本期,小助手将介绍在Windows下搭建openLooKeng开发环境的方法,希望对朋友们有帮助。如果您有任何想要交流的,欢迎在社区内提Issue;也欢迎加小助手微信,进入专属技术交流群。

欢迎访问官网 https://openlookeng.io


在这里插入图片描述

搭建openLooKeng开发环境

(win运行presto)

首先要确认拥有代码的git clone权限,最好是clone的代码,否则,后期会出现配置上的问题

(一)环境依赖

  • JDK: 1.8 (8u161+)64bit

  • Maven: 3.3.9

    如果是直接从github上下载的源码压缩包,则需要做如下配置:

    1. 进入源码根目录 
    2. 修改根目录的pom.xml    
    在<build><pluginManagement>元素中,添加如下配置:    
    <plugin>        
        <groupId>pl.project13.maven</groupId>        
        <artifactId>git-commit-id-plugin</artifactId>        
        <configuration>            
            <skip>true</skip>        
        </configuration>    
    </plugin>
    

    不添加会有如下错误:

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

    如果是从githubclone的代码,则不需要做上述配置。

  • 更换代码仓:

    在maven的setting中,修改:

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

    镜像仓库。

 <localRepository>D:\document\Maven\repository</localRepository>

这是我的本地的仓库地址

(二)编译

2.1编译前准备

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

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

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

    win系统下路径字符的变化

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

    注释:

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

其实注释修改都是可以的:

​ 修改:

// 注释掉对操作系统的限制,更改为:warnRequirement
// failRequirement("Presto requires Linux or Mac OS X (found %s)", osName);
warnRequirement("Presto requires Linux or Mac OS X (found %s)", osName);

注释和修改任选一种

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

修改:

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

注释掉io.airlift.resolver的依赖中的exclusions

        <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
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值