美文网首页程序员数据中台-排坑
Windows启动HDFS报错 - 系统找不到文件 hadoop

Windows启动HDFS报错 - 系统找不到文件 hadoop

作者: 夹胡碰 | 来源:发表于2020-10-14 09:14 被阅读0次

1. 环境

  • 操作系统: Windows 7
  • Hadoop版本: 2.6.0

2. 问题描述

Windows 7 环境下启动 HDFS,执行 start-dfs.cmd 出现 系统找不到文件 hadoop。报错信息如下

  • dos
E:\soft_work\hadoop-2.6.0\sbin>start-dfs.cmd
系统找不到文件 hadoop。
系统找不到文件 hadoop。
  • 弹窗


    image.png

3. 解决方案

3.1 方案一(推荐)

添加HADOOP_HOME环境变量并添加到PATH

image.png image.png
3.2 方案二

修改 ./sbin/start-dfs.cmd文件,在最前面加上 cd E:\soft_work\hadoop-2.6.0\bin

...
@rem     http://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem

cd E:\soft_work\hadoop-2.6.0\bin

setlocal enabledelayedexpansion

if not defined HADOOP_BIN_PATH ( 
  set HADOOP_BIN_PATH=%~dp0
)

...

相关文章

网友评论

    本文标题:Windows启动HDFS报错 - 系统找不到文件 hadoop

    本文链接:https://www.haomeiwen.com/subject/urbvpktx.html