Hadoop2.7.3+HBase1.2.5+ZooKeeper3.4.6搭建分布式集群环境
export JAVA_HOME=/usr/java/jdk1.8.0_111 # 不同的jdk路径需要修改此项
export PATH=$JAVA_HOME/bin:$PATH
export HADOOP_HOME=/data/yunva/hadoop-2.7.3
export HADOOP_INSTALL=$HADOOP_HOME
export HADOOP_MAPRED_HOME=$HADOOP_HOME
export HADOOP_COMMON_HOME=$HADOOP_HOME
export HADOOP_HDFS_HOME=$HADOOP_HOME
export YARN_HOME=$HADOOP_HOME
export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_HOME/lib/native
export PATH=$PATH:$HADOOP_HOME/sbin:$HADOOP_HOME/bin
export HADOOP_SSH_OPTS="-p 48490" # 非默认ssh的22号端口需要添加此项,表示端口为48490
2.3.1 设置master无密码自动登陆slave1和slave2
3.1.1 core-site.xml
可参考 centos6.5环境下zookeeper-3.4.6集群环境部署及单机部署详解http://blog.csdn.net/reblue520/article/details/52279486
# cd /data/yunva/hbase-1.2.5/
[root@test6_vedio hbase-1.2.5]# bin/hbase shell
2017-04-28 09:51:51,479 WARN [main] util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/data/yunva/hbase-1.2.5/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/data/yunva/hadoop-2.7.3/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
HBase Shell; enter 'help' for list of supported commands.
Type "exit" to leave the HBase Shell
Version 1.2.5, rd7b05f79dee10e0ada614765bb354b93d615a157, Wed Mar 1 00:34:48 CST 2017
hbase(main):001:0> list
TABLE
0 row(s) in 0.2620 seconds
=> []
hbase(main):003:0> create 'scores', 'grade', 'course'
0 row(s) in 1.3300 seconds
=> Hbase::Table - scores
hbase(main):004:0> list
TABLE
scores
1 row(s) in 0.0100 seconds
=> ["scores"]
[root@test6_vedio zookeeper-3.4.6]# bin/zkCli.sh -server
2017-04-28 10:04:33,083 [myid:] - INFO [main:Environment@100] - Client environment:zookeeper.version=3.4.6-1569965, built on 02/20/2014 09:09 GMT
2017-04-28 10:04:33,088 [myid:] - INFO [main:Environment@100] - Client environment:host.name=test6_vedio
2017-04-28 10:04:33,088 [myid:] - INFO [main:Environment@100] - Client environment:java.version=1.8.0_111
2017-04-28 10:04:33,091 [myid:] - INFO [main:Environment@100] - Client environment:java.vendor=Oracle Corporation
2017-04-28 10:04:33,091 [myid:] - INFO [main:Environment@100] - Client environment:java.home=/usr/java/jdk1.8.0_111/jre
2017-04-28 10:04:33,091 [myid:] - INFO [main:Environment@100] - Client environment:java.class.path=/data/yunva/zookeeper-3.4.6/bin/../build/classes:/data/yunva/zookeeper-3.4.6/bin/../build/lib/*.jar:/data/yunva/zookeeper-3.4.6/bin/../lib/slf4j-log4j12-1.6.1.jar:/data/yunva/zookeeper-3.4.6/bin/../lib/slf4j-api-1.6.1.jar:/data/yunva/zookeeper-3.4.6/bin/../lib/netty-3.7.0.Final.jar:/data/yunva/zookeeper-3.4.6/bin/../lib/log4j-1.2.16.jar:/data/yunva/zookeeper-3.4.6/bin/../lib/jline-0.9.94.jar:/data/yunva/zookeeper-3.4.6/bin/../zookeeper-3.4.6.jar:/data/yunva/zookeeper-3.4.6/bin/../src/java/lib/*.jar:/data/yunva/zookeeper-3.4.6/bin/../conf:
2017-04-28 10:04:33,091 [myid:] - INFO [main:Environment@100] - Client environment:java.library.path=/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
2017-04-28 10:04:33,091 [myid:] - INFO [main:Environment@100] - Client environment:java.io.tmpdir=/tmp
2017-04-28 10:04:33,091 [myid:] - INFO [main:Environment@100] - Client environment:java.compiler=
2017-04-28 10:04:33,092 [myid:] - INFO [main:Environment@100] - Client environment:os.name=Linux
2017-04-28 10:04:33,092 [myid:] - INFO [main:Environment@100] - Client environment:os.arch=amd64
2017-04-28 10:04:33,092 [myid:] - INFO [main:Environment@100] - Client environment:os.version=2.6.32-431.11.25.el6.ucloud.x86_64
2017-04-28 10:04:33,092 [myid:] - INFO [main:Environment@100] - Client environment:user.name=root
2017-04-28 10:04:33,092 [myid:] - INFO [main:Environment@100] - Client environment:user.home=/root
2017-04-28 10:04:33,092 [myid:] - INFO [main:Environment@100] - Client environment:user.dir=/data/yunva/zookeeper-3.4.6
2017-04-28 10:04:33,094 [myid:] - INFO [main:ZooKeeper@438] - Initiating client connection, connectString=localhost:2181 sessionTimeout=30000 watcher=org.apache.zookeeper.ZooKeeperMain$MyWatcher@446cdf90
Welcome to ZooKeeper!
2017-04-28 10:04:33,128 [myid:] - INFO [main-SendThread(localhost:2181):ClientCnxn$SendThread@975] - Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
JLine support is enabled
2017-04-28 10:04:33,209 [myid:] - INFO [main-SendThread(localhost:2181):ClientCnxn$SendThread@852] - Socket connection established to localhost/127.0.0.1:2181, initiating session
2017-04-28 10:04:33,218 [myid:] - INFO [main-SendThread(localhost:2181):ClientCnxn$SendThread@1235] - Session establishment complete on server localhost/127.0.0.1:2181, sessionid = 0x35bb23d68ba0003, negotiated timeout = 30000
WATCHER::
WatchedEvent state:SyncConnected type:None path:null
[zk: localhost:2181(CONNECTED) 0] ls /
zookeeper hbase
[zk: localhost:2181(CONNECTED) 0] ls /hbase
[replication, meta-region-server, rs, splitWAL, backup-masters, table-lock, flush-table-proc, region-in-transition, online-snapshot, master, running, recovering-regions, draining, namespace, hbaseid, table]
http://IP:50070/dfshealth.html#tab-overview