鲲鹏社区首页
中文
注册
我要评分
文档获取效率
文档正确性
内容完整性
文档易理解
在线提单
论坛求助

修改HBase配置文件

HBase所有的配置文件都在“HBASE_HOME/conf”目录下,修改以下配置文件前,切换到“HBASE_HOME/conf”目录。

1
cd $HBASE_HOME/conf

修改hbase-env.sh

  1. 编辑hbase-env.sh文件。
    1
    vi hbase-env.sh
    
  2. “i”进入编辑模式,修改环境变量JAVA_HOME为绝对路径,HBASE_MANAGES_ZK设为false。
    1
    2
    3
    export JAVA_HOME=/usr/local/jdk8u252-b09
    export HBASE_MANAGES_ZK=false
    export HBASE_LIBRARY_PATH=/usr/local/hadoop/lib/native
    
  3. “Esc”键,输入:wq!,按“Enter”保存并退出编辑。

修改hbase-site.xml

  1. 修改hbase-site.xml文件。
    1
    vi hbase-site.xml
    
  2. “i”进入编辑模式,添加或修改configuration标签范围内的部分参数。
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    <configuration>
        <property>
            <name>hbase.rootdir</name>
            <value>hdfs://server1:9000/HBase</value>
        </property>
        <property>
            <name>hbase.tmp.dir</name>
            <value>/usr/local/hbase/tmp</value>
        </property>
        <property>
            <name>hbase.cluster.distributed</name>
            <value>true</value>
        </property>
        <property>
            <name>hbase.unsafe.stream.capability.enforce</name>
            <value>false</value>
        </property>
        <property>
            <name>hbase.zookeeper.quorum</name>
            <value>agent1:2181,agent2:2181,agent3:2181</value>
        </property>
        <property>
            <name>hbase.unsafe.stream.capability.enforce</name>
            <value>false</value>
        </property>
    </configuration>
    
  3. “Esc”键,输入:wq!,按“Enter”保存并退出编辑。

修改regionservers

  1. 编辑regionservers文件。
    1
    vi regionservers
    
  2. “i”进入编辑模式,将regionservers文件内容替换为agent节点IP(可用主机名代替)。
    1
    2
    3
    agent1
    agent2
    agent3
    
  3. “Esc”键,输入:wq!,按“Enter”保存并退出编辑。

拷贝hdfs-site.xml

拷贝hadoop目录下的hdfs-site.xml文件到“hbase/conf/”目录,可选择软链接或拷贝。
1
cp /usr/local/hadoop/etc/hadoop/hdfs-site.xml /usr/local/hbase/conf/hdfs-site.xml