VMWare虚拟机集群搭建Hadoop with Hive
DEVICE=eth0TYPE=EthernetUUID=166b95ca-b98b-446c-a68e-6022012e4a9aONBOOT=yesNM_CONTROLLED=yesBOOTPROTO=noneIPADDR=192.168.32.168 ? ? ? ---宿主机器是 192.168.32.1NETMASK=255.255.255.0PREFIX=24GATEWAY=192.168.32.1DEFROUTE=yesIPV4_FAILURE_FATAL=yesIPV6INIT=noNAME="System eth0"HWADDR=00:0C:29:11:DE:CAPEERDNS=yesPEERROUTES=yesUSERCTL=NO
192.168.32.101? slave1
192.168.32.102? slave2
192.168.32.103? slave3
HOSTNAME=master
用root关闭防火墙
/etc/profile
export JAVA_HOME=/bdp/install/jdk1.7.0_79
export HADOOP_HOME=/bdp/install/hadoop-2.2.0
export HIVE_HOME=/bdp/install/apache-hive-0.2.0-bin
export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$HADOOP_HOME/bin:$HADOOP_HOME/sbin:$HIVE_HOME/bin:$HIVE_HOME/sbin:$PATH
export JAVA_HOME=/bdp/install/jdk1.7.0_79
vi /bdp/install/hadoop-2.2.0/etc/hadoop/hadoop-env.sh
vi /bdp/install/hadoop-2.2.0/etc/hadoop/yarn-env.sh
scp /bdp/install/hadoop-2.2.0/etc/hadoop/hadoop-env.sh hadoop@slave1:/bdp/install/hadoop-2.2.0/etc/hadoop/hadoop-env.sh
scp /bdp/install/hadoop-2.2.0/etc/hadoop/hadoop-env.sh hadoop@slave2:/bdp/install/hadoop-2.2.0/etc/hadoop/hadoop-env.sh
scp /bdp/install/hadoop-2.2.0/etc/hadoop/hadoop-env.sh hadoop@slave3:/bdp/install/hadoop-2.2.0/etc/hadoop/hadoop-env.sh
scp /bdp/install/hadoop-2.2.0/etc/hadoop/yarn-env.sh hadoop@slave3:/bdp/install/hadoop-2.2.0/etc/hadoop/yarn-env.sh
scp /bdp/install/hadoop-2.2.0/etc/hadoop/yarn-env.sh hadoop@slave3:/bdp/install/hadoop-2.2.0/etc/hadoop/yarn-env.sh
scp /bdp/install/hadoop-2.2.0/etc/hadoop/yarn-env.sh hadoop@slave3:/bdp/install/hadoop-2.2.0/etc/hadoop/yarn-env.sh
Hadoop需要修改的配置文件
添加文件master
master
修改slaves文件
slave1
slave2
slave3
core-site.xml
<configuration>
??? <property>
??????? <name>fs.defaultFS</name>
??????? <value>hdfs://master:9000</value>
??? </property>
??? <property>
??????? <name>io.file.buffer.size</name>
??????? <value>131072</value>
??? </property>
??? <property>
??????? <name>hadoop.tmp.dir</name>
??????? <value>/bdp/tmp</value>
??????? <description>Abase for other temporary directories.</description>
??? </property>
??? <property>
??????? <name>hadoop.proxyuser.hduser.hosts</name>
??????? <value>*</value>
??? </property>
??? <property>
??????? <name>hadoop.proxyuser.hduser.groups</name>
??????? <value>*</value>
??? </property>
</configuration>
hdfs-site.xml
<configuration>
??? <property>
??????? <name>dfs.namenode.secondary.http-address</name>
??????? <value>master:9001</value>
??? </property>
??? <property>
??????? <name>dfs.namenode.name.dir</name>
??????? <value>/bdp/data/dfs/name</value>
??? </property>
??? <property>
??????? <name>dfs.datanode.data.dir</name>
??????? <value>/bdp/data/dfs/data</value>
??? </property>
??? <property>
??????? <name>dfs.replication</name>
??????? <value>3</value>
??? </property>
??? <property>
??????? <name>dfs.webhdfs.enabled</name>
??????? <value>true</value>
??? </property>
</configuration>
mapred-site.xml
<configuration>
??? <property>
??????? <name>mapreduce.framework.name</name>
??????? <value>yarn</value>
??? </property>
??? <property>
??????? <name>mapreduce.jobhistory.address</name>
??????? <value>master:10020</value>
??? </property>
??? <property>
??????? <name>mapreduce.jobhistory.webapp.address</name>
??????? <value>master:19888</value>
??? </property>
</configuration>
yarn-site.xml
<configuration>
??? <property>
??????? <name>yarn.nodemanager.aux-services</name>
??????? <value>mapreduce_shuffle</value>
??? </property>
??? <property>
??????? <name>yarn.nodemanager.aux-services.mapreduce.shuffle.class</name>
??????? <value>org.apache.hadoop.mapred.ShuffleHandler</value>
??? </property>
??? <property>
??????? <name>yarn.resourcemanager.address</name>
??????? <value>master:8032</value>
??? </property>
??? <property>
??????? <name>yarn.resourcemanager.scheduler.address</name>
??????? <value>master:8030</value>
??? </property>
??? <property>
??????? <name>yarn.resourcemanager.resource-tracker.address</name>
??????? <value>master:8031</value>
??? </property>
??? <property>
??????? <name>yarn.resourcemanager.admin.address</name>
??????? <value>master:8033</value>
??? </property>
???? <property>
??? <name>yarn.resourcemanager.webapp.address</name>
??? <value>master:8088</value>
??? </property>
</configuration>
格式化namenode:hdfs namenode –format?
bin/hdfs namenode –format -clusterid clustername (集群的刷新:一定要记得加-clusterid n54)
3007 Jps
1851 NameNode
2008 SecondaryNameNode
1739 NodeManager
1423 DataNode
http://192.168.32.168:50070
b?????? 1
bla???? 2
c?????? 1
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。