-----------------------------------------------------------------hadoop2.6.0+Zookeeper3.4.6+HBase0.99.2---------------------------------------------------
hadoop2.6.0+Zookeeper3.4.6+HBase0.99.2整合
前提:hadoop2.6.0和Zookeeper3.4.6已安装好。
1、解压:
[root@i-love-you local]# tar -zxvf hbase-0.99.2-bin.tar.gz
2、配置环境变量PATH:
export HBASE_HOME=/usr/local/hbase-0.99.2
export PATH=$PATH:$HBASE_HOME/bin
3、进入HBase文件配置目录:
[root@i-love-you conf]# pwd
/usr/local/hbase-0.99.2/conf
3.1、配置hbase-env.sh:
[root@i-love-you conf]# vim hbase-env.sh
export JAVA_HOME=/usr/local/jdk
#export HBASE_MANAGES_ZK=true
3.2、配置hbase-site.xml:
[root@i-love-you conf]# vim hbase-site.xml
hbase.rootdir
hdfs://192.168.1.10:9000/hbase
hbase.zookeeper.quorum
192.168.1.10
hbase.cluster.distributed
true
hbase.zookeeper.property.dataDir
/usr/local/zookeeper/data
3.3、配置regionservers:
[root@i-love-you conf]# vim regionservers
localhost
4、启动:
4.1、启动Hadoop:
[root@i-love-you hadoop]# sbin/start-hadoop.sh
starting namenode, logging to /usr/local/hadoop/logs/hadoop-root-namenode-i-love-you.out
starting datanode, logging to /usr/local/hadoop/logs/hadoop-root-datanode-i-love-you.out
starting resourcemanager, logging to /usr/local/hadoop/logs/yarn-root-resourcemanager-i-love-you.out
starting nodemanager, logging to /usr/local/hadoop/logs/yarn-root-nodemanager-i-love-you.out
starting historyserver, logging to /usr/local/hadoop/logs/yarn-root-historyserver-i-love-you.out
starting historyserver, logging to /usr/local/hadoop/logs/mapred-root-historyserver-i-love-you.out
[root@i-love-you hadoop]# jps
13018 DataNode
13244 JobHistoryServer
12964 NameNode
13080 ResourceManager
13184 ApplicationHistoryServer
13132 NodeManager
13301 Jps
[root@i-love-you hadoop]#
4.2、启动Zookeeper:
[root@i-love-you zookeeper]# bin/zkServer.sh start
JMX enabled by default
Using config: /usr/local/zookeeper/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
[root@i-love-you zookeeper]# jps
13018 DataNode
13715 QuorumPeerMain
13244 JobHistoryServer
13732 Jps
12964 NameNode
13080 ResourceManager
13184 ApplicationHistoryServer
13132 NodeManager
[root@i-love-you zookeeper]#
4.3、启动HBase:
[root@i-love-you hbase-0.99.2]# bin/start-hbase.sh
192.168.1.10: starting zookeeper, logging to /usr/local/hbase-0.99.2/bin/../logs/hbase-root-zookeeper-i-love-you.out
starting master, logging to /usr/local/hbase-0.99.2/logs/hbase-root-master-i-love-you.out
starting regionserver, logging to /usr/local/hbase-0.99.2/logs/hbase-root-1-regionserver-i-love-you.out
[root@i-love-you hbase-0.99.2]# jps
13018 DataNode
13715 QuorumPeerMain
13244 JobHistoryServer
14001 HMaster
14226 Jps
12964 NameNode
14116 HRegionServer
13080 ResourceManager
13184 ApplicationHistoryServer
13132 NodeManager
[root@i-love-you hbase-0.99.2]#
5、关闭:
关闭HBase:
[root@i-love-you hbase-0.99.2]# bin/stop-hbase.sh
stopping hbase..............................................
192.168.1.10: no zookeeper to stop because kill -0 of pid 13940 failed with status 1
[root@i-love-you hbase-0.99.2]# jps
13018 DataNode
13715 QuorumPeerMain
13244 JobHistoryServer
12964 NameNode
13080 ResourceManager
13184 ApplicationHistoryServer
13132 NodeManager
14890 Jps
[root@i-love-you hbase-0.99.2]#
关闭Zookeeper:
[root@i-love-you zookeeper]# bin/zkServer.sh stop
JMX enabled by default
Using config: /usr/local/zookeeper/bin/../conf/zoo.cfg
Stopping zookeeper ... STOPPED
[root@i-love-you zookeeper]# jps
13018 DataNode
13244 JobHistoryServer
14917 Jps
12964 NameNode
13080 ResourceManager
13184 ApplicationHistoryServer
13132 NodeManager
[root@i-love-you zookeeper]#
关闭hadoop:
[root@i-love-you hadoop]# sbin/stop-hadoop.sh
stopping namenode
stopping datanode
stopping resourcemanager
stopping nodemanager
stopping historyserver
historyserver did not stop gracefully after 5 seconds: killing with kill -9
stopping historyserver
[root@i-love-you hadoop]# jps
15054 Jps
[root@i-love-you hadoop]#
---------------------------------------------------------------------------hadoop2.6.0+hbase0.99.2----------------------------------------------------------------
hadoop2.6.0+hbase0.99.2整合
前提:hadoop2.6.0已安装好。
hbase用自带的zookeeper。
安装HBase:
1、解压:
[root@i-love-you local]# tar -zxvf hbase-0.99.2-bin.tar.gz
2、配置环境变量PATH:
export HBASE_HOME=/usr/local/hbase-0.99.2
export PATH=$PATH:$HBASE_HOME/bin
3、配置hbase-env.sh:
export JAVA_HOME=/usr/local/jdk
用自带的Zookeeper:
hbase-env.sh:
export HBASE_MANAGES_ZK=true
4、配置hbase-site.xml:
hbase-site.xml:
hbase.rootdir
hdfs://192.168.1.10:9000/hbase
hbase.zookeeper.quorum
192.168.1.10
hbase.cluster.distributed
true
5、配置regionservers:
localhost
[root@i-love-you hbase-0.99.2]# bin/start-hbase.sh
192.168.1.10: starting zookeeper, logging to /usr/local/hbase-0.99.2/bin/../logs/hbase-root-zookeeper-i-love-you.out
starting master, logging to /usr/local/hbase-0.99.2/logs/hbase-root-master-i-love-you.out
starting regionserver, logging to /usr/local/hbase-0.99.2/logs/hbase-root-1-regionserver-i-love-you.out
[root@i-love-you hbase-0.99.2]# jps
8116 NodeManager
11823 HQuorumPeer
11883 HMaster
8228 JobHistoryServer
7946 NameNode
8062 ResourceManager
8169 ApplicationHistoryServer
8000 DataNode
12082 Jps
11997 HRegionServer
[root@i-love-you hbase-0.99.2]#
===========================================================错误配置===================================================
错误配发:
安装HBase:
1、解压:
[root@i-love-you local]# tar -zxvf hbase-0.99.2-bin.tar.gz
2、配置环境变量PATH:
export HBASE_HOME=/usr/local/hbase-0.99.2
export PATH=$PATH:$HBASE_HOME/bin
3、配置hbase-env.sh:
export JAVA_HOME=/usr/local/jdk
如果用自己的Zookeeper就把这句话注释掉:
# export HBASE_MANAGES_ZK=true
4、配置hbase-site.xml:
hbase.rootdir
hdfs://192.168.1.10:9000/hbase
hbase.cluster.distributed
true
hbase.zookeeper.quorum
192.168.1.10
hbase.zookeeper.property.dataDir
/usr/local/zookeeper/data
hbase.tmp.dir
/usr/local/hbase-0.99.2/hbase_tmp
5、配置regionservers:
[root@i-love-you conf]# vim regionservers
[root@i-love-you conf]# more regionservers //这里不应该写IP地址,要写localhost
192.168.1.10
[root@i-love-you conf]#
启动:
启动hadoop:
[root@i-love-you hadoop]# sbin/start-hadoop.sh
starting namenode, logging to /usr/local/hadoop/logs/hadoop-root-namenode-i-love-you.out
starting datanode, logging to /usr/local/hadoop/logs/hadoop-root-datanode-i-love-you.out
starting resourcemanager, logging to /usr/local/hadoop/logs/yarn-root-resourcemanager-i-love-you.out
starting nodemanager, logging to /usr/local/hadoop/logs/yarn-root-nodemanager-i-love-you.out
starting historyserver, logging to /usr/local/hadoop/logs/yarn-root-historyserver-i-love-you.out
DEPRECATED: Use of this command to start the timeline server is deprecated.
Instead use the timelineserver command for it.
starting historyserver, logging to /usr/local/hadoop/logs/mapred-root-historyserver-i-love-you.out
[root@i-love-you hadoop]# jps
2065 NameNode
2308 JobHistoryServer
2115 DataNode
2344 Jps
2170 ResourceManager
2214 NodeManager
2258 ApplicationHistoryServer
启动Zookeeper:
[root@i-love-you zookeeper]# bin/zkServer.sh start
JMX enabled by default
Using config: /usr/local/zookeeper/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
[root@i-love-you zookeeper]# jps
2065 NameNode
2815 QuorumPeerMain
2308 JobHistoryServer
2115 DataNode
2832 Jps
2170 ResourceManager
2214 NodeManager
2258 ApplicationHistoryServer
[root@i-love-you zookeeper]#
启动HBase:
[root@i-love-you hbase-0.99.2]# bin/start-hbase.sh
192.168.1.10: starting zookeeper, logging to /usr/local/hbase-0.99.2/bin/../logs/hbase-root-zookeeper-i-love-you.out
starting master, logging to /usr/local/hbase-0.99.2/logs/hbase-root-master-i-love-you.out
192.168.1.10: starting regionserver, logging to /usr/local/hbase-0.99.2/bin/../logs/hbase-root-regionserver-i-love-you.out
[root@i-love-you hbase-0.99.2]# jps
2065 NameNode
2815 QuorumPeerMain
2308 JobHistoryServer
5964 HRegionServer
2115 DataNode
5836 HMaster
2170 ResourceManager
2214 NodeManager
2258 ApplicationHistoryServer
6007 Jps
[root@i-love-you hbase-0.99.2]#
上面的方法有问题,HMaster和HRegionServer共用一个IP地址,只能是其中一个被启动,另外则显示端口被占用。