Trex-Group / trex-bigdata

11 stars 6 forks source link

[第二节课作业第一部分 MapReduce on Remote运行错误问题??] #21

Closed Chenxin123008 closed 7 years ago

Chenxin123008 commented 7 years ago

MapReduce on Remote 工程下的 WordCount运行出错。 Log上来看就是因为连接Hadoop-server失败了.

2017-03-13 23 57 40

首先我按手顺:(1)通过宿主机 ping 通2个虚拟机节点 宿主机 ->ip:192.168.1.102 DNS:192.168.1.255 Hadoop-Develop-> ip 192.168.1.230 Hadoop-Server-> ip 192.168.1.231

2017-03-14 0 04 14

(2)通过 ssh 连接到2个虚拟机节点 都没有问题

2017-03-14 0 13 02 2017-03-14 0 13 31

(3)最后通过 Hadoop-Develop ping Hadoop-Server没有问题 Hadoop-Develop shh登陆 Hadoop-Server也没有问题 请教各位还有其它锁定问题的方法嘛?? 求解,30分的问题弄了一晚上悲催。。。

LiuMing5489 commented 7 years ago

之前好像遇到过类似的错误。测试ssh的时候别用ip,用server名试试。

xenron commented 7 years ago

大家慢慢要习惯于使用hostname,而不是通过ip地址来进行各种操作。

单纯从这个错误日志来看 主机名加端口无法访问

处理思路: 1,尝试通过hostaname进行 ping 测试 2,在对端(即Hadoop-Server),通过jps,确认进程是否正常运行 3,在对端,确认端口是否正常监听 netstat –apn ps -aux 4,在本机,通过telnet是否能连通对端主机的端口

对于操作命令相关的内容,不清楚的话,可以自己google搜索看看。

Chenxin123008 commented 7 years ago

@LiuMing5489 server名试过了也没问题

@xenron 按照你的处理思路,发现是因为Hadoop-Server进程没有启动。 这个问题解决以后又出现新的问题,hadoopdev.jar不存在, 这不就是自己生成的吗?

2017-03-14 21 32 13

经过QQ询问老师,得到解决手顺 (1)再idea ide中点击左下角,弹出选项里选择Maven Projects 然后运行 install (2)再idea ide中点击左下角,弹出选项里选择terminal 然后执行 cd target cp hadoopdev.jar .. (不移动可能还是找不到) (3)重新运行

lufengfeng commented 7 years ago

snapcrab_noname_2017-3-15_6-9-33_no-00

我这边也是这个问题

然后执行 cd target cp hadoopdev.jar .. (不移动可能还是找不到) 具体是如何的 想参考一下

LiuMing5489 commented 7 years ago

@lufengfeng 起的真早啊👍

chinndou commented 7 years ago

我也和你一个现象。就是连不上HadoopServer的9000端口。 主机看了一下。好像9000端口不在监听。

2017-03-15 18 21 15
Chenxin123008 commented 7 years ago

@lufengfeng 你看一下服务器端(Hadoop-Server)进程是否正常运行,如何能运行起来了,就应该能解决这个问题了。 服务器端需要用root执行以下命令,jps确认进程,然后确认端口是否正常监听 netstat –apn ps -aux $HADOOP_HOME/sbin/start-dfs.sh $HADOOP_HOME/sbin/start-yarn.sh

xenron commented 7 years ago

初始状态,工程根目录,没有jar文件 image

鼠标放在左下角的,稍等n秒,出现选项,点击 Maven Projects image

右侧弹出 Maven 侧边栏,选择 install,双击 image

弹出 maven 执行日志,等待 build jar 完成 image

工程目录/target,目录下,包含 jar 文件,将其拷贝到工程根目录 image

执行 WordCount

jplijplijpli commented 7 years ago

遇到同样的问题,Hadoop-Server没能成功启动,log如下:

image

image

jplijplijpli commented 7 years ago

格式化后问题就解决了,为什么需要格式化?

image

jplijplijpli commented 7 years ago

为什么input file 需要自己copy过去?

image

不应该是step3时从client那里同jar一起自动copy到master那里去吗? Client will get new application id and then it will copy the jar file and other job resources to HDFS with high replication factor (by default 10 on large clusters) image http://stackoverflow.com/questions/34709213/hadoop-how-job-is-send-to-master-and-to-nodes-on-mapreduce

jplijplijpli commented 7 years ago

课堂回答摘录: Q: 为什么需要格式化? A: 因为文件存在tmp里可能被擦掉(file:/tmp/hadoop),还有可能没有正常关闭。

Q: 为什么要copy input/README.txt到Hadoop-Server? A: 所有的节点都可以是client。

确认copy完input/README.txt后就能成功执行remote版本的workcount了。

LiuMing5489 commented 7 years ago

Q: 为什么要copy input/README.txt到Hadoop-Server? 感觉这个还不是很清晰。

「copy the jar file and other job resources to HDFS」 什么是other job resources?

想让老师结合wordcount remote例子分析一下iNXUp.png这张图的各个步骤。

jplijplijpli commented 7 years ago

image 参照书第4版193页,在step3前input已经被split了。所以我觉得step3同把input从local directory放到HFDS的directory里面不是同一件事。使用JAVA API的话是不是可以代替手动copy? http://stackoverflow.com/questions/12783968/copying-directory-from-local-system-to-hdfs-java-code