namenode ,datanode同台机器启动(伪分布式 练手)
进到hadoop文件里面
在标签 里面插入
<property>
<name>fs.defaultFS</name>
<value>file://虚拟机的主机名:9000</value>
<description>The name of the default file system. A URI whose
scheme and authority determine the FileSystem implementation. The
uri's scheme determines the config property (fs.SCHEME.impl) naming
the FileSystem implementation class. The uri's authority is used to
determine the host, port, etc. for a filesystem.</description>
</property>
修改储存位置
<property>
<name>hadoop.tmp.dir</name>
<value>/opt/module/hadoop-2.7.2/data/nn</value>
<description>A base for other temporary directories.</description>
</property>
起进程之前 ,首次使用要格式化
启动NN进程:hadoop-daemon.sh start namenode
启动DN进程:hadoop-daemon.sh start datanode
查看进程:jps
多台虚拟机分布式搭建:
1 进到配置文件
修改:记住看好自己主机名
2 修改 hdfs-site.xml
里边没配置东西,退了
3 修改yarn-site.xml
配置自己的主机名
4 修改mapred-site.xml
5. 改完后分发到其他虚拟机
6
示例成功:
7 开始启动
7.1 第一台启动 namenode 服务,首次都要格式化
启动:
7.2 在用批量处理的机子上,群起datanode
查看成功否:
ps:windown系统查看要映射hosts文件
C:\Windows\System32\drivers\etc 文件地址
重启yarn
批量起resourcemanager
成功如下: