下载
http://archive.apache.org/dist/hadoop/common/hadoop-3.1.1/
上传至服务器/opt/software
解压
[root@server1 servers]# tar -zxvf hadoop-3.1.1.tar.gz -C /opt/servers
配置
core-site.xml
<configuration> <!-- hdfs://server1:8020 中server1是主机名 --> <property> <name>fs.default.name</name> <value>hdfs://server1:8020</value> </property> <!-- 临时文件存储目录 --> <property> <name>hadoop.tmp.dir</name> <value>/opt/servers/hadoop-3.1.1/datas/tmp</value> </property> <!-- 缓冲区大小 --> <property> <name>io.file.buffer.size</name> <value>8129</value> </property> <!-- 开启HDFS垃圾桶机制,删除掉的数据可以从垃圾桶中回收 单位为分钟--> <property> <name>fs.trash.interval</name> <value>10080</value> </property> </configuration>
hadoop-env.sh
export JAVA_HOME=/opt/module/jdk1.8.0_231