1.hbase依賴於zookeeper,使用前須要安裝zookeepershell
# 下載 wget https://mirrors.tuna.tsinghua.edu.cn/apache/zookeeper/zookeeper-3.4.14/zookeeper-3.4.14.tar.gz # 解壓 tar -zxvf zookeeper-3.4.14.tar.gz # 重命名 mv zookeeper-3.4.14 zookeeper
2.配置apache
#內部配置能夠不變,僅需拷貝一份 cd zookeeper/conf cp zoo_sample.cfg zoo.cfg
3.啓動zookeepervim
cd zookeeper/bin ./zkServer.sh start
1.下載解壓分佈式
wget https://mirrors.tuna.tsinghua.edu.cn/apache/hbase/1.6.0/hbase-1.6.0-bin.tar.gz tar -zxvf hbase-1.6.0-bin.tar.gz mv hbase-1.6.0-bin hbase
2.配置oop
cd hbase/conf vim hbase-env.sh # 編輯hbase-env.sh文件,將一項參數改成false。即便用外部的zookeeper export HBASE_MANAGES_ZK=false vim hbase-site.xml # 編輯hbase配置文件,寫入如下內容 # hbase.zookeeper.quorum項能夠暫不用配置,由於是僞分佈式 <configuration> <property> <name>hbase.rootdir</name> <value>hdfs://hadoop:9000/hbase</value> </property> <property> <name>hbase.zookeeper.property.dataDir</name> <value>/home/hadoop/hbase/data/zookeeper</value> </property> <property> <name>hbase.cluster.distributed</name> <value>true</value> </property> <property> <name>hbase.unsafe.stream.capability.enforce</name> <value>false</value> </property> </configuration>
3.啓動code
cd hbase/bin ./start-hbase.sh # 能夠經過jps命令查看是否成功啓動 # 92001 HMaster(表明成功啓動) # 92512 Jps # 92184 HRegionServer # 39610 RunJar # 38475 NameNode # 39421 NodeManager # 38638 DataNode # 38846 SecondaryNameNode # 39102 ResourceManager # 使用hbase shell ./hbase shell
1.xml
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=128m; support was removed in 8.0 Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0
解決辦法:hadoop
vim hbase/conf/hbase-env.sh # 將如下兩行註釋掉 export HBASE_MASTER_OPTS="$HBASE_MASTER_OPTS -XX:PermSize=128m -XX:MaxPermSize=128m -XX:ReservedCodeCacheSize=256m" export HBASE_REGIONSERVER_OPTS="$HBASE_REGIONSERVER_OPTS -XX:PermSize=128m -XX:MaxPermSize=128m -XX:ReservedCodeCacheSize=256m"