zoukankan      html  css  js  c++  java
  • Elasticsearch 6.7.2 源码编译

    环境:

    git

    jdk12 https://jdk.java.net/java-se-ri/12 解压 配置环境变量

    gradle5.2.1 https://gradle.org/next-steps/?version=5.2.1&format=all 安装 配置环境变量

    idea 2019

    1.源码地址:https://github.com/elastic/elasticsearch

    2.git clone https://github.com/elastic/elasticsearch

    3.git tag -l

    4.git checkout v6.7.2

    5.源码gradle配置

    用户目录./gradle文件夹中新建init.gradle文件

    配置如下内容:

    allprojects {
        repositories {
            def REPOSITORY_URL = 'http://maven.aliyun.com/nexus/content/groups/public/'
            all {
                ArtifactRepository repo ->
        if (repo instanceof MavenArtifactRepository) {
                    def url = repo.url.toString()
                    if (url.startsWith('https://repo.maven.org/maven2') || url.startsWith('https://jcenter.bintray.com/')) {
                        project.logger.lifecycle "Repository ${repo.url} replaced by $REPOSITORY_URL."
                        remove repo
                    }
                }
            }
            maven {
                url REPOSITORY_URL
            }
        }
    }

    6.源码编译:

    gradle 安装包拷贝至源码根目录/gradle/wrapper下

     并修改gradle-wrapper.properties文件内容为:

    distributionUrl=gradle-5.2.1-all.zip

    gradlew idea 

    进入源码根目录doc环境中执行./gradlew idea编译源码  (联网操作)

    尝试过java11和java13均失败

    本地有装hadoop 编译失败

    7.源码打包:未完成

    8.idea源码调试

    idea -》file -》project from existing sources -》源码根目录 -》ok -》Import project from external model -》 Gradle -》auto-import  office work  gradle选到用户目录 

     ERROR: the system property [es.path.conf] must be set

    下载同版本release包解压

    源码根目录下创建home文件夹

    release包的config目录拷贝至上诉文件夹

     idea中做如下配置:

     

    VM options 配置中添加

    -Des.path.conf=D:codecode-zhxelasticsearchhomeconfig

       Exception in thread "main" java.lang.IllegalStateException: path.home is not configured

    VM options 配置中添加

    -Des.path.home=D:codecode-zhxelasticsearchhome

       ERROR Could not register mbeans java.security.AccessControlException: access denied ("javax.management.MBeanTrustPermission" "register")

    VM options 配置中添加

    -Dlog4j2.disable.jmx=true

        org.elasticsearch.bootstrap.StartupException: java.lang.IllegalStateException: modules directory [D:codecode-zhxelasticsearchhomemodules] not found

    release版本的config目录中的modules文件夹放在源码根目录下建的home文件夹

       java.lang.NoClassDefFoundError: org/elasticsearch/plugins/ExtendedPluginsClassLoader 

     

    org.elasticsearch.bootstrap.StartupException: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "createClassLoader")

    源码根目录 /home/config下新建java.policy文件

    并配置如下内容:

    grant {
        permission java.lang.RuntimePermission "createClassLoader";
    };

    并在VM options 配置中添加

    -Djava.security.policy=D:codecode-zhxelasticsearchhomeconfigjava.policy

  • 相关阅读:
    php知识点
    cdnbest里站点域名不同步到节点,报400错误的一般原因
    linux删除历史操作命令
    linux 查看进程启动路径
    Linux中systemctl命令详细介绍
    申请ssl证书报提示caa提示
    开启swap交换分区
    mysql里max_allowed_packet的作用
    抓包工具tcpdump用法说明--1
    echo和print的区别
  • 原文地址:https://www.cnblogs.com/zhxdxf/p/12342244.html
Copyright © 2011-2022 走看看