Skip to content

Commit

Permalink
Upgrade repository-hdfs to Hadoop 3 (#78407)
Browse files Browse the repository at this point in the history
This upgrades the repository-hdfs plugin to hadoop 3. Tests are performed against both hadoop 2 and hadoop 3 HDFS. The advantages of using the hadoop 3 client are:
Over-the-wire encryption works (tests coming in an upcoming PR).
We don't have to add (or ask customers to add) additional jvm permissions to the elasticsearch jvm
It's compatible with java versions higher than java 8
Relates #76897
  • Loading branch information
masseyke authored Oct 6, 2021
1 parent fe79373 commit 615ffa0
Show file tree
Hide file tree
Showing 39 changed files with 464 additions and 158 deletions.
365 changes: 241 additions & 124 deletions plugins/repository-hdfs/build.gradle

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apply plugin: 'elasticsearch.java'
apply plugin: 'com.github.johnrengelman.shadow'

dependencies {
implementation "org.apache.hadoop:hadoop-common:${project.parent.versions.hadoop2}"
implementation "org.apache.hadoop:hadoop-client-api:${project.parent.versions.hadoop}"
}

tasks.named('shadowJar').configure {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
593326399e5fb5e1f986607f06f63c1250ab36b4
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Apache Commons Configuration
Apache Commons Configuration 2
Copyright 2001-2015 The Apache Software Foundation

This product includes software developed at
Expand Down
1 change: 0 additions & 1 deletion plugins/repository-hdfs/licenses/guava-11.0.2.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions plugins/repository-hdfs/licenses/guava-27.1-jre.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
e47b59c893079b87743cdcfb6f17ca95c08c592c

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
f3a55d882328ee87a1054f99d62ba987fa9029a4

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5da7f270cb6564e099e0d2d424285a24fca62bd2

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
body:
type: hdfs
settings:
uri: "hdfs://localhost:9999"
uri: "hdfs://localhost:@hdfs_port@"
path: "test/repository_create"

# Get repository
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
body:
type: hdfs
settings:
uri: "hdfs://localhost:9999"
uri: "hdfs://localhost:@hdfs_port@"
path: "foo/bar"

# Get repository
Expand Down Expand Up @@ -39,7 +39,7 @@
body:
type: hdfs
settings:
uri: "hdfs://localhost:9999"
uri: "hdfs://localhost:@hdfs_port@"
path: "foo/bar"

# Get repository again
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
body:
type: hdfs
settings:
uri: "hdfs://localhost:9999"
uri: "hdfs://localhost:@hdfs_port@"
path: "test/repository_verify"

# Verify repository
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
body:
type: hdfs
settings:
uri: "hdfs://localhost:9999"
uri: "hdfs://localhost:@hdfs_port@"
path: "test/snapshot"

# Create index
Expand All @@ -36,7 +36,7 @@
- match: { snapshot.shards.failed : 0 }

# Remove our snapshot
- do:
- do:
snapshot.delete:
repository: test_snapshot_repository
snapshot: test_snapshot
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
body:
type: hdfs
settings:
uri: "hdfs://localhost:9999"
uri: "hdfs://localhost:@hdfs_port@"
path: "test/snapshot_get"

# Create index
Expand Down Expand Up @@ -59,7 +59,7 @@
- match: { snapshots.0.snapshot : test_snapshot_get }

# Remove our snapshot
- do:
- do:
snapshot.delete:
repository: test_snapshot_get_repository
snapshot: test_snapshot_get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
body:
type: hdfs
settings:
uri: "hdfs://localhost:9999"
uri: "hdfs://localhost:@hdfs_port@"
path: "/user/elasticsearch/existing/readonly-repository"
readonly: true

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
body:
type: hdfs
settings:
uri: "hdfs://localhost:9999"
uri: "hdfs://localhost:@hdfs_port@"
path: "test/restore"

# Create index
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
body:
type: hdfs
settings:
uri: "hdfs://localhost:9998"
uri: "hdfs://localhost:@secure_hdfs_port@"
path: "/user/elasticsearch/test/repository_create"
security:
principal: "[email protected]"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
body:
type: hdfs
settings:
uri: "hdfs://localhost:9998"
uri: "hdfs://localhost:@secure_hdfs_port@"
path: "/user/elasticsearch/foo/bar"
security:
principal: "[email protected]"
Expand Down Expand Up @@ -41,7 +41,7 @@
body:
type: hdfs
settings:
uri: "hdfs://localhost:9998"
uri: "hdfs://localhost:@secure_hdfs_port@"
path: "/user/elasticsearch/foo/bar"
security:
principal: "[email protected]"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
body:
type: hdfs
settings:
uri: "hdfs://localhost:9998"
uri: "hdfs://localhost:@secure_hdfs_port@"
path: "/user/elasticsearch/test/repository_verify"
security:
principal: "[email protected]"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
body:
type: hdfs
settings:
uri: "hdfs://localhost:9998"
uri: "hdfs://localhost:@secure_hdfs_port@"
path: "/user/elasticsearch/test/snapshot"
security:
principal: "[email protected]"
Expand All @@ -38,7 +38,7 @@
- match: { snapshot.shards.failed : 0 }

# Remove our snapshot
- do:
- do:
snapshot.delete:
repository: test_snapshot_repository
snapshot: test_snapshot
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
body:
type: hdfs
settings:
uri: "hdfs://localhost:9998"
uri: "hdfs://localhost:@secure_hdfs_port@"
path: "/user/elasticsearch/test/snapshot_get"
security:
principal: "[email protected]"
Expand Down Expand Up @@ -61,7 +61,7 @@
- match: { snapshots.0.snapshot : test_snapshot_get }

# Remove our snapshot
- do:
- do:
snapshot.delete:
repository: test_snapshot_get_repository
snapshot: test_snapshot_get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
body:
type: hdfs
settings:
uri: "hdfs://localhost:9998"
uri: "hdfs://localhost:@secure_hdfs_port@"
path: "/user/elasticsearch/existing/readonly-repository"
security:
principal: "[email protected]"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
body:
type: hdfs
settings:
uri: "hdfs://localhost:9998"
uri: "hdfs://localhost:@secure_hdfs_port@"
path: "/user/elasticsearch/test/restore"
security:
principal: "[email protected]"
Expand Down
3 changes: 2 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ List projects = [
'test:framework',
'test:fixtures:azure-fixture',
'test:fixtures:gcs-fixture',
'test:fixtures:hdfs-fixture',
'test:fixtures:hdfs2-fixture',
'test:fixtures:hdfs3-fixture',
'test:fixtures:krb5kdc-fixture',
'test:fixtures:minio-fixture',
'test:fixtures:old-elasticsearch',
Expand Down
File renamed without changes.
13 changes: 13 additions & 0 deletions test/fixtures/hdfs3-fixture/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

apply plugin: 'elasticsearch.java'

dependencies {
api "org.apache.hadoop:hadoop-minicluster:3.3.1"
}
Loading

0 comments on commit 615ffa0

Please sign in to comment.