标签:hbase hadoop
HBase是Apache Hadoop中的一个子项目,Hbase依托于Hadoop的HDFS作为最基本存储基础单元,通过使用hadoop的DFS工具就可以看到这些这些数据 存储文件夹的结构,还可以通过Map/Reduce的框架(算法)对HBase进行操作;HBase 不同于一般的关系数据库,它是一个适合于非结构化数据存储的数据库.所谓非结构化数据存储就是说HBase是基于列的而不是基于行的模式,这样方面读写大数据内容。
tarxvfhbase-0.98.3.tar.gzmv hbase-0.98.3 hbase
修改hbase/conf/hbase-site.xml
<configuration> <property> <name>hbase.rootdir</name> <value>hdfs://h1:9000/hbase</value> </property> <property> <name>hbase.zookeeper.quorum</name> <value>h1,h2,h3</value> </property> <property> <name>hbase.master.port</name> <value>60000</value> </property> <property> <name>hbase.cluster.distributed</name> <value>true</value> </property><property> <name>hbase.snapshot.enabled</name> <value>true</value> </property><!-- replication related --> <property> <name>hbase.replication</name> <value>true</value> </property> <property> <name>replication.source.nb.capacity</name> <value>5000</value> </property> <property> <name>replication.source.size.capacity</name> <value>4194304</value> </property> <property> <name>replication.source.ratio</name> <value>1</value> </property> <property> <name>replication.sleep.before.failover</name> <value>1000</value> </property> <!-- the following three configuration enable hindex--> <!--<property> <name>hbase.use.secondary.index</name> <value>true</value> </property>--> <property> <name>hbase.hregion.majorcompaction</name> <value>0</value> </property> <property> <name>hbase.hstore.blockingWaitTime</name> <value>30000</value> </property> <property> <name>hbase.hstore.blockingStoreFiles</name> <value>10</value></property> <property> <name>hbase.regionserver.handler.count</name> <value>100</value> </property> <property> <name>hbase.regionserver.checksum.verify</name> <value>false</value></property> <property> <name>hbase.regionserver.thread.compaction.small</name> <value>2</value></property><property> <name>hbase.regionserver.thread.compaction.large</name> <value>1</value></property><property> <name>hbase.hregion.memstore.flush.size</name> <value>67108864</value></property><property> <name>hbase.hregion.memstore.mslab.enabled</name> <value>true</value></property><property> <name>hbase.hregion.memstore.mslab.chunksize</name> <value>2097152</value></property><property> <name>hbase.hregion.memstore.mslab.max.allocation</name> <value>262144</value></property><property> <name>hbase.regionserver.global.memstore.lowerLimit</name> <value>0.35</value></property><property> <name>hbase.regionserver.global.memstore.upperLimit</name> <value>0.4</value></property><property> <name>hbase.hregion.memstore.block.multiplier</name> <value>2</value></property><property> <name>dfs.client.read.shortcircuit</name> <value>true</value></property> <property> <name>zookeeper.session.timeout</name> <value>270000</value></property><property> <name>hbase.zookeeper.property.tickTime</name> <value>6000</value></property> <property> <name>hbase.regionserver.restart.on.zk.expire</name> <value>true</value></property> <property> <name>hbase.hregion.max.filesize</name> <value>2147483648</value></property> <property> <name>hbase.use.secondary.index</name> <value>true</value></property><property><name>hbase.coprocessor.master.classes</name><value>org.apache.hadoop.hbase.index.coprocessor.master.IndexMasterObserver,com.tsinghuabigdata.hes.MasterHandler</value></property><property> <name>hbase.coprocessor.region.classes</name> <!--<value>org.apache.hadoop.hbase.index.coprocessor.regionserver.IndexRegionObserver,com.tsinghuabigdata.hes.RegionServerHandler,com.tsinghuabigdata.hes.RegionHandler</value>--><value>org.apache.hadoop.hbase.index.coprocessor.regionserver.IndexRegionObserver</value></property><property> <name>hbase.coprocessor.wal.classes</name> <value>org.apache.hadoop.hbase.index.coprocessor.wal.IndexWALObserver</value></property> <property> <name>hbase.rpc.timeout</name> <value>300000</value></property><property> <name>hbase.client.scanner.timeout.period</name> <value>300000</value></property><property> <name>hbase.client.scanner.caching</name> <value>50</value></property> <property> <name>hbase.regionserver.wal.enablecompression</name> <value>false</value></property><property> <name>hbase.server.thread.wakefrequency</name> <value>1000</value></property> <property> <name>hbase.balancer.period</name> <value>300000</value></property><property> <name>dfs.domain.socket.path</name> <value>/var/run/hadoop-hdfs/dn._PORT</value></property></configuration>
修改hbase/conf/regionserver
h2h3
分发hbase
scp hbase/ h2:/home/hadoop/scp hbase/ h3:/home/hadoop/
启动hbase
hbase/bin/start-hbase.sh
Web查看状态h1ip:60010
导表
bin/hbase org.apache.hadoop.hbase.mapreduce.Import ${table} /hbase_dump/${table}
标签:hbase hadoop
原文地址:http://chengongliang.blog.51cto.com/10693153/1761646