參考: https://hadoop.apache.org/docs/r2.9.2/hadoop-project-dist/hadoop-common/SingleCluster.html
需要修改/etc/hostname主经、/etc/hosts、安裝JDK、下載Hadoop tar包
- 配置hadoop-env.sh
export JAVA_HOME=/opt/soft/jdk1.8.0_191
- 配置core-site.xml
編輯etc/hadoop/core-site.xml
<configuration>
<property>
<!-- The name of the default file system. A URI whose scheme and authority determine the FileSystem implementation. default value: file:/// -->
<name>fs.defaultFS</name>
<value>hdfs://localhost:9000</value>
</property>
<property>
<!-- A base for other temporary directories.default value: /tmp/hadoop-${user.name} -->
<name>hadoop.tmp.dir</name>
<value>/opt/soft/hadoop-2.9.1/hadoop-tmp</value>
</property>
</configuration>
- 配置hdfs-site.xml
編輯etc/hadoop/hdfs-site.xml
<configuration>
<property>
<!-- Default block replication. The actual number of replications can be specified when the file is created. The default is used if replication is not specified in create time. Default value: 3 -->
<name>dfs.replication</name>
<value>1</value>
</property>
</configuration>
4.配置免密登陸本機(jī)
5.格式化namenode
hadoop namenode -format