简体   繁体   English

Whay会说“ -bash:cd:hadoop:不是目录”吗?

[英]Whay does it say “-bash: cd: hadoop: Not a directory”?

I am trying to run "hadoop wordcount in python" by following this tutorial. 我试图通过遵循教程来运行“ hadoop wordcount in python”。 As in the tutorial, when I run this command /usr/local/hadoop/bin/hadoop fs -put ~/count_of_monte_cristo.txt /input , it says -bash: cd: hadoop: Not a directory . 像在教程中一样,当我运行此命令/usr/local/hadoop/bin/hadoop fs -put ~/count_of_monte_cristo.txt /input ,它说-bash: cd: hadoop: Not a directory

In tutorial it says that we need to put the text file by creating aa directory in HDFS. 在教程中,它说我们需要通过在HDFS中创建一个目录来放置文本文件。 My question is if /bin/hadoop is not a accessible, where should I put the text file for analysis ? 我的问题是/bin/hadoop是否不可访问,应将文本文件放在哪里进行分析? Are there any options ? 有什么选择吗? Or, Am I doing something wrong here ? 或者,我在这里做错了吗?

鉴于您已经在/Users/JJ/hadoop-2.6.0安装了Hadoop,这是您的主目录,因此您应该在运行

/Users/JJ/hadoop-2.6.0/bin/hadoop fs -put ~/count_of_monte_cristo.txt /input

/bin/hadoop or wherever your hadoop executable is located, you should be able to run hadoop filesystem commands using it. / bin / hadoop或hadoop可执行文件所在的位置,您都应该能够使用它运行hadoop文件系统命令。 put command doesn't put the file in /bin/hadoop directory it tries to put file in location you specified, in your example in /input which is a directory expected in hdfs put命令不会将文件放置在/ bin / hadoop目录中,而是会尝试将文件放置在您指定的位置,在示例中/ input是在hdfs中预期的目录

When you run any hadoop fs command you are accessing hadoop distributed filesystem (Hdfs) if you have set that up. 运行任何hadoop fs命令时,如果已设置,则正在访问hadoop分布式文件系统(Hdfs)。 Else it will run on the local filesystem if you haven't setup Hdfs. 否则,如果您尚未设置Hdfs,它将在本地文件系统上运行。

I would suggest first verify your hadoop executable is working fine by running. 我建议先通过运行来验证您的hadoop可执行文件是否运行正常。 Replace hadoop with full path of executable if you haven't added hadoop in your PATH 如果尚未在PATH中添加hadoop,请用可执行文件的完整路径替换hadoop

hadoop fs -ls

If it returns directories in hdfs you are good. 如果它返回hdfs中的目录,那很好。 Else you might not have setup cluster correctly 否则您可能没有正确安装群集

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM