hadoop使用的是目前比较新的稳定版本
hive
27 June 2015 : release 1.2.1 availablehbase
The 1.1.x series is the current stable release line, it supercedes 1.0.x, 0.98.x and 0.94.x (the 1.0.x, 0.98.x and 0.94.x lines are still seeing a monthly cadence of bug fix releases for those who are not easily able to update). Note that 0.96 was EOL'd September 1st, 2014.zookeeper
zookeeper的兼容性最好,所以选了当时的稳定版3.4.8pig
6 June, 2015: release 0.15.0 availablesqoop
由于使用的是hadoop2.x就只能使用对应的sqoop-1.4.6.bin__hadoop-2.0.4-alpha.tar.gz集群节点配置
ip 192.168.2.3;192.168.2.10 ;192.168.11
hostname: hadoop;hadoop1;hadoop2
hadoop1:NameNode,SecondaryNameNode,ResourceManager,HMaster
hadoop2:DataNode,NodeManager,HRegionserver
hadoop3:DataNode,NodeManager,HRegionserver
综上所述,开始搭建集群
二 版本,路径和环境变量的设置/usr/local/maven/maven-3.3.9
/usr/local/ant/apache-ant-1.9.7
/usr/local/java/jdk1.7.0_80
/usr/local/mysql(5.6 or later)
export MAVEN_HOME=/usr/local/maven/maven-3.3.9
export ANT_HOME=/usr/local/ant/apache-ant-1.9.7
export JAVA_HOME=/usr/local/java/jdk1.7.0_80
export PATH=$PATH:$JAVA_HOME/bin:$ANT_HOME/bin:/usr/local/mysql/bin:$MAVEN_HOME/bin
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/jre/lib:$JAVA_HOME/lib/toos.jar:$ANT_HOME/lib/ant-launcher.jar:$ANT_HOME/lib/*.jar
安装路径
/opt/modules/hadoop-2.7.2
/opt/modules/hive-1.2.1
/opt/modules/hbase-1.2.1
/opt/modules/zookeeper-3.4.8
/opt/modules/sqoop-1.4.6
export HADOOP_HOME=/opt/modules/hadoop-2.7.2
export HIVE_HOME=/opt/modules/hive-1.2.1
export SQOOP_HOME=/opt/modules/sqoop-1.4.6
export HBASE_HOME=/opt/modules/hbase-1.2.1
export ZOOKEEPER_HOME=/opt/modules/zookeeper-3.4.8
export PIG_HOME=/opt/modules/pig-0.15.0
export PATH=$PATH:$HADOOP_HOME/bin:$HADOOP_HOME/sbin:$HIVE_HOME/bin:$ZOOKEEPER_HOME/bin:$HBASE_HOME/bin:$SQOOP_HOME/bin:$PIG_HOME/bin
export CLASSPATH=$CLASSPATH:$PIG_HOME/pig-0.15.0-core-h2.jar
vim /etc/hosts
192.168.2.3 hadoop
192.168.2.10 hadoop1
192.168.2.11 hadoop2
service iptables status
service iptables stop
vim /ect/sysconfig/selinux
SELINUX=disabled
ssh-keygen -t rsa
ssh-copy-id -i /home/hadoop/.ssh/id_rsa.pub ${hostname}
haodoop配置
export HADOOP_PREFIX=/opt/modules/hadoop-2.7.2
export JAVA_HOME=/usr/local/java/jdk1.7.0_80
fs.defaultFS
hdfs://hadoop:9000
hadoop.tmp.dir
/opt/modules/hadoop-2.7.2/data
io.file.buffer.size
131072
hadoop.proxyuser.hadoop.hosts
*
hadoop.proxyuser.hadoop.groups
*
dfs.namenode.secondary.http-address
hadoop:50090
dfs.replication
1
dfs.permissions.enabled
false
dfs.blocksize
33554432
dfs.namenode.name.dir
file:/opt/modules/hadoop-2.7.2/data/dfs/name
dfs.datanode.data.dir
file:/opt/modules/hadoop-2.7.2/data/dfs/data
dfs.webhdfs.enabled
true
hadoop1
hadoop2
yarn.nodemanager.aux-services
mapreduce_shuffle
yarn.nodemanager.aux-services.mapreduce.shuffle.class
org.apache.hadoop.mapred.ShuffleHandler
yarn.resourcemanager.address
hadoop:8032
yarn.resourcemanager.scheduler.address
hadoop:8030
yarn.resourcemanager.resource-tracker.address
hadoop:8031
yarn.resourcemanager.admin.address
hadoop:8033
yarn.resourcemanager.webapp.address
hadoop:8088
yarn.resourcemanager.hostname
hadoop
yarn.log-aggregation-enable
true
yarn.log-aggregation.retain-seconds
604800
mapreduce.framework.name
yarn
mapreduce.job.tracker
hdfs://hadoop:9001
true
mapreduce.jobhistory.address
hadoop:10020
mapreduce.jobhistory.webapp.address
hadoop:19888
/opt/modules/hadoop-2.7.2/data/dfs/name
/opt/modules/hadoop-2.7.2/data/dfs/data
/opt/modules/hadoop-2.7.2/data/dfs/namesecondary
export JAVA_HOME=/usr/local/java/jdk1.7.0_80
export HADOOP_HOME=/opt/modules/hadoop-2.7.2
export HIVE_CONF_DIR=/opt/modules/hive-1.2.1/conf
hive.metastore.warehouse.dir
/user/hive/warehouse
javax.jdo.option.ConnectionURL
jdbc:mysql://192.168.2.3:3306/hive
javax.jdo.option.ConnectionDriverName
com.mysql.jdbc.Driver
javax.jdo.option.ConnectionUserName
root
javax.jdo.option.ConnectionPassword
root
hive.hwi.listen.host
0.0.0.0
hive.hwi.listen.port
9999
hive.hwi.war.file
lib/hive-hwi-1.2.1.war
hive.querylog.location
/opt/modules/hive/logs
hive.aux.jars.path
file:///opt/modules/hive-1.2.1/lib/hive-hbase-handler-1.2.1.jar,file:///opt/modules/hive-1.2.1/lib/guava-14.0.1.jar,file:///opt/modules/hive-1.2.1/lib/hbase-common-1.2.1.jar,file:///opt/modules/hive-1.2.1/lib/zookeeper-3.4.8.jar
hbase.zookeeper.quorum
hadoop:2181,hadoop1:2182,hadoop2:2183
zookeeper
/opt/modules/zookeeper-3.4.8/conf/zoo.cfgserver.1=192.168.2.3:2888:3888
server.2=192.168.2.10:2888:3888
server.3=192.168.2.11:2888:3888
1
export HBASE_MANAGES_ZK=false
export JAVA_HOME=/usr/local/java/jdk1.7.0_80
export HBASE_CLASSPATH=/opt/modules/hadoop-2.7.1/etc/hadoop
hbase.rootdir
hdfs://hadoop:9000/user/hbase
hbase.cluster.distributed
true
hbase.zookeeper.property.clientPort
2181
hbase.zookeeper.quorum
hadoop,hadoop1,hadoop2
hbase.zookeeper.property.dataDir
/opt/modules/hbase-1.2.1/data
hbase.zookeeper.session.timeout
90000
hbase.tmp.dir
/opt/modules/hbase-1.2.1/data/tmp
hadoop1
hadoop2
export HADOOP_COMMON_HOME=/opt/modules/hadoop-2.7.2
export HADOOP_MAPRED_HOME=/opt/modules/hadoop-2.7.2
export HBASE_HOME=/opt/modules/hbase-1.2.1
export HIVE_HOME=/opt/modules/hive-1.2.1
export ZOOCFGDIR=/opt/modules/zookeeper-3.4.8/conf
## Moved to be a runtime check in sqoop.
# if [ ! -d "${HCAT_HOME}" ]; then
# echo "Warning: $HCAT_HOME does not exist! HCatalog jobs will fail."
# echo 'Please set $HCAT_HOME to the root of your HCatalog installation.'
# fi
# if [ ! -d "${ACCUMULO_HOME}" ]; then
# echo "Warning: $ACCUMULO_HOME does not exist! Accumulo imports will fail."
# echo 'Please set $ACCUMULO_HOME to the root of your Accumulo installation.'
# fi
# Add HCatalog to dependency list
# if [ -e "${HCAT_HOME}/bin/hcat" ]; then
# TMP_SQOOP_CLASSPATH=${SQOOP_CLASSPATH}:`${HCAT_HOME}/bin/hcat -classpath`
# if [ -z "${HIVE_CONF_DIR}" ]; then
# TMP_SQOOP_CLASSPATH=${TMP_SQOOP_CLASSPATH}:${HIVE_CONF_DIR}
# fi
# SQOOP_CLASSPATH=${TMP_SQOOP_CLASSPATH}
# fi
# Add Accumulo to dependency list
# if [ -e "$ACCUMULO_HOME/bin/accumulo" ]; then
# for jn in `$ACCUMULO_HOME/bin/accumulo classpath | grep file:.*accumulo.*jar | cut -d':' -f2`; do
# SQOOP_CLASSPATH=$SQOOP_CLASSPATH:$jn
# done
# for jn in `$ACCUMULO_HOME/bin/accumulo classpath | grep file:.*zookeeper.*jar | cut -d':' -f2`; do
# SQOOP_CLASSPATH=$SQOOP_CLASSPATH:$jn
# done
# fi
配置完成后讲hadoop,hbase,zookeeper分别复制到其他节点,并设置每个节点下zookeeper中的myid编号
传输方式为:
scp -r /opt/modules/hadop-2.7.2 hadoop1:/opt/modules/
其他依次同上,注意文件路径都要一一对应,因为复制的配置文件中的路径都是相同的.
完成后即可启动验证.