欢迎投稿

今日深度:

Hbase安装,

Hbase安装,


集群环境:

192.168.11.12  作为hbase主master

192.168.11.14  作为hbase备用master

 

192.168.11.16作为zookeeperNode/HRegionsever

192.168.11.18作为zookeeperNode/HRegionsever

192.168.11.20作为zookeeperNode/HRegionsever

 

192.168.11.12——192.168.11.20是hdfs的datanode

Hdfs的namenode为192.168.11.8 主机名为hadoopNN00

 

软件版本:

Hadoop-0.20.1-dev

Hbase-0.90.3

 

Hbase的安装是基于hdfs的,Hbase的配置主要涉及conf目录下的三个文件:hbase-env.sh,hbase-site.xml,regionserver。

Hbase-env.sh配置如下:

#必须配置的项目如下:

export JAVA_HOME=/root/jdk1.6.0_25

export HBASE_OPTS="-ea -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode"

export HBASE_MANAGES_ZK=true

export HBASE_CLASSPATH=/usr/local/hadoop-0.20.1-dev/conf

调优配置项如下:

# Extra Java CLASSPATH elements.  Optional.

# export HBASE_CLASSPATH=

 

# The maximum amount of heap to use, in MB. Default is 1000.

# export HBASE_HEAPSIZE=1000

 

# Extra Java runtime options.

# Below are what we set by default.  May only work with SUN JVM.

# For more on why as well as other possible settings,

# see http://wiki.apache.org/hadoop/PerformanceTuning

export HBASE_OPTS="-ea -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode"

 

# Uncomment below to enable java garbage collection logging.

# export HBASE_OPTS="$HBASE_OPTS -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:$HBASE_HOME/logs/gc-hbase.log"

 

# Uncomment and adjust to enable JMX exporting

# See jmxremote.password and jmxremote.access in $JRE_HOME/lib/management to configure remote password access.

# More details at: http://java.sun.com/javase/6/docs/technotes/guides/management/agent.html

#

# export HBASE_JMX_BASE="-Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false"

# export HBASE_MASTER_OPTS="$HBASE_JMX_BASE -Dcom.sun.management.jmxremote.port=10101 -javaagent:lib/HelloWorldAgent.jar"

# export HBASE_REGIONSERVER_OPTS="$HBASE_JMX_BASE -Dcom.sun.management.jmxremote.port=10102"

# export HBASE_THRIFT_OPTS="$HBASE_JMX_BASE -Dcom.sun.management.jmxremote.port=10103"

# export HBASE_ZOOKEEPER_OPTS="$HBASE_JMX_BASE -Dcom.sun.management.jmxremote.port=10104"

 

# File naming hosts on which HRegionServers will run.  $HBASE_HOME/conf/regionservers by default.

# export HBASE_REGIONSERVERS=${HBASE_HOME}/conf/regionservers

 

# Extra ssh options.  Empty by default.

# export HBASE_SSH_OPTS="-o ConnectTimeout=1 -o SendEnv=HBASE_CONF_DIR"

 

# Where log files are stored.  $HBASE_HOME/logs by default.

# export HBASE_LOG_DIR=${HBASE_HOME}/logs

 

# A string representing this instance of hbase. $USER by default.

# export HBASE_IDENT_STRING=$USER

 

# The scheduling priority for daemon processes.  See 'man nice'.

# export HBASE_NICENESS=10

 

# The directory where pid files are stored. /tmp by default.

# export HBASE_PID_DIR=/var/hadoop/pids

 

# Seconds to sleep between slave commands.  Unset by default.  This

# can be useful in large clusters, where, e.g., slave rsyncs can

# otherwise arrive faster than the master can service them.

# export HBASE_SLAVE_SLEEP=0.1

 

# Tell HBase whether it should manage it's own instance of Zookeeper or not.

 export HBASE_MANAGES_ZK=true

 export HBASE_CLASSPATH=/usr/local/hadoop-0.20.1-dev/conf

 

 

hbase-site.xml配置如下:

<?xml version="1.0"?>

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

<configuration>

<property>

<name>hbase.rootdir</name>

<value>hdfs://hadoopNN00:9000/hbase</value>

<description>The directory shared by region servers.</description>

</property>

<property>

<name>hbase.master.port</name>

<value>60000</value>

</property>

<property>

<name>hbase.cluster.distributed</name>

<value>true</value>

</property>

<property>

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

<value>/usr/local/hbase/zookeeper</value>

</property>

<property>

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

<value>2181</value>

</property>

<property>

<name>hbase.zookeeper.quorum</name>

<value>192.168.11.16,192.168.11.18,192.168.11.20</value>

</property>

</configuration>

其中,hbase.rootdir这一项的配置必须与hdfs的fs.name.default项一致,还要为hbase指定根目录/hbase

<property>

<name>hbase.rootdir</name>

<value>hdfs://hadoopNN00:9000/hbase</value>

<description>The directory shared by region servers.</description>

</property>

Regionserver的配置如下:

192.168.11.16

192.168.11.18

192.168.11.20

 

配置完毕后将hbase拷贝到各个机器中的相同目录下。

 

启动habse

在192.168.11.12上启动hbase集群:bin/start-hbase.sh,首先启动的是zookeeper,再是master,最后是HRegionserver

 

 

www.htsjk.Com true http://www.htsjk.com/hbase/42503.html NewsArticle Hbase安装, 集群环境: 192.168.11.12  作为hbase主master 192.168.11.14  作为hbase备用master   192.168.11.16作为zookeeperNode/HRegionsever 192.168.11.18作为zookeeperNode/HRegionsever 192.168.11.20作为zookeeperNode/HReg...
相关文章
    暂无相关文章
评论暂时关闭