Hbase深入学习(二) 安装hbase

Hbase深入学习(二) 安装hbase

This guidedescribes setup of a standalone hbase instance that uses the local filesystem. Itleads you through creating a table, inserting rows via the hbase shell, andthen cleaning up and shutting down your standalone hbase instance.

Uncompress thehbase download file, before starting it, edit conf/hbase-site.xml, the file youwrite your site-specific configurations into. Set hbase.rootdir, the directoryhbase writes data to, and hbase.zookeeper.property.datadir, the director zookeeperwrites its data too:

<?xmlversion="1.0"?>

<?xml-stylesheettype="text/xsl" href="configuration.xsl"?>

<configuration>

<property>

<name>hbase.rootdir</name>

<value>file:///DIRECTORY/hbase</value>

</property>

<property>

<name>hbase.zookeeper.property.dataDir</name>

<value>/DIRECTORY/zookeeper</value>

</property>

</configuration>

Replace DIRECTORYin the above with the path to the directory you would have HBase and ZooKeeperwrite their data. By default, hbase.rootdir is set to /tmp/hbase-${user.name}and similarly so for the default ZooKeeper data location which means you'lllose all your data whenever your server reboots unless you change it (Mostoperating systems clear /tmp on restart).

Edit hbase-config.sh,export JAVA_HOME=/export/opt/jrockit/6.0_14R27.6.5l64

$ ./start-hbase.sh

[WARN ]-XX:OnOutOfMemoryError=kill -9 %p is not a valid VM option. Ignoring

[WARN ]-XX:+UseConcMarkSweepGC is not a valid VM option. Ignoring

starting master,logging to /home/yj70978/hbase-0.94.11/bin/../logs/hbase-yj70978-master-retailvm1d.out

[WARN ]-XX:OnOutOfMemoryError=kill -9 %p is not a valid VM option. Ignoring

[WARN ]-XX:+UseConcMarkSweepGC is not a valid VM option. Ignoring

$ ps -ef | grephbase

yj70978  25111    1 42 03:33 pts/4    00:00:06/export/opt/jrockit/6.0_14R27.6.5l64/bin/java -XX:OnOutOfMemoryError=kill -9 %p-Xmx1000m -XX:+UseConcMarkSweepGC-Dhbase.log.dir=/home/yj70978/hbase-0.94.11/bin/../logs-Dhbase.log.file=hbase-yj70978-master-retailvm1d.log -Dhbase.home.dir=/home/yj70978/hbase-0.94.11/bin/..-Dhbase.id.str=yj70978 -Dhbase.root.logger=INFO,DRFA-Djava.library.path=/home/yj70978/hbase-0.94.11/bin/../lib/native/Linux-amd64-64-Dhbase.security.logger=INFO,DRFAS -classpath /home/yj70978/hbase-0.94.11/bin/../conf:/export/opt/jrockit/6.0_14R27.6.5l64/lib/tools.jar:/home/yj70978/hbase-0.94.11/bin/..:/home/yj70978/hbase-0.94.11/bin/../hbase-0.94.11.jar:/home/yj70978/hbase-0.94.11/bin/../hbase-0.94.11-tests.jar:/home/yj70978/hbase-0.94.11/bin/../lib/activation-1.1.jar:/home/yj70978/hbase-0.94.11/bin/../lib/asm-3.1.jar:/home/yj70978/hbase-0.94.11/bin/../lib/avro-1.5.3.jar:/home/yj70978/hbase-0.94.11/bin/../lib/avro-ipc-1.5.3.jar:/home/yj70978/hbase-0.94.11/bin/../lib/commons-beanutils-1.7.0.jar:/home/yj70978/hbase-0.94.11/bin/../lib/commons-beanutils-core-1.8.0.jar:/home/yj70978/hbase-0.94.11/bin/../lib/commons-cli-1.2.jar:/home/yj70978/hbase-0.94.11/bin/../lib/commons-codec-1.4.jar:/home/yj70978/hbase-0.94.11/bin/../lib/commons-collections-3.2.1.jar:/home/yj70978/hbase-0.94.11/bin/../lib/commons-configuration-1.6.jar:/home/yj70978/hbase-0.94.11/bin/../lib/commons-digester-1.8.jar:/home/yj70978/hbase-0.94.11/bin/../lib/commons-el-1.0.jar:/home/yj70978/hbase-0.94.11/bin/../lib/commons-httpclient-3.1.jar:/home/yj70978/hbase-0.94.11/bin/../lib/commons-io-2.1.jar:/home/yj70978/hbase-0.94.11/bin/../lib/commons-lang-2.5.jar:/home/yj70978/hbase-0.94.11/bin/../lib/commons-logging-1.1.1.jar:/home/yj70978/hbase-0.94.11/bin/../lib/commons-math-2.1.jar:/home/yj70978/hbase-0.94.11/bin/../lib/commons-net-1.4.1.jar:/home/yj70978/hbase-0.94.11/bin/../lib/core-3.1.1.jar:/home/yj70978/hbase-0.94.11/bin/../lib/guava-11.0.2.jar:/home/yj70978/hbase-0.94.11/bin/../lib/hadoop-core-1.0.4.jar:/home/yj70978/hbase-0.94.11/bin/../lib/high-scale-lib-1.1.1.jar:/home/yj70978/hbase-0.94.11/bin/../lib/httpclient-4.1.2.jar:/home/yj70978/hbase-0.94.11/bin/../lib/httpcore-4.1.3.jar:/home/yj70978/hbase-0.94.11/bin/../lib/jackson-core-asl-1.8.8.jar:/home/yj70978/hbase-0.94.11/bin/../lib/jackson-jaxrs-1.8.8.jar:/home/yj70978/hbase-0.94.11/bin/../lib/jackson-mapper-asl-1.8.8.jar:/home/yj70978/hbase-0.94.11/bin/../lib/jackson-xc-1.8.8.jar:/home/yj70978/hbase-0.94.11/bin/../lib/jamon-runtime-2.3.1.jar:/home/yj70978/hbase-0.94.11/bin/../lib/jasper-compiler-5.5.23.jar:/home/yj70978/hbase-0.94.11/bin/../lib/jasper-runtime-5.5.23.jar:/home/yj70978/hbase-0.94.11/bin/../lib/jaxb-api-2.1.jar:/home/yj70978/hbase-0.94.11/bin/../lib/jaxb-impl-2.2.3-1.jar:/home/yj70978/hbase-0.94.11/bin/../lib/jersey-core-1.8.jar:/home/yj70978/hbase-0.94.11/bin/../lib/jersey-json-1.8.jar:/home/yj70978/hbase-0.94.11/bin/../lib/jersey-server-1.8.jar:/home/yj70978/hbase-0.94.11/bin/../lib/jettison-1.1.jar:/home/yj70978/hbase-0.94.11/bin/../lib/jetty-6.1.26.jar:/home/yj70978/hbase-0.94.11/bin/../lib/jetty-util-6.1.26.jar:/home/yj70978/hbase-0.94.11/bin/../lib/jruby-complete-1.6.5.jar:/home/yj70978/hbase-0.94.11/bin/../lib/jsp-2.1-6.1.14.jar:/home/yj70978/hbase-0.94.11/bin/../lib/jsp-api-2.1-6.1.14.jar:/home/yj70978/hbase-0.94.11/bin/../lib/jsr305-1.3.9.jar:/home/yj70978/hbase-0.94.11/bin/../lib/junit-4.10-HBASE-1.jar:/home/yj70978/hbase-0.94.11/bin/../lib/libthrift-0.8.0.jar:/home/yj70978/hbase-0.94.11/bin/../lib/log4j-1.2.16.jar:/home/yj70978/hbase-0.94.11/bin/../lib/metrics-core-2.1.2.jar:/home/yj70978/hbase-0.94.11/bin/../lib/netty-3.2.4.Final.jar:/home/yj70978/hbase-0.94.11/bin/../lib/protobuf-java-2.4.0a.jar:/home/yj70978/hbase-0.94.11/bin/../lib/servlet-api-2.5-6.1.14.jar:/home/yj70978/hbase-0.94.11/bin/../lib/slf4j-api-1.4.3.jar:/home/yj70978/hbase-0.94.11/bin/../lib/slf4j-log4j12-1.4.3.jar:/home/yj70978/hbase-0.94.11/bin/../lib/snappy-java-1.0.3.2.jar:/home/yj70978/hbase-0.94.11/bin/../lib/stax-api-1.0.1.jar:/home/yj70978/hbase-0.94.11/bin/../lib/velocity-1.7.jar:/home/yj70978/hbase-0.94.11/bin/../lib/xmlenc-0.52.

you should now havea running standalone hbase instance. In standalone mode, hbase runs all daemonsin the one jvm;i.e. both the hbase and zookeeper daemons. Hbase logs can befound in the logs subdirectory. Check them out especially of it seems hbase hadtrouble starting.

Log in here: /home/yj70978/hbase-0.94.11/bin/../logs/hbase-yj70978-master-retailvm1d.out

上一篇:IOS开发中Xcode常用插件安装与管理(转)


下一篇:安装jdk java -version 不是自己所需要的版本