diff options
author | Guobiao Mo <guobiaomo@chinamobile.com> | 2019-05-14 10:47:26 -0700 |
---|---|---|
committer | Guobiao Mo <guobiaomo@chinamobile.com> | 2019-05-14 10:47:26 -0700 |
commit | feb7edda8a996bd6378947e51d010591989288e1 (patch) | |
tree | e5eb4539d613378568af5c437d238a6e0dc8169f /components/datalake-handler/feeder | |
parent | 3208e0c943742fef5e6692202063dba4e8ab96fd (diff) |
Set HDFS user
Use DB.login as HDFS write user.
Issue-ID: DCAEGEN2-1498
Change-Id: I59ee83472595b1fc79e9562b68f4178e7fbd920b
Signed-off-by: Guobiao Mo <guobiaomo@chinamobile.com>
Diffstat (limited to 'components/datalake-handler/feeder')
-rw-r--r-- | components/datalake-handler/feeder/src/assembly/scripts/init_db.sql | 2 | ||||
-rw-r--r-- | components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/service/HdfsService.java | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/components/datalake-handler/feeder/src/assembly/scripts/init_db.sql b/components/datalake-handler/feeder/src/assembly/scripts/init_db.sql index 04299e6d..2884c3e7 100644 --- a/components/datalake-handler/feeder/src/assembly/scripts/init_db.sql +++ b/components/datalake-handler/feeder/src/assembly/scripts/init_db.sql @@ -82,7 +82,7 @@ insert into db (`name`,`host`,`login`,`pass`,`database_name`) values ('Couchbase insert into db (`name`,`host`) values ('Elasticsearch','dl_es');
insert into db (`name`,`host`,`port`,`database_name`) values ('MongoDB','dl_mongodb',27017,'datalake');
insert into db (`name`,`host`) values ('Druid','dl_druid');
-insert into db (`name`,`host`) values ('HDFS','dlhdfs');
+insert into db (`name`,`host`,`login`) values ('HDFS','dlhdfs','dl');
-- in production, default enabled should be off
diff --git a/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/service/HdfsService.java b/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/service/HdfsService.java index e8d29106..edbc6757 100644 --- a/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/service/HdfsService.java +++ b/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/service/HdfsService.java @@ -140,8 +140,10 @@ public class HdfsService { String hdfsuri = String.format("hdfs://%s:%s", hdfs.getHost(), port); hdfsConfig.set("fs.defaultFS", hdfsuri); - - log.info("Connecting to -- {}", hdfsuri); + //hdfsConfig.set("hadoop.job.ugi", hdfs.getLogin()); + System.setProperty("HADOOP_USER_NAME", hdfs.getLogin()); + + log.info("Connecting to -- {} as {}", hdfsuri, hdfs.getLogin()); fileSystem = FileSystem.get(hdfsConfig); |