1.进入/export/servers目录,输入rz,选择Hadoop下载文件夹进行上传
2.解压安装包 tar -zxvf hadoop-3.3.4.tar.gz -C /export/servers
3.创建软链接
In -s hadoop-3.2.2/ hadoop
5.修改配置文件
(1)配置hadoop-env.sh文件
export JAVA_HOME=/export/servers/jdk
export HADOOP_HOME=/export/servers/hadoop
export HADOOP_CONF_DIR=$HADOOP_HOME/etc/hadoop
export HADOOP_LOG_DIR=$HADOOP_HOME/logs
(3)配置core-site.xml文件
<configuration>
<property>
<name>fs.defaultFS</name>
<value>hdfs://node1:8020</value>
</property>
<property>
<name>io.file.buffer.size</name>
<value>131072</value>
</property>
</configuration>
(4)配置hdfs-site.xml文件
<configuration>
<property>
<name>dfs.datanode.data.dir.perm</name> #hdfs
<value>700</value>
</property>
<property>
<name>dfs.namenode.name.dir</name> #NameNode
<value>/data/nn</value>
</property>
<property>
<name>dfs.namenode.hosts</name> #NameNode
<value>node1,node2,node3</value>
</property>
<property>
<name>dfs.blocksize</name> #hdfs
<value>268435456</value>
</property>
<property>
<name>dfs.namenode.handler.count</name> #namenode
<value>100</value>
</property>
<property>
<name>dfs.datanode.data.dir</name> #从节点datanode
<value>/data/dn</value>
</property>
</configuration>