下载hadoop安装包解压
编辑hadoop/etc/hadoop/下文件
编辑hadoop-env.sh文件,设置java环境变量
export JAVA_HOME=/opt/jdk1.8.0_211
编辑core-site.xml文件
<configuration>
<property>
<name>hadoop.tmp.dir</name>
<value>file:/opt/hadoop-2.10.1/tmp</value>
<description>Abase for other temporary directories.</description>
</property>
<property>
<name>fs.defaultFS</name>
<value>hdfs://localhost:9000</value>
</property>
<property>
<name>hadoop.proxyuser.root.hosts</name>
<value>*</value>
</property>
<property>
<name>hadoop.proxyuser.root.groups</name>
<value>*</value>
</property>
</configuration>
编辑hdfs-site.xml文件
<configuration>
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
<property>
<name>dfs.namenode.name.dir</name>
<value>file:/opt/hadoop-2.10.1/tmp/dfs/name</value>
</property>
<property>
<name>dfs.datanode.data.dir</name>
<value>file:/opt/hadoop-2.10.1/tmp/dfs/data</value>
</property>
<property>
<name>hadoop.http.staticuser.user</name>
<value>root</value>
</property>
<property>
<name>dfs.permissions.enabled</name>
<value>false</value>
</property>
</configuration>
执行名称节点格式化
修改配置文件以后,要执行名称节点的格式化,命令如下:
./bin/hdfs namenode -format
启动Hadoop all
./sbin/start-all.sh
配置hadoop环境变量
export HADOOP_HOME=/opt/hadoop-2.10.1
export PATH=$PATH:$HADOOP_HOME/bin:$HADOOP_HAME/sbin