Logging in HBase
Both Master and Region Servers in HBase write text logs, which are useful while analyzing the causes of different errors. These logs are located in the /var/log/hbase directory on each of the hosts. There are two ways to find them.
Using a file system
The server file system enables you to get direct access to logs using the following operations:
-
Connect to the host through SSH and run the following command:
$ ls -la /var/log/hbase
The output looks similar to this:
total 10004 drwxr-xr-x. 2 hbase hbase 4096 Nov 29 06:17 . drwxr-xr-x. 16 root root 4096 Nov 29 05:35 .. -rw-r--r--. 1 hbase hbase 10209158 Nov 29 11:34 hbase-hbase-regionserver-bds-adh-1.ru-central1.internal.log -rw-r--r--. 1 hbase hbase 692 Nov 29 06:17 hbase-hbase-regionserver-bds-adh-1.ru-central1.internal.out -rw-r--r--. 1 hbase hbase 692 Nov 29 05:35 hbase-hbase-regionserver-bds-adh-1.ru-central1.internal.out.1 -rw-r--r--. 1 hbase hbase 692 Nov 26 07:43 hbase-hbase-regionserver-bds-adh-1.ru-central1.internal.out.2 -rw-r--r--. 1 hbase hbase 692 Nov 26 05:58 hbase-hbase-regionserver-bds-adh-1.ru-central1.internal.out.3 -rw-r--r--. 1 hbase hbase 692 Nov 26 05:26 hbase-hbase-regionserver-bds-adh-1.ru-central1.internal.out.4 -rw-r--r--. 1 hbase hbase 692 Nov 25 15:00 hbase-hbase-regionserver-bds-adh-1.ru-central1.internal.out.5
NOTELogs are located in the local file system of the host, not in the HDFS.
-
View the content of the desired file:
$ tail /var/log/hbase/hbase-hbase-regionserver-bds-adh-1.ru-central1.internal.log
The output looks similar to this:
SLF4J: Found binding in [jar:file:/usr/lib/phoenix/phoenix-5.0.0-HBase-2.0-pig.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/usr/lib/phoenix/phoenix-5.0.0-HBase-2.0-thin-client.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory] 0 [RS-EventLoopGroup-1-9] INFO SecurityLogger.org.apache.hadoop.hbase.Server - Connection from 10.92.6.9:48266, version=2.0.2, sasl=false, ugi=hbase (auth:SIMPLE), service=ClientService 10629 [RS-EventLoopGroup-1-10] INFO SecurityLogger.org.apache.hadoop.hbase.Server - Connection from 10.92.6.9:48328, version=2.0.2, sasl=false, ugi=hbase (auth:SIMPLE), service=AdminService 10263041 [RS-EventLoopGroup-1-5] INFO SecurityLogger.org.apache.hadoop.hbase.Server - Connection from 10.92.6.9:35086, version=2.0.2, sasl=false, ugi=hbase (auth:SIMPLE), service=ClientService 10570940 [RS-EventLoopGroup-1-9] INFO SecurityLogger.org.apache.hadoop.hbase.Server - Connection from 10.92.6.9:36368, version=2.0.2, sasl=false, ugi=hbase (auth:SIMPLE), service=ClientService 18488201 [RS-EventLoopGroup-1-16] INFO SecurityLogger.org.apache.hadoop.hbase.Server - Connection from 10.92.6.9:41578, version=2.0.2, sasl=false, ugi=hbase (auth:SIMPLE), service=AdminService 18991216 [RS-EventLoopGroup-1-12] INFO SecurityLogger.org.apache.hadoop.hbase.Server - Connection from 10.92.6.9:43712, version=2.0.2, sasl=false, ugi=hbase (auth:SIMPLE), service=AdminService
Using Web UI
The following steps demonstrate how to view logs in HBase Web UI:
-
Open Web UI home page for the desired Master or Region Server.
-
Select the Local Logs menu item.
Switching to the list of logsSwitching to the list of logs -
Click the desired file name in the opened list.
Choosing the log fileChoosing the log file -
View the opened file. The latest information is located in the end.
Viewing the log fileViewing the log file