最近又安装了一次hadoop系列,以前装过几次,但总也是磕磕碰碰的,本来想这次安装一步到位,可惜以前记录不够详细,中间还是过程还是有些遗漏,这次把过程详细记录起来。hadoop-1.1.2, hbase-0.95-hadoop1, hive-0.10 + snappy压缩。中间遇到不少坑,记录下来;由于这次目标是三件套一步到位,因此配置的时候是一块配置了,三台ubuntu机器分别为zmhadoop (hadoop master)、xbhadoop(hbase master)、 gnhadoop
首先下载三件套tar.gz 放到一台机器的/data/cloud目录下, 解压; 最好建立软连接 ln -s hadoop-1.1.2 hadoop; hbase hive同理。
配置三件套首先有要做的几件事:
ssh-keygen -t dsa -P '' -f ~/.ssh/id_dsa
cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
sudo chmod 400 ~/.ssh/authorized_keys
fs.default.name
hdfs://zmhadoop:9000
fs.checkpoint.dir
/data/cloud/dfs/namesecondary
hadoop.tmp.dir
/data/cloud/dfs/tmp
fs.checkpoint.period
1800
io.compression.codecs
org.apache.hadoop.io.compress.GzipCodec,org.apache.hadoop.io.compress.DefaultCodec,org.apache.hadoop.io.compress.BZip2Codec,org.apache.hadoop.io.compress.SnappyCodec
mapred.output.compress
true
Should the job outputs be compressed?
mapred.output.compression.codec
org.apache.hadoop.io.compress.SnappyCodec
If the job outputs are compressed, how should they be compressed?
dfs.replication
2
dfs.data.dir
/data/cloud/dfs/data
dfs.balance.bandwidthPerSec
10485760
dfs.name.dir
/data/cloud/dfs/name
mapred.job.tracker
zmhadoop:9001
mapred.system.dir
/data/cloud/dfs/mapred/system
mapred.local.dir
/data/cloud/dfs/mapred/local
mapred.temp.dir
/data/cloud/dfs/mapred/tmp
mapred.compress.map.output
true
mapred.map.output.compression.codec
org.apache.hadoop.io.compress.SnappyCodec
export JAVA_HOME=/data/jdk1.7.0_21/
export HBASE_HOME=/data/cloud/hbase
export HADOOP_HOME=/data/cloud/hadoop
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HADOOP_HOME/lib/native/Linux-amd64-64:/usr/local/lib
export JAVA_LIBRARY_PATH=$HADOOP_HOME/lib/native/Linux-amd64-64
#Extra Java CLASSPATH elements. Optional.
export HADOOP_CLASSPATH=$HADOOP_CLASSPATH:$HADOOP_HOME/lib/hadoop-snappy-0.0.1-SNAPSHOT.jar:$HBASE_HOME/conf:$HBASE_HOME/lib/zookeeper-3.4.5.jar:$HBASE_HOME/lib/hbase*.jar
hbase.rootdir
hdfs://zmhadoop:9000/hbase
hbase.cluster.distributed
true
hbase.master
xbhadoop:60000
hbase.master.port
60000
The port master should bind to.
hbase.zookeeper.quorum
xbhadoop,zmhadoop,gnhadoop
export JAVA_HOME=/data/jdk1.7.0_21/
export HBASE_OPTS="$HBASE_OPTS -XX:+HeapDumpOnOutOfMemoryError -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode"
export HBASE_MANAGES_ZK=false
export HBASE_HOME=/data/cloud/hbase
export HADOOP_HOME=/data/cloud/hadoop
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HADOOP_HOME/lib/native/Linux-amd64-64/:/usr/local/lib/
export HBASE_LIBRARY_PATH=$HBASE_LIBRARY_PATH:$HBASE_HOME/lib/native/Linux-amd64-64/:/usr/local/lib/:$HBASE_HOME/lib/hadoop-snappy-0.0.1-SNAPSHOT.jar
mysql> CREATE DATABASE metastore; mysql> USE metastore; mysql> SOURCE /usr/lib/hive/scripts/metastore/upgrade/mysql/hive-schema-0.9.0.mysql.sql;
javax.jdo.option.ConnectionURL
jdbc:mysql://MYHOST/metastore //自己用mysql登陆一下看行不行
javax.jdo.option.ConnectionDriverName
com.mysql.jdbc.Driver
javax.jdo.option.ConnectionUserName
hiveuser
javax.jdo.option.ConnectionPassword
password
datanucleus.autoCreateSchema
false
datanucleus.fixedDatastore
true
export HBASE_HOME=/data/cloud/hbase
export HADOOP_HOME=/data/cloud/hadoop
export HIVE_HOME=/data/cloud/hive
$HADOOP_HOME/bin/hadoop format namenode
$HADOOP_HOME/bin/start-all.sh
$HBASE_HOME/bin/start-hbase.sh