使用myhadoop.sh脚本时出错:
文章来源地址https://www.toymoban.com/news/detail-512143.html
解决方案:
- 删掉haoop安装目录下 /opt/module/hadoop-3.3.0/etc/hadoop/workers 文件里面的localhost
- 保存后可成功运行脚本
附上:myhadoop.sh(实现hadoop集群快速启停)
#!/bin/bash
if [ $# -lt 1 ]
then
echo "No Args Input..."
exit ;
fi
case $1 in
"start")
echo " =================== 启动 hadoop 集群 ==================="
echo " --------------- 启动 hdfs ---------------"
ssh hadoop102 "/opt/module/hadoop-3.3.0/sbin/start-dfs.sh"
echo " --------------- 启动 yarn ---------------"
ssh hadoop103 "/opt/module/hadoop-3.3.0/sbin/start-yarn.sh"
echo " --------------- 启动 historyserver ---------------"
ssh hadoop102 "/opt/module/hadoop-3.3.0/bin/mapred --daemon start
historyserver"
;;
"stop")
echo " =================== 关闭 hadoop 集群 ==================="
echo " --------------- 关闭 historyserver ---------------"
ssh hadoop102 "/opt/module/hadoop-3.3.0/bin/mapred --daemon stop
historyserver"
echo " --------------- 关闭 yarn ---------------"
ssh hadoop103 "/opt/module/hadoop-3.3.0/sbin/stop-yarn.sh"
echo " --------------- 关闭 hdfs ---------------"
ssh hadoop102 "/opt/module/hadoop-3.3.0/sbin/stop-dfs.sh"
;;
*)
echo "Input Args Error..."
;;
esac
文章来源:https://www.toymoban.com/news/detail-512143.html
到了这里,关于hadoop报错:没有那个文件或目录的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!