https://github.com/elastic/elasticsearch/blob/master/CONTRIBUTING.md

不同的版本需要指定JDK

可以下载openJDK版本到服务器上,下载过程比较慢

https://jdk.java.net/archive/

export JAVA_HOME=/xxx/yyy/jdk10.xxx

/gradle assemble

执行命令后

生产的结果在distributions目录下, 启动跟自己下载的版本一样,一样会遇到权限问题,chown xxx -R 目录解决一下

.

├── archives

│   ├── build

│   │   ├── logs-hack

│   │   │   └── logs

│   │   └── plugins-hack

│   │       └── plugins

│   ├── build.gradle

│   ├── integ-test-zip

│   │   ├── build

│   │   │   ├── distributions

│   │   │   │   ├── elasticsearch-6.4.4-SNAPSHOT.pom

│   │   │   │   └── elasticsearch-6.4.4-SNAPSHOT.zip

│   │   │   ├── heapdump

│   │   │   └── publications

│   │   │       ├── nebula

│   │   │       │   └── pom-default.xml

│   │   │       └── nebulaRealPom

│   │   │           └── pom-default.xml

│   │   ├── build.gradle

│   │   └── src

│   │       └── test

│   │           └── java

│   │               └── org

│   │                   └── elasticsearch

│   │                       └── test

│   │                           └── rest

│   │                               ├── CreatedLocationHeaderIT.java

│   │                               ├── DefaultShardsIT.java

│   │                               ├── IntegTestZipClientYamlTestSuiteIT.java

│   │                               ├── NodeRestUsageIT.java

│   │                               ├── RequestsWithoutContentIT.java

│   │                               └── WaitForRefreshAndCloseTests.java

│   ├── oss-tar

│   │   ├── build

│   │   │   └── distributions

│   │   │       └── elasticsearch-oss-6.4.4-SNAPSHOT.tar.gz

│   │   └── build.gradle

│   ├── oss-zip

│   │   ├── build

│   │   │   ├── distributions

│   │   │   │   ├── elasticsearch-oss-6.4.4-SNAPSHOT.pom

│   │   │   │   └── elasticsearch-oss-6.4.4-SNAPSHOT.zip

│   │   │   └── publications

│   │   │       ├── nebula

│   │   │       │   └── pom-default.xml

│   │   │       └── nebulaRealPom

│   │   │           └── pom-default.xml

│   │   └── build.gradle

│   ├── tar

│   │   ├── build

│   │   │   └── distributions

│   │   │       └── elasticsearch-6.4.4-SNAPSHOT.tar.gz

│   │   └── build.gradle

│   └── zip

│       ├── build

│       │   ├── distributions

│       │   │   ├── elasticsearch-6.4.4-SNAPSHOT.pom

│       │   │   └── elasticsearch-6.4.4-SNAPSHOT.zip

│       │   └── publications

│       │       ├── nebula

│       │       │   └── pom-default.xml

│       │       └── nebulaRealPom

│       │           └── pom-default.xml

│       └── build.gradle

├── build

│   ├── cluster

│   │   ├── run\ node0

│   │   │   ├── cwd

│   │   │   └── elasticsearch-6.4.4-SNAPSHOT

│   │   │       ├── bin

│   │   │       │   ├── elasticsearch

│   │   │       │   ├── elasticsearch.bat

│   │   │       │   ├── elasticsearch-certgen

│   │   │       │   ├── elasticsearch-certgen.bat

│   │   │       │   ├── elasticsearch-certutil

│   │   │       │   ├── elasticsearch-certutil.bat

│   │   │       │   ├── elasticsearch-cli

│   │   │       │   ├── elasticsearch-cli.bat

es 的文档告诉大家,请不要把贡献代码作为课程的一部分,希望大家是自愿的贡献代码。同时在之前他们也说明不要为了重构而重构,因为测试,review要花费巨大的资源。如果要提交新的特性,请先开一个issue,讨论是否有必要才开始动手写代码。

Contributing as part of a class

In general Elasticsearch is happy to accept contributions that were created as part of a class but strongly advise against making the contribution as part of the class. So if you have code you wrote for a class feel free to submit it.

Please, please, please do not assign contributing to Elasticsearch as part of a class. If you really want to assign writing code for Elasticsearch as an assignment then the code contributions should be made to your private clone and opening PRs against the primary Elasticsearch clone must be optional, fully voluntary, not for a grade, and without any deadlines.

Because:

  • While the code review process is likely very educational, it can take wildly varying amounts of time depending on who is available, where the change is, and how deep the change is. There is no way to predict how long it will take unless we rush.
  • We do not rush reviews without a very, very good reason. Class deadlines aren't a good enough reason for us to rush reviews.
  • We deeply discourage opening a PR you don't intend to work through the entire code review process because it wastes our time.
  • We don't have the capacity to absorb an entire class full of new contributors, especially when they are unlikely to become long time contributors.

Finally, we require that you run ./gradlew check before submitting a non-documentation contribution. This is mentioned above, but it is worth repeating in this section because it has come up in this context.

FAILURE: Build failed with an exception.

* What went wrong:

Could not determine the dependencies of task ':x-pack:qa:full-cluster-restart:with-system-key:v5.6.15-SNAPSHOT#oldClusterTestCluster#node1.copyBwcPlugins'.

> Could not resolve all task dependencies for configuration ':x-pack:qa:full-cluster-restart:with-system-key:v5.6.15-SNAPSHOT#oldClusterTestCluster_elasticsearchBwcPlugins'.

> Could not resolve org.elasticsearch.plugin:x-pack:5.6.15-SNAPSHOT.

Required by:

project :x-pack:qa:full-cluster-restart:with-system-key

> Could not resolve org.elasticsearch.plugin:x-pack:5.6.15-SNAPSHOT.

> Unable to load Maven meta-data from https://snapshots.elastic.co/maven/org/elasticsearch/plugin/x-pack/5.6.15-SNAPSHOT/maven-metadata.xml.

> Could not get resource 'https://snapshots.elastic.co/maven/org/elasticsearch/plugin/x-pack/5.6.15-SNAPSHOT/maven-metadata.xml'.

> Could not GET 'https://snapshots.elastic.co/maven/org/elasticsearch/plugin/x-pack/5.6.15-SNAPSHOT/maven-metadata.xml'.

> sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

    export JAVA_HOME=/usr/share/jdk1.5.0_05
    export PATH=$JAVA_HOME/bin:$PATH
    export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

    javac InstallCert.java

    java InstallCert

    执行过程中,输入1,在当前目录生成一个文件  
  手动复制到目录:$JAVA_HOME/lib/security/cacerts
/*
* Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* - Neither the name of Sun Microsystems nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ import java.io.*;
import java.net.URL; import java.security.*;
import java.security.cert.*; import javax.net.ssl.*; public class InstallCert { public static void main(String[] args) throws Exception {
String host = "10.0.31.32"; //输入服务端地址
int port = 8443; //输入服务端端口 一般默认443 String p = "changeit"; //一般默认changeit
char[] passphrase = p.toCharArray(); File file = new File("jssecacerts");
if (file.isFile() == false) {
char SEP = File.separatorChar;
File dir = new File(System.getProperty("java.home") + SEP
+ "lib" + SEP + "security");
file = new File(dir, "jssecacerts");
if (file.isFile() == false) {
file = new File(dir, "cacerts");
}
}
System.out.println("Loading KeyStore " + file + "...");
InputStream in = new FileInputStream(file);
KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType());
ks.load(in, passphrase);
in.close(); SSLContext context = SSLContext.getInstance("TLS");
TrustManagerFactory tmf =
TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
tmf.init(ks);
X509TrustManager defaultTrustManager = (X509TrustManager)tmf.getTrustManagers()[0];
SavingTrustManager tm = new SavingTrustManager(defaultTrustManager);
context.init(null, new TrustManager[] {tm}, null);
SSLSocketFactory factory = context.getSocketFactory(); System.out.println("Opening connection to " + host + ":" + port + "...");
SSLSocket socket = (SSLSocket)factory.createSocket(host, port);
socket.setSoTimeout(10000);
try {
System.out.println("Starting SSL handshake...");
socket.startHandshake();
socket.close();
System.out.println();
System.out.println("No errors, certificate is already trusted");
} catch (SSLException e) {
System.out.println();
e.printStackTrace(System.out);
} X509Certificate[] chain = tm.chain;
if (chain == null) {
System.out.println("Could not obtain server certificate chain");
return;
} BufferedReader reader =
new BufferedReader(new InputStreamReader(System.in)); System.out.println();
System.out.println("Server sent " + chain.length + " certificate(s):");
System.out.println();
MessageDigest sha1 = MessageDigest.getInstance("SHA1");
MessageDigest md5 = MessageDigest.getInstance("MD5");
for (int i = 0; i < chain.length; i++) {
X509Certificate cert = chain[i];
System.out.println
(" " + (i + 1) + " Subject " + cert.getSubjectDN());
System.out.println(" Issuer " + cert.getIssuerDN());
sha1.update(cert.getEncoded());
System.out.println(" sha1 " + toHexString(sha1.digest()));
md5.update(cert.getEncoded());
System.out.println(" md5 " + toHexString(md5.digest()));
System.out.println();
} System.out.println("Enter certificate to add to trusted keystore or 'q' to quit: [1]");
String line = reader.readLine().trim();
int k;
try {
k = (line.length() == 0) ? 0 : Integer.parseInt(line) - 1;
} catch (NumberFormatException e) {
System.out.println("KeyStore not changed");
return;
} X509Certificate cert = chain[k];
String alias = host + "-" + (k + 1);
ks.setCertificateEntry(alias, cert); OutputStream out = new FileOutputStream("jssecacerts");
ks.store(out, passphrase);
out.close(); System.out.println();
System.out.println(cert);
System.out.println();
System.out.println
("Added certificate to keystore 'jssecacerts' using alias '"
+ alias + "'");
} private static final char[] HEXDIGITS = "0123456789abcdef".toCharArray(); private static String toHexString(byte[] bytes) {
StringBuilder sb = new StringBuilder(bytes.length * 3);
for (int b : bytes) {
b &= 0xff;
sb.append(HEXDIGITS[b >> 4]);
sb.append(HEXDIGITS[b & 15]);
sb.append(' ');
}
return sb.toString();
} private static class SavingTrustManager implements X509TrustManager { private final X509TrustManager tm;
private X509Certificate[] chain; SavingTrustManager(X509TrustManager tm) {
this.tm = tm;
} public X509Certificate[] getAcceptedIssuers() {
throw new UnsupportedOperationException();
} public void checkClientTrusted(X509Certificate[] chain, String authType)
throws CertificateException {
throw new UnsupportedOperationException();
} public void checkServerTrusted(X509Certificate[] chain, String authType)
throws CertificateException {
this.chain = chain;
tm.checkServerTrusted(chain, authType);
}
} }
---------------------

6.4 分支能编译,能运行起来,但是单元测试老是提示找不到 5.X的一个包,估计是拿来做兼容测试的。

=======================================
Elasticsearch Build Hamster says Hello!
=======================================
Gradle Version : 4.9
OS Info : Linux 3.10.0-862.el7.x86_64 (amd64)
JDK Version : Oracle Corporation 10.0.2 [OpenJDK 64-Bit Server VM 10.0.2+13]
JAVA_HOME : /data/dev/jdk-10.0.2
Random Testing Seed : 9DAA18E0EFB8B8EE

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':x-pack:qa:full-cluster-restart:with-system-key:v5.6.15-SNAPSHOT#oldClusterTestCluster#node1.copyBwcPlugins'.
> Could not resolve all task dependencies for configuration ':x-pack:qa:full-cluster-restart:with-system-key:v5.6.15-SNAPSHOT#oldClusterTestCluster_elasticsearchBwcPlugins'.
> Could not find org.elasticsearch.plugin:x-pack:5.6.15-SNAPSHOT.
Searched in the following locations:
- https://repo.maven.apache.org/maven2/org/elasticsearch/plugin/x-pack/5.6.15-SNAPSHOT/maven-metadata.xml
- https://repo.maven.apache.org/maven2/org/elasticsearch/plugin/x-pack/5.6.15-SNAPSHOT/x-pack-5.6.15-SNAPSHOT.pom
- https://repo.maven.apache.org/maven2/org/elasticsearch/plugin/x-pack/5.6.15-SNAPSHOT/x-pack-5.6.15-SNAPSHOT.zip
- https://artifacts.elastic.co/maven/org/elasticsearch/plugin/x-pack/5.6.15-SNAPSHOT/maven-metadata.xml
- https://artifacts.elastic.co/maven/org/elasticsearch/plugin/x-pack/5.6.15-SNAPSHOT/x-pack-5.6.15-SNAPSHOT.pom
- https://artifacts.elastic.co/maven/org/elasticsearch/plugin/x-pack/5.6.15-SNAPSHOT/x-pack-5.6.15-SNAPSHOT.zip
- https://artifacts.elastic.co/maven/org/elasticsearch/plugin/x-pack/5.6.15-SNAPSHOT/maven-metadata.xml
- https://artifacts.elastic.co/maven/org/elasticsearch/plugin/x-pack/5.6.15-SNAPSHOT/x-pack-5.6.15-SNAPSHOT.pom
- https://artifacts.elastic.co/maven/org/elasticsearch/plugin/x-pack/5.6.15-SNAPSHOT/x-pack-5.6.15-SNAPSHOT.zip
- https://snapshots.elastic.co/maven/org/elasticsearch/plugin/x-pack/5.6.15-SNAPSHOT/maven-metadata.xml
- https://snapshots.elastic.co/maven/org/elasticsearch/plugin/x-pack/5.6.15-SNAPSHOT/x-pack-5.6.15-SNAPSHOT.pom
- https://snapshots.elastic.co/maven/org/elasticsearch/plugin/x-pack/5.6.15-SNAPSHOT/x-pack-5.6.15-SNAPSHOT.zip
Required by:
project :x-pack:qa:full-cluster-restart:with-system-key

git check master

重新执行,发现中文的提示,导致测试用例不过。

Suite: Test class org.elasticsearch.plugins.PluginsServiceTests

1> [2019-04-30T09:42:28,120][INFO ][o.e.p.PluginsServiceTests] [testDesktopServicesStoreFiles] before test

1> [2019-04-30T09:42:28,337][INFO ][o.e.p.PluginsServiceTests] [testDesktopServicesStoreFiles] after test

2> REPRODUCE WITH: ./gradlew :server:test --tests "org.elasticsearch.plugins.PluginsServiceTests.testDesktopServicesStoreFiles" -Dtests.seed=9EA3ED2F64F1D310 -Dtests.security.manager=true -Dtests.locale=hr-BA -Dtests.timezone=EST5EDT -Dcompiler.java=12 -Druntime.java=12

2> java.lang.AssertionError:

Expected: with toString() a string containing "Not a directory"

but: toString() was "java.nio.file.FileSystemException: /data/dev/elasticsearch/server/build/testrun/test/temp/org.elasticsearch.plugins.PluginsServiceTests_9EA3ED2F64F1D310-002/tempDir-002/plugins/.DS_Store/plugin-descriptor.properties: 不是目录"

at __randomizedtesting.SeedInfo.seed([9EA3ED2F64F1D310:C91D147EEA92C17A]:0)

at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:18)

at org.junit.Assert.assertThat(Assert.java:956)

at org.junit.Assert.assertThat(Assert.java:923)

启动过程如果提示max file open too low可以执行这个
sudo sh -c "ulimit -n 65536 && exec su $LOGNAME"

 

elasticsearch 之编译过程的更多相关文章

  1. Android工程的编译过程

    现在很多人想对Android工程的编译和打包进行自动化,比如建立每日构建系统.自动生成发布文件等等.这些都需要我们对Android工程的编译和打包有一个深入的理解,至少要知道它的每一步都做了什么,需要 ...

  2. GCC编译过程

    以下是C程序一般的编译过程: gcc的编译流程分为四个步骤,分别为:· 预处理(Pre-Processing) 对C语言进行预处理,生成*.i文件.· 编译(Compiling) 将上一步生成的*.i ...

  3. Linux系统GCC常用命令和GCC编译过程描述

    前言: GCC 原名为 GNU C 语言编译器(GNU C Compiler),因为它原本只能处理 C语言.GCC 很快地扩展,变得可处理 C++.后来又 扩展能够支持更多编程语言,如Fortran. ...

  4. Hadoop源码编译过程

    一.           为什么要编译Hadoop源码 Hadoop是使用Java语言开发的,但是有一些需求和操作并不适合使用java,所以就引入了本地库(Native Libraries)的概念,通 ...

  5. gcc编译过程简述

    在linux系统上,从源文件到目标文件的转化是由编译器完成的.以hello.c程序的编译为例,如下: dfcao@linux: gcc -o hello hello.c 在这里,gcc编译器读取源文件 ...

  6. android 编译过程

    引用:http://www.cnblogs.com/devinzhang/archive/2011/12/20/2294686.html http://blog.sina.com.cn/s/blog_ ...

  7. [转]UE4 Blueprint编译过程

    Blueprint 编译概述   一.术语 Blueprint,像C++语言一下的,在游戏中使用前需要编译.当你在BP编辑器中,点击编译按钮时候,BP资源开始把属性和图例过程转换为一个类对象处理. 1 ...

  8. TextMate2 最新版下载及源码编译过程

    TextMate2 已经开源,我刚编译成功,如果有需要的同学可以点击下面百度网盘的链接下载.我系统版本是:Mac OS X 10.8.4. TextMate version 2.0-alpha.946 ...

  9. C语言的编译过程、安装gcc编译器以及设置环境变量

    以我对C语言编译过程的了解,我用了一点时间画了一个图,提供给大家参考一下,希望有些能对您的问题提上帮助. 前几天刚初步学习了C语言的编译过程,感触挺深的.在C语言中头文件其实起了一个很大的作用. 1. ...

随机推荐

  1. Spring Boot MongoDB 查询操作 (BasicQuery ,BSON)

    MongoDB 查询有四种方式:Query,TextQuery,BasicQuery 和 Bson ,网上太多关于 Query 的查询方式,本文只记录 BasicQuery和Bson 的方式,Basi ...

  2. rabbitmq-cluster搭建

    一.前期准备: 准备3台linux系统,配置好公司源,或者官网下载相应的网络源 1.条件:准备3台linux系统,确保能连到download.yunwei.edu 2.编写yum源下载脚本: #vim ...

  3. JAVA基础复习与总结<二>构造方法_static关键字_final关键字

    构造方法详解 构造器也叫做构造方法(constructor),用于对象的初始化. class Person2 { String name; int age; public Person2(String ...

  4. 潭州课堂25班:Ph201805201 tornado 项目 第五课 增加用户系统-用户中心(课堂笔记)

    tornado 相关说明 在 users 表中创建记录,做测试 在项目根目录下创建 test.py # -*- coding: utf-8 -*- # 斌彬电脑 # @Time : 2019/2/27 ...

  5. MAC下 mySQL及workbench安装

    1.首先去mysql 网站下载安装包,https://dev.mysql.com/downloads/mysql/ 选择第一个.dmg格式的下载安装 2.安装完成后,在System Preferenc ...

  6. angular.identity()

    <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...

  7. [Educational Round 5][Codeforces 616F. Expensive Strings]

    这题调得我心疲力竭...Educational Round 5就过一段时间再发了_(:з」∠)_ 先后找了三份AC代码对拍,结果有两份都会在某些数据上出点问题...这场的数据有点水啊_(:з」∠)_[ ...

  8. pytorch入门与实践-3 Tensor详解

    1--如第二章所讲,Tensor的本质是矩阵或数据 2--对Tensor的操作分类 |----API分类 |------torch中定义的: t.f(a,b) |------tensor的成员函数: ...

  9. 洛谷P3388 【模板】割点(割顶)

    题目背景 割点 题目描述 给出一个n个点,m条边的无向图,求图的割点. 输入输出格式 输入格式: 第一行输入n,m 下面m行每行输入x,y表示x到y有一条边 输出格式: 第一行输出割点个数 第二行按照 ...

  10. selenium如何操作HTML5的画布canvas上的元素

    话不多少,上图如下,下图红色框内是一个html5的画布,我们要像操作右上角的保存和数据视图的时候是无法公共selenium的普通定位操作到的,那该怎么办呢? 我们先new一个Selenium的acti ...