Modifying the HBase Configuration Files
All HBase configuration files are stored in the $HBASE_HOME/conf directory. Before modifying the configuration files, switch to this directory.
1 | cd $HBASE_HOME/conf |
Modifying the hbase-env.sh File
- Open the hbase-env.sh file.
1vi hbase-env.sh - Press i to enter the insert mode, change the value of the environment variable JAVA_HOME to an absolute path, and set HBASE_MANAGES_ZK to 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
- Press Esc, type :wq!, and press Enter to save the file and exit.
Modifying the hbase-site.xml File
- Open the hbase-site.xml file.
1vi hbase-site.xml - Press i to enter the insert mode and add or modify parameters in the configuration tag range.
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>
- Press Esc, type :wq!, and press Enter to save the file and exit.
Modifying the regionservers File
- Open the regionservers file.
1vi regionservers - Press i to enter the insert mode and replace the content of the regionservers file with the IP address of the agent node (which can be replaced by the host name).
1 2 3
agent1 agent2 agent3
- Press Esc, type :wq!, and press Enter to save the file and exit.
Copying hdfs-site.xml
Copy the hdfs-site.xml file of Hadoop to the hbase/conf/ directory. You can use a soft link or copy the file.
1 | cp /usr/local/hadoop/etc/hadoop/hdfs-site.xml /usr/local/hbase/conf/hdfs-site.xml |
Parent topic: Deploying HBase