Package path: young@ds85:~/something/download
=====================================================================
1 安装环境
sudo apt-get install default-jdk
2 安装hadoop
tar xzf hadoop-2.4.0.tar.gz
sudo mv hadoop-2.4.0/ /usr/local
cd /usr/local
sudo ln -s hadoop-2.4.0/ hadoop
3 加一个 hadoop 用户
sudo chown -R hadoop:hadoop /usr/local/hadoop*
sudo su - hadoop
ssh-keygen -t rsa -P ""
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
sudo mkdir /usr/local/hadoop/tmp
4 配置 hadoop
修改 /usr/local/hadoop/etc/hadoop/hadoop-env.sh 在 export JAVA_HOME=${JAVA_HOME} 行前面插入如下内容
export HADOOP_CONF_DIR=/usr/local/hadoop/etc/hadoop
修改 /usr/local/hadoop/etc/hadoop/core-site.xml 在 <configuration> 后面增加
<name>fs.default.name</name>
<value>hdfs://localhost:9000</value>
</property>
<property>
<name>hadoop.tmp.dir</name>
<value>/usr/local/hadoop/tmp</value>
</property>
5 格式化 hadoop
6 启动 hadoop
7 测试 hadoop
#8 停止 hadoop
#/usr/local/hadoop/sbin/stop-all.sh
9 退出 hadoop 用户
exit
--------------------------------------
HBASE
1 安装:
tar xzf hbase-0.98.6-hadoop2-bin.tar.gz
sudo mv hbase-0.98.6-hadoop2 /usr/local/
cd /usr/local/
sudo ln -s hbase-0.98.6-hadoop2/ hbase
sudo chown -R hadoop:hadoop hbase*
2 配置:
编辑 /usr/local/hbase/conf/hbase-env.sh 找到 export JAVA_HOME 的行,在后面插入:
export HBASE_HOME=/usr/local/hbase
编辑 /usr/local/hbase/conf/hbase-site.xml 在 <configuration> 行后面插入:
<name>hbase.rootdir</name>
<value>hdfs://localhost:9000/hbase</value>
</property>
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
3 启动:
4 测试:
hbase(main):001:0> status
#5 关闭:
#/usr/local/hbase/bin/stop-hbase.sh