HDFS作为cloudera quickstart docker中的音量

时间:2021-08-29 13:49:15

I am fairly new to both hadoop and docker.

我对hadoop和docker都很新。

I haven been working on extending the cloudera/quickstart docker image docker file and wanted to mount a directory form host and map it to hdfs location, so that performance is increased and data are persist localy.

我一直在努力扩展cloudera / quickstart docker image docker文件,并希望安装目录表单主机并将其映射到hdfs位置,以便提高性能并保持数据持久化。

When i mount volume anywhere with -v /localdir:/someDir everything works fine, but that's not my goal. But when i do -v /localdir:/var/lib/hadoop-hdfs both datanode and namenode fails to start and I get : "cd /var/lib/hadoop-hdfs: Permission denied". And when i do -v /localdir:/var/lib/hadoop-hdfs/cache no permission denied but datanode and namenode, or one of them fails to start on starting the docker image and i can't find any useful information in log files about the reason for that.

当我使用-v / localdir在任何地方装载卷:/ someDir一切正常,但这不是我的目标。但当我做-v / localdir:/ var / lib / hadoop-hdfs时,datanode和namenode都无法启动,我得到:“cd / var / lib / hadoop-hdfs:Permission denied”。当我做-v / localdir:/ var / lib / hadoop-hdfs / cache没有权限被拒绝但datanode和namenode,或其中一个无法启动启动docker镜像,我在日志中找不到任何有用的信息关于其原因的文件。

Mayby someone came across this problem, or have some other solution for putting hdfs outside the docker container?

Mayby有人遇到过这个问题,或者有其他解决办法将hdfs放在docker容器之外?

1 个解决方案

#1


0  

You should run a

你应该跑一个

docker exec -it "YOUR CLOUDERA CONTAINER" chown -R hdfs:hadoop /var/lib/hadoop-hdfs/ 

#1


0  

You should run a

你应该跑一个

docker exec -it "YOUR CLOUDERA CONTAINER" chown -R hdfs:hadoop /var/lib/hadoop-hdfs/