Q:
//执行
[root@hadoop01 hadoop]# bin/hadoop jar share/hadoop/mapreduce/hadoop-mapreduce-examples-3.1.0.jar wordcount /input/LICENSE.txt /output22
//报错
2018-06-27 19:07:00,000 INFO ipc.Client: Retrying connect to server: hadoop02_.yu.net/192.168.221.146:45901. Already tried 2 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=3, sleepTime=1000 MILLISECONDS)
2018-06-27 19:07:08,632 INFO ipc.Client: Retrying connect to server: hadoop04_.yu.net/192.168.221.148:48072. Already tried 0 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=3, sleepTime=1000 MILLISECONDS)
2018-06-27 19:07:09,634 INFO ipc.Client: Retrying connect to server: hadoop04_.yu.net/192.168.221.148:48072. Already tried 1 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=3, sleepTime=1000 MILLISECONDS)
执行测试任务时,链接不到从机,且每次链接不到的从机都不同。
A:
1、 检测防火墙是否设置正常
2、检测主机名是否一致正确(检查/etc/hosts 文件)
3、删除/etc/hosts中的localhost等两行,否则会报找不到主机localhost。
4、保持多台服务器时间同步。
5、检查配置文件workers,和slaves的主机名是否一致
6、测试是否可以ping通别名
ping hadoop_2.yu.net //这是错误主机名
···
7、ssh免密传出设置是否正常,检测ssh免密登录
8、检测主机名是否标准
hadoop_2是错误主机名,改为hadoop02
总结: hadoop对主机名(FQDN)要求很严格,hosts文件中有localhost不行,主机名有下划线也不行,虽然在启动时没有问题,但是执行任务时就会出错!