hadoop伪分布式搭建教程
方法/步骤
1、1.配置Hadoop环境变量#配置HADOOP环境变量vi/etc/profile#内容exportHADOOP_HOME=/usr/local/hadoop-2.9.2exportPATH=${JAVA_HOME}/bin:$PATH:$HADOOP_HOME/bin:$HADOOP_HOME/sbin#立即生效source/etc/profile#配置JAVA_HOME为JDK安装目录vi/usr/local/hadoop-2.9.2/etc/hadoop/hadoop-env.shexportJAVA_HOME=/usr/local/jdk1.8.0_231
2、2.修改主机名vi/etc/hosts添加内容192.168.71.130master
3、3.主溴溢菏确要配置#创建目录mkdir-p/hadoop/tmp#核心配置:core-site.xmlvi/usr/loca造婷用痃l/hadoop-2.9.2/etc/hadoop/core-site.xml#添加内容<configuration><property><name>fs.default.name</name><value>hdfs://master:9000</value></property><property><name>hadoop.tmp.dir</name><value>/hadoop/tmp</value></property></configuration>#HDFS配置文件:hdfs-site.xmlvi/usr/local/hadoop-2.9.2/etc/hadoop/hdfs-site.xml#内容<configuration><property><name>dfs.replication</name><value>1</value></property></configuration>
4、4.格式化hdfsnamenode-format
5、5.map筠续师诈reduce配置在etc/hadoop目录下:mapred-site.xml将:mapred-site.xmlroo墉掠载牿t改为:mapred-site.xmlcp/usr/local/hadoop-2.9.2/etc/hadoop/mapred-site.xml.template/usr/local/hadoop-2.9.2/etc/hadoop/mapred-site.xml.template#配置vi/usr/local/hadoop-2.9.2/etc/hadoop/mapred-site.xml#添加内容<configuration><property><name>mapreduce.framework.name</name><value>yarn</value></property></configuration>
6、6.Yarn配置yarn-site.xml#添加配置vi/usr/local/hadoop-2.9.2/etc/hadoop/yarn-site.xml#内容<property><name>yarn.nodemanager.aux-services</name> <value>mapreduce_shuffle</value></property><property> <name>yarn.resourcemanager.hostname</name> <value>master</value></property>
7、start-all.sh启动所有节点