http://tecadmin.net/setup-hadoop-2-4-single-node-cluster-on-linux/#
http://tecadmin.net/setup-hadoop-2-4-single-node-cluster-on-linux/#
安装java
http://tecadmin.net/install-java-8-on-centos-rhel-and-fedora/
安装过程报错:
1. 执行 hdfs namenode -format 报错的解决
Hadoop格式化HDFS报错java.net.UnknownHostException: localhost.localdomain: localhost.localdomain
这个解决参看: http://blog.csdn.net/shirdrn/article/details/6562292
我们通过执行hostname命令可以看到:
[shirdrn@localhost bin]# hostname
localhost.localdomain
也就是说,Hadoop在格式化HDFS的时候,通过hostname命令获取到的主机名是localhost.localdomain,然后在/etc/hosts文件中进行映射的时候,没有找到,看下我的/etc/hosts内容:
[root@localhost bin]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost localhost
192.168.1.103 localhost localhost
也就说,通过localhost.localdomain根本无法映射到一个IP地址,所以报错了。
此时,我们查看一下/etc/sysconfig/network文件:
NETWORKING=yes
NETWORKING_IPV6=yes
HOSTNAME=localhost.localdomain
可见,执行hostname获取到这里配置的HOSTNAME的值。
修改:将hostname 命令执行的grande ,添加到
/etc/sysconfig/network 的HOSTNAME
成为:
NETWORKING=yes
HOSTNAME=grande
NETWORKING_IPV6=no
然后执行:
/etc/init.d/network restart
2. http://10.10.10.252:8088/
不能访问。
原因是我安装java的时候的账户是grande
但是 /etc/sysconfig/network 改成了localhost 造成不匹配