---
title: 修改HBase配置文件
description: "HBase所有的配置文件都在“$HBASE_HOME/conf”目录下，修改以下配置文件前，请先切换到“$HBASE_HOME/conf”目录。"
url: https://www.hikunpeng.com/document/detail/zh/kunpengbds/ecosystemEnable/HBase/topic_0200576385.html
sourcePath: /source/zh/kunpengbds/ecosystemEnable/HBase/topic_0200576385.html
indexId: c8c3f4c0379ffd35ad4da3ebd93622a419c2e5d7d5387a50f0678972ce2648bd65
---
# 修改HBase配置文件

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

```
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/”目录，可选择软链接或拷贝。```
cp /usr/local/hadoop/etc/hadoop/hdfs-site.xml /usr/local/hbase/conf/hdfs-site.xml
```
