hadoop 运行 datanode , mac 系统
2016-04-10 15:19
721 查看
问题描述
今天使用 hadoop 时,发现无法通过下面命令上传文件到 hadoop 文件系统,会报错。bin/hadoop fs -put input .
运行 jps 后,输出如下:
2979 ResourceManager 2644 NameNode 3078 NodeManager 3113 Jps 2858 SecondaryNameNode
可见 datanode 挂掉了。
用下面的命令重启 hadoop ,重启后仍然没有 datanode 的进程。
sbin/stop-all.sh sbin/start-all.sh
原因思考
近期同时安装了多个版本的 hadoop ,并且安装后重新格式化过 hdfs ,这个可能是引起问题的原因。解决方法
本人使用的是 hadoop 2.7.2 版本。1. 关闭集群
sbin/stop-all.sh
2. 在配置文件 etc/hadoop/hdfs-site.xml 中找到 dfs.name.dir / dfs.data.dir 的路径。我的配置如下
<configuration> <property> <name>dfs.name.dir</name> <value>file:///Users/grs/hadoopinfra/hdfs/namenode </value> </property> <property> <name>dfs.data.dir</name> <value>file:///Users/grs/hadoopinfra/hdfs/datanode </value> </property> </configuration>
3. 将上述路径的的目录重命名,如将 Users/grs/hadoopinfra 重命名为 Users/grs/hadoopinfra.bak_20160410 ,或者全部删掉(rm -R)
4. 格式化 namenode
bin/hadoop namenode -format
5. 最后,重启
sbin/start-all.sh
运行效果
运行 jps 能看到 datanode 的进程。2738 DataNode 2979 ResourceManager 3203 Jps 2644 NameNode 3078 NodeManager 2858 SecondaryNameNode
也能成功上传文件
grs:hadoop grs$ hadoop dfs -put input ./ DEPRECATED: Use of this script to execute hdfs command is deprecated. Instead use the hdfs command for it. 16/04/10 15:17:07 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable grs:hadoop grs$
参考资料 :
No data nodes are started, stackoverflow
相关文章推荐
- node入门(三)——gulp运用实例
- [译]How to Install Node.js on Ubuntu 14.04 如何在ubuntu14.04上安装node.js
- 文件的inode数据
- LeetCode 25 reverse-nodes-in-k-group
- node.js学习之路
- 基于NodeBB的网站服务器迁移步骤
- LeetCode *** 19. Remove Nth Node From End of List
- Hash_node_pseudo类
- inode
- LeetCode-237:Delete Node in a Linked List (Python)
- Yarn NodeManager restart特性
- node.js的几种异步控制的方法
- LeetCode117—Populating Next Right Pointers in Each Node II
- LeetCode116—Populating Next Right Pointers in Each Node
- leetcode 222. Count Complete Tree Nodes
- 点击链接更换图片和相应文本 childNotes nodeType nodeValue
- node入门(二)——gulpfile.js初探
- leetcode- Delete Node in a Linked List&Remove Linked List Elements
- 关于node.js资料集
- 如何在Ubuntu上安装最新版本的Node.js