>  기사  >  데이터 베이스  >  HBase伪集群配置

HBase伪集群配置

WBOY
WBOY원래의
2016-06-07 16:31:081235검색

与Hadoop一样,HBase也有三种运行模式:Standalone,?Distributed,?Pseudo-distributed。其中,Pseudo-distributed称为伪集群模式,与Distributed基本一样,只不过进程都运行在一台机器上。1、对HDFS配置伪集群模式。见:Hadoop伪集群测试?与?Hadoop集群配置

与Hadoop一样,HBase也有三种运行模式:Standalone,?Distributed,?Pseudo-distributed。 其中,Pseudo-distributed称为伪集群模式,与Distributed基本一样,只不过进程都运行在一台机器上。 1、对HDFS配置伪集群模式。 见:Hadoop伪集群测试?与?Hadoop集群配置详细版 2、配置HBase hbase-site.xml
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="http://www.coder4.com/archives/configuration.xsl"?>
        hbase.rootdir
        hdfs://localhost:9000/hbase
        hbase.cluster.distributed
        true
        hbase.zookeeper.quorum
        localhost
        hbase.zookeeper.property.dataDir
        /home/liheyuan/soft/hbase-0.94.9/zk_data
3、启动 执行一键脚本,将启动hbase进程,以及内置的zookeeper服务器。
./bin/start-hbase.sh
jps应该至少有以下进程启动。
14962 HQuorumPeer
15274 HRegionServer
15034 HMaster
注意,HBase的集群启动相当慢,清检查log确定完全启动后,再用Java客户端、cli连接。 4、Java API连接
Configuration conf = new Configuration();
conf.set("hbase.zookeeper.quorum", "localhost");
pool = new HTablePool(conf, 1);
pool.getTable("test");
   
성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.