Node | Master | Zookeeper | RegionServer |
---|---|---|---|
master | O | X | X |
slave01 | X | O | O |
slave02 | X | O | O |
slave03 | X | O | O |
위 표에서 Hadoop과의 호환성을 확인한 뒤 알맞은 버전을 다운로드 합니다.
cd ~
wget http://apache.mirror.cdnetworks.com/hbase/2.2.5/hbase-2.2.5-bin.tar.gz
tar xzvf hbase-2.2.5-bin.tar.gz
rm -rf hbase-2.2.5-bin.tar.gz
mv hbase-2.2.5 hbase
export HBASE_HOME=~/hbase
export HBASE_CONF_DIR=~/hbase/conf
export PATH=$PATH:$HBASE_HOME/bin
export HBASE_LOG_DIR=$HADOOP_LOG_DIR
export HBASE_SSH_OPTS="-p해당하는 포트번호"
<configuration> ... </configuration>
을 삭제한 뒤 아래 코드를 복사하여 붙여넣기 합니다. HQuorumPeer는 HBase에서 실행하는 Zookeeper이고, QuorumPeerMain은 사용자가 설치한 Zookeeper입니다. 둘 중 하나 선택하시면 되나 Zookeeper를 직접 구성하여 QuorumpeerMain으로 실행하는 것을 권장드립니다.<configuration>
<property>
<name>hbase.rootdir</name>
<value>hdfs://master:9000/hbase</value>
</property>
<property>
<name>hbase.cluster.distributed</name> # Fully distributed 모드로 구축하기 위해서 true를 설정
<value>true</value>
</property>
<property>
<name>hbase.master.port</name>
<value>60000</value>
</property>
<property>
<name>hbase.master.info.port</name>
<value>60010</value>
</property>
<property>
<name>hbase.zookeeper.quorum</name> # zookeeper quorum 설정
<value>slave01,slave02,slave03</value>
</property>
<property>
<name>hbase.zookeeper.property.dataDir</name>
<value>/data1/hadoop/zookeeper</value>
</property>
<property>
<name>hbase.zookeeper.property.maxClientCnxns</name>
<value>1000</value>
</property>
<property>
<name>zookeeper.session.timeout</name>
<value>240000</value>
</property>
<property>
<name>hbase.master.wait.on.regionservers.mintostart</name>
<value>1</value>
</property>
<property>
<name>hbase.hregion.max.filesize</name>
<value>1073741824</value>
</property>
<property>
<name>hbase.regionserver.handler.count</name>
<value>200</value>
</property>
<property>
<name>hbase.hregion.memstore.flush.size</name>
<value>268435456</value>
</property>
<property>
<name>hbase.hregion.memstore.block.multiplier</name>
<value>8</value>
</property>
<property>
<name>hbase.hstore.blockingStoreFiles</name>
<value>20</value>
</property>
<property>
<name>hbase.regionserver.global.memstore.upperLimit</name>
<value>0.45</value>
</property>
<property>
<name>hbase.regionserver.global.memstore.lowerLimit</name>
<value>0.4</value>
</property>
<property>
<name>hfile.block.cache.size</name>
<value>0.3</value>
</property>
<property>
<name>hbase.thrift.minWorkerThreads</name>
<value>256</value>
</property>
</configuration>
<configuration>
<property>
<name>hbase.rootdir</name>
<value>hdfs://master:9000/hbase</value>
</property>
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
</property>
<property>
<name>hbase.zookeeper.property.clientPort</name>
<value>2181</value>
<description>Property from ZooKeepers config zoo.cfg. The port at which the clients will connect.</description>
</property>
</configuration>
export JAVA_HOME=${JAVA_HOME}
export HBASE_OPTS="-XX:+UseConcMarkSweepGC"
export HBASE_MASTER_OPTS="$HBASE_MASTER_OPTS $HBASE_JMX_BASE -Xmx24576m"
export HBASE_REGIONSERVER_OPTS="$HBASE_REGIONSERVER_OPTS $HBASE_JMX_BASE -Xmx24576m"
export HBASE_ZOOKEEPER_OPTS="$HBASE_ZOOKEEPER_OPTS $HBASE_JMX_BASE -Xmx4096m"
export HBASE_NICENESS=5
export HBASE_MANAGES_ZK=true #126번 라인
slave01
slave02
slave03
vi backup-masters
slave01
mkdir /data1/hadoop/zookeeper
chown 777 /data1/hadoop/zookeeper
scp -r ~/hbase (계정)@slave02:/data1/hadoop
scp -r ~/hbase (계정)@slave03:/data1/hadoop
start-hbase.sh
jps
hbase shell
cd ~/hbase/bin
./hbase-daemon.sh start rest
cd ~/hbase/bin
./hbase-daemon.sh start thrift