Hbase之环境配置
Posted Justin的后端书架
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Hbase之环境配置相关的知识,希望对你有一定的参考价值。
软件下载
jdk-8u151-linux-x64.tar.gz
hadoop-2.5.0-cdh5.3.6.tar.gz
hbase-0.98.6-cdh5.2.0.tar.gz
zookeeper-3.4.5-cdh5.3.6.tar.gz
配置:
新建用户及目录 à 目录权限设置 à 解压文件 à 修改配置文件
HDFS configuration file
hadoop core-site.xml(添加配置参数)
<configuration>
<property>
<name>fs.defaultFS</name>
<value>hdfs://hbase01:8020</value> ---指定Hadoop访问地址
</property>
<property>
<name>hadoop.tmp.dir</name>
<value>/opt/data/hadoop/tmp</value>
</property>
<property>
<name>hadoop.http.staticuser.user</name>
<value>user1</value> ---指定Hadoop 用户
</property>
<property>
<name>hadoop.proxyuser.user1.hosts</name>
<value>*</value> --- ‘*’代表所有
</property>
<property>
<name>hadoop.proxyuser.user1.groups</name>
<value>*</value> --- ‘*’代表所有
</property>
</configuration>hadoop-env.sh
export Java_Home = /opt/apps/java/ ---指定Java_Home
hdfs-site.xml(添加配置参数)
<configuration>
<property>
<name>dfs.replecation</name> --指定可用副本数
<value>1</value>
</property>
<property>
<name>dfs.namenode.secondary.http-address</name>
<value>hdfs://hbase01:50090</value> --指定辅助namenode地址及端口
</property>
<property>
<name>dfs.permissions.enable</name>
<value>false</value>
</property>
</configuration>mapred-env.sh
export Java_Home = /opt/apps/java/ ---指定Java_Home
mapred-site.xml
export Java_Home = /opt/apps/java/ ---指定Java_Home
yarn-env.sh
export Java_Home = /opt/apps/java/ ---指定Java_Home
yarn-site.xml(添加配置参数)
<configuration>
<!-- Site specific YARN configuration properties -->
<property>
<name>yarn.nodemanager.aux-services</name>
<value>mapreduce_shuffle</value>
</property>
<property>
<name>yarn.resourcemanager.hostname</name>
<value>hbase01</value> ---指定Yarn resource manager 地址
</property>
<property>
<name>yarn.log-aggregation-enable</name>
<value>true</value>
</property>
<property>
<name>yarn.log.server.url</name>
<value>http://hbase01:19888/jobhistory/job</value> --指定JobHistory log 地址
</property>
<property>
<name>yarn.log-aggregation.retain-seconds</name>
<value>108600</value>
</property>
</configuration>
Zookeeper configuration file
编辑zoo.cfg
dataDir=/opt/data/zookeeper ---指定Zookeeper数据存放路径
Hbase configuration file
hbase-site.xml(添加配置参数)
<configuration>
<property >
<name>hbase.tmp.dir</name>
<value>/opt/data/hbase</value> ---指定tmp文件存放路径
</property>
<property >
<name>hbase.rootdir</name>
<value>hdfs://hbase01:8020/hbase</value> ---指定Hbase文件在Hadoop存放路径
</property>
<property >
<name>hbase.master.info.port</name> ---指定端口
<value>60010</value>
</property>
<property >
<name>hbase.cluster.distributed</name>
<value>true</value>
</property>
<property>
<name>hbase.zookeeper.quorum</name> ---指定zookeeper的Quorum
<value>hbase01</value>
</property>
</configuration>
hbase-env.sh(添加配置参数)
export Java_Home = /opt/apps/java/ ---指定Java_Home
Hbase启动命令
bin/hdfs namenode -format
sbin/hadoop-daemon.sh start namenode
sbin/hadoop-daemon.sh start datanode
sbin/yarn-daemon.sh start nodemanager
sbin/yarn-daemon.sh start resourcemanager
bin/zkServer.sh start
bin/start-hbase.sh
IDEA Pom.xml 文件配置
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.hbase</groupId>
<artifactId>hbase-server</artifactId>
<version>0.98.6-hadoop2</version>
<dependencies>
<dependency>
<groupId>org.apache.hbase</groupId>
<artifactId>hbase-client</artifactId>
<version>0.98.6-hadoop2</version>
</dependency>
</dependencies>
</project>
以上是关于Hbase之环境配置的主要内容,如果未能解决你的问题,请参考以下文章