128. General Guidelines

Always start with the master log (TODO: Which lines?). Normally it’s just printing the same lines over and over again. If not, then there’s an issue. Google or search-hadoop.com should return some hits for those exceptions you’re seeing.

An error rarely comes alone in Apache HBase, usually when something gets screwed up what will follow may be hundreds of exceptions and stack traces coming from all over the place. The best way to approach this type of problem is to walk the log up to where it all began, for example one trick with RegionServers is that they will print some metrics when aborting so grepping for Dump should get you around the start of the problem.

RegionServer suicides are ‘normal’, as this is what they do when something goes wrong. For example, if ulimit and max transfer threads (the two most important initial settings, see [ulimit] and dfs.datanode.max.transfer.threads ) aren’t changed, it will make it impossible at some point for DataNodes to create new threads that from the HBase point of view is seen as if HDFS was gone. Think about what would happen if your MySQL database was suddenly unable to access files on your local file system, well it’s the same with HBase and HDFS. Another very common reason to see RegionServers committing seppuku is when they enter prolonged garbage collection pauses that last longer than the default ZooKeeper session timeout. For more information on GC pauses, see the 3 part blog post by Todd Lipcon and Long GC pauses above.

129. Logs

The key process logs are as follows… (replace with the user that started the service, and for the machine name)

NameNode: $HADOOP_HOME/logs/hadoop—namenode-.log

DataNode: $HADOOP_HOME/logs/hadoop—datanode-.log

JobTracker: $HADOOP_HOME/logs/hadoop—jobtracker-.log

TaskTracker: $HADOOP_HOME/logs/hadoop—tasktracker-.log

HMaster: $HBASE_HOME/logs/hbase—master-.log

RegionServer: $HBASE_HOME/logs/hbase—regionserver-.log

ZooKeeper: TODO

129.1. Log Locations

For stand-alone deployments the logs are obviously going to be on a single machine, however this is a development configuration only. Production deployments need to run on a cluster.

129.1.1. NameNode

The NameNode log is on the NameNode server. The HBase Master is typically run on the NameNode server, and well as ZooKeeper.

For smaller clusters the JobTracker/ResourceManager is typically run on the NameNode server as well.

129.1.2. DataNode

Each DataNode server will have a DataNode log for HDFS, as well as a RegionServer log for HBase.

Additionally, each DataNode server will also have a TaskTracker/NodeManager log for MapReduce task execution.

129.2. Log Levels

129.2.1. Enabling RPC-level logging

Enabling the RPC-level logging on a RegionServer can often give insight on timings at the server. Once enabled, the amount of log spewed is voluminous. It is not recommended that you leave this logging on for more than short bursts of time. To enable RPC-level logging, browse to the RegionServer UI and click on Log Level. Set the log level to DEBUG for the package org.apache.hadoop.ipc (That’s right, for hadoop.ipc, NOT, hbase.ipc). Then tail the RegionServers log. Analyze.

To disable, set the logging level back to INFO level.

129.3. JVM Garbage Collection Logs

| |

All example Garbage Collection logs in this section are based on Java 8 output. The introduction of Unified Logging in Java 9 and newer will result in very different looking logs.

|

HBase is memory intensive, and using the default GC you can see long pauses in all threads including the Juliet Pause aka “GC of Death”. To help debug this or confirm this is happening GC logging can be turned on in the Java virtual machine.

To enable, in hbase-env.sh, uncomment one of the below lines :

  1. # This enables basic gc logging to the .out file.
  2. # export SERVER_GC_OPTS="-verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps"
  3. # This enables basic gc logging to its own file.
  4. # export SERVER_GC_OPTS="-verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:<FILE-PATH>"
  5. # This enables basic GC logging to its own file with automatic log rolling. Only applies to jdk 1.6.0_34+ and 1.7.0_2+.
  6. # export SERVER_GC_OPTS="-verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:<FILE-PATH> -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=1 -XX:GCLogFileSize=512M"
  7. # If <FILE-PATH> is not replaced, the log file(.gc) would be generated in the HBASE_LOG_DIR.

At this point you should see logs like so:

  1. 64898.952: [GC [1 CMS-initial-mark: 2811538K(3055704K)] 2812179K(3061272K), 0.0007360 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
  2. 64898.953: [CMS-concurrent-mark-start]
  3. 64898.971: [GC 64898.971: [ParNew: 5567K->576K(5568K), 0.0101110 secs] 2817105K->2812715K(3061272K), 0.0102200 secs] [Times: user=0.07 sys=0.00, real=0.01 secs]

In this section, the first line indicates a 0.0007360 second pause for the CMS to initially mark. This pauses the entire VM, all threads for that period of time.

The third line indicates a “minor GC”, which pauses the VM for 0.0101110 seconds - aka 10 milliseconds. It has reduced the “ParNew” from about 5.5m to 576k. Later on in this cycle we see:

  1. 64901.445: [CMS-concurrent-mark: 1.542/2.492 secs] [Times: user=10.49 sys=0.33, real=2.49 secs]
  2. 64901.445: [CMS-concurrent-preclean-start]
  3. 64901.453: [GC 64901.453: [ParNew: 5505K->573K(5568K), 0.0062440 secs] 2868746K->2864292K(3061272K), 0.0063360 secs] [Times: user=0.05 sys=0.00, real=0.01 secs]
  4. 64901.476: [GC 64901.476: [ParNew: 5563K->575K(5568K), 0.0072510 secs] 2869283K->2864837K(3061272K), 0.0073320 secs] [Times: user=0.05 sys=0.01, real=0.01 secs]
  5. 64901.500: [GC 64901.500: [ParNew: 5517K->573K(5568K), 0.0120390 secs] 2869780K->2865267K(3061272K), 0.0121150 secs] [Times: user=0.09 sys=0.00, real=0.01 secs]
  6. 64901.529: [GC 64901.529: [ParNew: 5507K->569K(5568K), 0.0086240 secs] 2870200K->2865742K(3061272K), 0.0087180 secs] [Times: user=0.05 sys=0.00, real=0.01 secs]
  7. 64901.554: [GC 64901.555: [ParNew: 5516K->575K(5568K), 0.0107130 secs] 2870689K->2866291K(3061272K), 0.0107820 secs] [Times: user=0.06 sys=0.00, real=0.01 secs]
  8. 64901.578: [CMS-concurrent-preclean: 0.070/0.133 secs] [Times: user=0.48 sys=0.01, real=0.14 secs]
  9. 64901.578: [CMS-concurrent-abortable-preclean-start]
  10. 64901.584: [GC 64901.584: [ParNew: 5504K->571K(5568K), 0.0087270 secs] 2871220K->2866830K(3061272K), 0.0088220 secs] [Times: user=0.05 sys=0.00, real=0.01 secs]
  11. 64901.609: [GC 64901.609: [ParNew: 5512K->569K(5568K), 0.0063370 secs] 2871771K->2867322K(3061272K), 0.0064230 secs] [Times: user=0.06 sys=0.00, real=0.01 secs]
  12. 64901.615: [CMS-concurrent-abortable-preclean: 0.007/0.037 secs] [Times: user=0.13 sys=0.00, real=0.03 secs]
  13. 64901.616: [GC[YG occupancy: 645 K (5568 K)]64901.616: [Rescan (parallel) , 0.0020210 secs]64901.618: [weak refs processing, 0.0027950 secs] [1 CMS-remark: 2866753K(3055704K)] 2867399K(3061272K), 0.0049380 secs] [Times: user=0.00 sys=0.01, real=0.01 secs]
  14. 64901.621: [CMS-concurrent-sweep-start]

The first line indicates that the CMS concurrent mark (finding garbage) has taken 2.4 seconds. But this is a concurrent 2.4 seconds, Java has not been paused at any point in time.

There are a few more minor GCs, then there is a pause at the 2nd last line:

  1. 64901.616: [GC[YG occupancy: 645 K (5568 K)]64901.616: [Rescan (parallel) , 0.0020210 secs]64901.618: [weak refs processing, 0.0027950 secs] [1 CMS-remark: 2866753K(3055704K)] 2867399K(3061272K), 0.0049380 secs] [Times: user=0.00 sys=0.01, real=0.01 secs]

The pause here is 0.0049380 seconds (aka 4.9 milliseconds) to ‘remark’ the heap.

At this point the sweep starts, and you can watch the heap size go down:

  1. 64901.637: [GC 64901.637: [ParNew: 5501K->569K(5568K), 0.0097350 secs] 2871958K->2867441K(3061272K), 0.0098370 secs] [Times: user=0.05 sys=0.00, real=0.01 secs]
  2. ... lines removed ...
  3. 64904.936: [GC 64904.936: [ParNew: 5532K->568K(5568K), 0.0070720 secs] 1365024K->1360689K(3061272K), 0.0071930 secs] [Times: user=0.05 sys=0.00, real=0.01 secs]
  4. 64904.953: [CMS-concurrent-sweep: 2.030/3.332 secs] [Times: user=9.57 sys=0.26, real=3.33 secs]

At this point, the CMS sweep took 3.332 seconds, and heap went from about ~ 2.8 GB to 1.3 GB (approximate).

The key points here is to keep all these pauses low. CMS pauses are always low, but if your ParNew starts growing, you can see minor GC pauses approach 100ms, exceed 100ms and hit as high at 400ms.

This can be due to the size of the ParNew, which should be relatively small. If your ParNew is very large after running HBase for a while, in one example a ParNew was about 150MB, then you might have to constrain the size of ParNew (The larger it is, the longer the collections take but if it’s too small, objects are promoted to old gen too quickly). In the below we constrain new gen size to 64m.

Add the below line in hbase-env.sh:

  1. export SERVER_GC_OPTS="$SERVER_GC_OPTS -XX:NewSize=64m -XX:MaxNewSize=64m"

Similarly, to enable GC logging for client processes, uncomment one of the below lines in hbase-env.sh:

  1. # This enables basic gc logging to the .out file.
  2. # export CLIENT_GC_OPTS="-verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps"
  3. # This enables basic gc logging to its own file.
  4. # export CLIENT_GC_OPTS="-verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:<FILE-PATH>"
  5. # This enables basic GC logging to its own file with automatic log rolling. Only applies to jdk 1.6.0_34+ and 1.7.0_2+.
  6. # export CLIENT_GC_OPTS="-verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:<FILE-PATH> -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=1 -XX:GCLogFileSize=512M"
  7. # If <FILE-PATH> is not replaced, the log file(.gc) would be generated in the HBASE_LOG_DIR .

For more information on GC pauses, see the 3 part blog post by Todd Lipcon and Long GC pauses above.

130. Resources

130.1. search-hadoop.com

search-hadoop.com indexes all the mailing lists and is great for historical searches. Search here first when you have an issue as its more than likely someone has already had your problem.

130.2. Mailing Lists

Ask a question on the Apache HBase mailing lists. The ‘dev’ mailing list is aimed at the community of developers actually building Apache HBase and for features currently under development, and ‘user’ is generally used for questions on released versions of Apache HBase. Before going to the mailing list, make sure your question has not already been answered by searching the mailing list archives first. Use search-hadoop.com. Take some time crafting your question. See Getting Answers for ideas on crafting good questions. A quality question that includes all context and exhibits evidence the author has tried to find answers in the manual and out on lists is more likely to get a prompt response.

130.3. Slack

See http://apache-hbase.slack.com Channel on Slack

130.4. IRC

(You will probably get a more prompt response on the Slack channel)

hbase on irc.freenode.net

130.5. JIRA

JIRA is also really helpful when looking for Hadoop/HBase-specific issues.

131. Tools

131.1. Builtin Tools

131.1.1. Master Web Interface

The Master starts a web-interface on port 16010 by default.

The Master web UI lists created tables and their definition (e.g., ColumnFamilies, blocksize, etc.). Additionally, the available RegionServers in the cluster are listed along with selected high-level metrics (requests, number of regions, usedHeap, maxHeap). The Master web UI allows navigation to each RegionServer’s web UI.

131.1.2. RegionServer Web Interface

RegionServers starts a web-interface on port 16030 by default.

The RegionServer web UI lists online regions and their start/end keys, as well as point-in-time RegionServer metrics (requests, regions, storeFileIndexSize, compactionQueueSize, etc.).

See HBase Metrics for more information in metric definitions.

131.1.3. zkcli

zkcli is a very useful tool for investigating ZooKeeper-related issues. To invoke:

  1. ./hbase zkcli -server host:port <cmd> <args>

The commands (and arguments) are:

  1. connect host:port
  2. get path [watch]
  3. ls path [watch]
  4. set path data [version]
  5. delquota [-n|-b] path
  6. quit
  7. printwatches on|off
  8. create [-s] [-e] path data acl
  9. stat path [watch]
  10. close
  11. ls2 path [watch]
  12. history
  13. listquota path
  14. setAcl path acl
  15. getAcl path
  16. sync path
  17. redo cmdno
  18. addauth scheme auth
  19. delete path [version]
  20. setquota -n|-b val path

131.1.4. Maintenance Mode

If the cluster has gotten stuck in some state and the standard techniques aren’t making progress, it is possible to restart the cluster in “maintenance mode.” This mode features drastically reduced capabilities and surface area, making it easier to enact very low-level changes such as repairing/recovering the hbase:meta table.

To enter maintenance mode, set hbase.master.maintenance_mode to true either in your hbase-site.xml or via system propery when starting the master process (-D…=true). Entering and exiting this mode requires a service restart, however the typical use will be when HBase Master is already facing startup difficulties.

When maintenance mode is enabled, the master will host all system tables - ensure that it has enough memory to do so. RegionServers will not be assigned any regions from user-space tables; in fact, they will go completely unused while in maintenance mode. Additionally, the master will not load any coprocessors, will not run any normalization or merge/split operations, and will not enforce quotas.

131.2. External Tools

131.2.1. tail

tail is the command line tool that lets you look at the end of a file. Add the -f option and it will refresh when new data is available. It’s useful when you are wondering what’s happening, for example, when a cluster is taking a long time to shutdown or startup as you can just fire a new terminal and tail the master log (and maybe a few RegionServers).

131.2.2. top

top is probably one of the most important tools when first trying to see what’s running on a machine and how the resources are consumed. Here’s an example from production system:

  1. top - 14:46:59 up 39 days, 11:55, 1 user, load average: 3.75, 3.57, 3.84
  2. Tasks: 309 total, 1 running, 308 sleeping, 0 stopped, 0 zombie
  3. Cpu(s): 4.5%us, 1.6%sy, 0.0%ni, 91.7%id, 1.4%wa, 0.1%hi, 0.6%si, 0.0%st
  4. Mem: 24414432k total, 24296956k used, 117476k free, 7196k buffers
  5. Swap: 16008732k total, 14348k used, 15994384k free, 11106908k cached
  6. PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
  7. 15558 hadoop 18 -2 3292m 2.4g 3556 S 79 10.4 6523:52 java
  8. 13268 hadoop 18 -2 8967m 8.2g 4104 S 21 35.1 5170:30 java
  9. 8895 hadoop 18 -2 1581m 497m 3420 S 11 2.1 4002:32 java

Here we can see that the system load average during the last five minutes is 3.75, which very roughly means that on average 3.75 threads were waiting for CPU time during these 5 minutes. In general, the perfect utilization equals to the number of cores, under that number the machine is under utilized and over that the machine is over utilized. This is an important concept, see this article to understand it more: http://www.linuxjournal.com/article/9001.

Apart from load, we can see that the system is using almost all its available RAM but most of it is used for the OS cache (which is good). The swap only has a few KBs in it and this is wanted, high numbers would indicate swapping activity which is the nemesis of performance of Java systems. Another way to detect swapping is when the load average goes through the roof (although this could also be caused by things like a dying disk, among others).

The list of processes isn’t super useful by default, all we know is that 3 java processes are using about 111% of the CPUs. To know which is which, simply type c and each line will be expanded. Typing 1 will give you the detail of how each CPU is used instead of the average for all of them like shown here.

131.2.3. jps

jps is shipped with every JDK and gives the java process ids for the current user (if root, then it gives the ids for all users). Example:

  1. hadoop@sv4borg12:~$ jps
  2. 1322 TaskTracker
  3. 17789 HRegionServer
  4. 27862 Child
  5. 1158 DataNode
  6. 25115 HQuorumPeer
  7. 2950 Jps
  8. 19750 ThriftServer
  9. 18776 jmx

In order, we see a:

  • Hadoop TaskTracker, manages the local Childs

  • HBase RegionServer, serves regions

  • Child, its MapReduce task, cannot tell which type exactly

  • Hadoop TaskTracker, manages the local Childs

  • Hadoop DataNode, serves blocks

  • HQuorumPeer, a ZooKeeper ensemble member

  • Jps, well… it’s the current process

  • ThriftServer, it’s a special one will be running only if thrift was started

  • jmx, this is a local process that’s part of our monitoring platform ( poorly named maybe). You probably don’t have that.

You can then do stuff like checking out the full command line that started the process:

  1. hadoop@sv4borg12:~$ ps aux | grep HRegionServer
  2. hadoop 17789 155 35.2 9067824 8604364 ? S<l Mar04 9855:48 /usr/java/jdk1.6.0_14/bin/java -Xmx8000m -XX:+DoEscapeAnalysis -XX:+AggressiveOpts -XX:+UseConcMarkSweepGC -XX:NewSize=64m -XX:MaxNewSize=64m -XX:CMSInitiatingOccupancyFraction=88 -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -Xloggc:/export1/hadoop/logs/gc-hbase.log -Dcom.sun.management.jmxremote.port=10102 -Dcom.sun.management.jmxremote.authenticate=true -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.password.file=/home/hadoop/hbase/conf/jmxremote.password -Dcom.sun.management.jmxremote -Dhbase.log.dir=/export1/hadoop/logs -Dhbase.log.file=hbase-hadoop-regionserver-sv4borg12.log -Dhbase.home.dir=/home/hadoop/hbase -Dhbase.id.str=hadoop -Dhbase.root.logger=INFO,DRFA -Djava.library.path=/home/hadoop/hbase/lib/native/Linux-amd64-64 -classpath /home/hadoop/hbase/bin/../conf:[many jars]:/home/hadoop/hadoop/conf org.apache.hadoop.hbase.regionserver.HRegionServer start

131.2.4. jstack

jstack is one of the most important tools when trying to figure out what a java process is doing apart from looking at the logs. It has to be used in conjunction with jps in order to give it a process id. It shows a list of threads, each one has a name, and they appear in the order that they were created (so the top ones are the most recent threads). Here are a few example:

The main thread of a RegionServer waiting for something to do from the master:

  1. "regionserver60020" prio=10 tid=0x0000000040ab4000 nid=0x45cf waiting on condition [0x00007f16b6a96000..0x00007f16b6a96a70]
  2. java.lang.Thread.State: TIMED_WAITING (parking)
  3. at sun.misc.Unsafe.park(Native Method)
  4. - parking to wait for <0x00007f16cd5c2f30> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
  5. at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:198)
  6. at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:1963)
  7. at java.util.concurrent.LinkedBlockingQueue.poll(LinkedBlockingQueue.java:395)
  8. at org.apache.hadoop.hbase.regionserver.HRegionServer.run(HRegionServer.java:647)
  9. at java.lang.Thread.run(Thread.java:619)

The MemStore flusher thread that is currently flushing to a file:

  1. "regionserver60020.cacheFlusher" daemon prio=10 tid=0x0000000040f4e000 nid=0x45eb in Object.wait() [0x00007f16b5b86000..0x00007f16b5b87af0]
  2. java.lang.Thread.State: WAITING (on object monitor)
  3. at java.lang.Object.wait(Native Method)
  4. at java.lang.Object.wait(Object.java:485)
  5. at org.apache.hadoop.ipc.Client.call(Client.java:803)
  6. - locked <0x00007f16cb14b3a8> (a org.apache.hadoop.ipc.Client$Call)
  7. at org.apache.hadoop.ipc.RPC$Invoker.invoke(RPC.java:221)
  8. at $Proxy1.complete(Unknown Source)
  9. at sun.reflect.GeneratedMethodAccessor38.invoke(Unknown Source)
  10. at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  11. at java.lang.reflect.Method.invoke(Method.java:597)
  12. at org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:82)
  13. at org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:59)
  14. at $Proxy1.complete(Unknown Source)
  15. at org.apache.hadoop.hdfs.DFSClient$DFSOutputStream.closeInternal(DFSClient.java:3390)
  16. - locked <0x00007f16cb14b470> (a org.apache.hadoop.hdfs.DFSClient$DFSOutputStream)
  17. at org.apache.hadoop.hdfs.DFSClient$DFSOutputStream.close(DFSClient.java:3304)
  18. at org.apache.hadoop.fs.FSDataOutputStream$PositionCache.close(FSDataOutputStream.java:61)
  19. at org.apache.hadoop.fs.FSDataOutputStream.close(FSDataOutputStream.java:86)
  20. at org.apache.hadoop.hbase.io.hfile.HFile$Writer.close(HFile.java:650)
  21. at org.apache.hadoop.hbase.regionserver.StoreFile$Writer.close(StoreFile.java:853)
  22. at org.apache.hadoop.hbase.regionserver.Store.internalFlushCache(Store.java:467)
  23. - locked <0x00007f16d00e6f08> (a java.lang.Object)
  24. at org.apache.hadoop.hbase.regionserver.Store.flushCache(Store.java:427)
  25. at org.apache.hadoop.hbase.regionserver.Store.access$100(Store.java:80)
  26. at org.apache.hadoop.hbase.regionserver.Store$StoreFlusherImpl.flushCache(Store.java:1359)
  27. at org.apache.hadoop.hbase.regionserver.HRegion.internalFlushcache(HRegion.java:907)
  28. at org.apache.hadoop.hbase.regionserver.HRegion.internalFlushcache(HRegion.java:834)
  29. at org.apache.hadoop.hbase.regionserver.HRegion.flushcache(HRegion.java:786)
  30. at org.apache.hadoop.hbase.regionserver.MemStoreFlusher.flushRegion(MemStoreFlusher.java:250)
  31. at org.apache.hadoop.hbase.regionserver.MemStoreFlusher.flushRegion(MemStoreFlusher.java:224)
  32. at org.apache.hadoop.hbase.regionserver.MemStoreFlusher.run(MemStoreFlusher.java:146)

A handler thread that’s waiting for stuff to do (like put, delete, scan, etc.):

  1. "IPC Server handler 16 on 60020" daemon prio=10 tid=0x00007f16b011d800 nid=0x4a5e waiting on condition [0x00007f16afefd000..0x00007f16afefd9f0]
  2. java.lang.Thread.State: WAITING (parking)
  3. at sun.misc.Unsafe.park(Native Method)
  4. - parking to wait for <0x00007f16cd3f8dd8> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
  5. at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
  6. at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1925)
  7. at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:358)
  8. at org.apache.hadoop.hbase.ipc.HBaseServer$Handler.run(HBaseServer.java:1013)

And one that’s busy doing an increment of a counter (it’s in the phase where it’s trying to create a scanner in order to read the last value):

  1. "IPC Server handler 66 on 60020" daemon prio=10 tid=0x00007f16b006e800 nid=0x4a90 runnable [0x00007f16acb77000..0x00007f16acb77cf0]
  2. java.lang.Thread.State: RUNNABLE
  3. at org.apache.hadoop.hbase.regionserver.KeyValueHeap.<init>(KeyValueHeap.java:56)
  4. at org.apache.hadoop.hbase.regionserver.StoreScanner.<init>(StoreScanner.java:79)
  5. at org.apache.hadoop.hbase.regionserver.Store.getScanner(Store.java:1202)
  6. at org.apache.hadoop.hbase.regionserver.HRegion$RegionScanner.<init>(HRegion.java:2209)
  7. at org.apache.hadoop.hbase.regionserver.HRegion.instantiateInternalScanner(HRegion.java:1063)
  8. at org.apache.hadoop.hbase.regionserver.HRegion.getScanner(HRegion.java:1055)
  9. at org.apache.hadoop.hbase.regionserver.HRegion.getScanner(HRegion.java:1039)
  10. at org.apache.hadoop.hbase.regionserver.HRegion.getLastIncrement(HRegion.java:2875)
  11. at org.apache.hadoop.hbase.regionserver.HRegion.incrementColumnValue(HRegion.java:2978)
  12. at org.apache.hadoop.hbase.regionserver.HRegionServer.incrementColumnValue(HRegionServer.java:2433)
  13. at sun.reflect.GeneratedMethodAccessor20.invoke(Unknown Source)
  14. at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  15. at java.lang.reflect.Method.invoke(Method.java:597)
  16. at org.apache.hadoop.hbase.ipc.HBaseRPC$Server.call(HBaseRPC.java:560)
  17. at org.apache.hadoop.hbase.ipc.HBaseServer$Handler.run(HBaseServer.java:1027)

A thread that receives data from HDFS:

  1. "IPC Client (47) connection to sv4borg9/10.4.24.40:9000 from hadoop" daemon prio=10 tid=0x00007f16a02d0000 nid=0x4fa3 runnable [0x00007f16b517d000..0x00007f16b517dbf0]
  2. java.lang.Thread.State: RUNNABLE
  3. at sun.nio.ch.EPollArrayWrapper.epollWait(Native Method)
  4. at sun.nio.ch.EPollArrayWrapper.poll(EPollArrayWrapper.java:215)
  5. at sun.nio.ch.EPollSelectorImpl.doSelect(EPollSelectorImpl.java:65)
  6. at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:69)
  7. - locked <0x00007f17d5b68c00> (a sun.nio.ch.Util$1)
  8. - locked <0x00007f17d5b68be8> (a java.util.Collections$UnmodifiableSet)
  9. - locked <0x00007f1877959b50> (a sun.nio.ch.EPollSelectorImpl)
  10. at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:80)
  11. at org.apache.hadoop.net.SocketIOWithTimeout$SelectorPool.select(SocketIOWithTimeout.java:332)
  12. at org.apache.hadoop.net.SocketIOWithTimeout.doIO(SocketIOWithTimeout.java:157)
  13. at org.apache.hadoop.net.SocketInputStream.read(SocketInputStream.java:155)
  14. at org.apache.hadoop.net.SocketInputStream.read(SocketInputStream.java:128)
  15. at java.io.FilterInputStream.read(FilterInputStream.java:116)
  16. at org.apache.hadoop.ipc.Client$Connection$PingInputStream.read(Client.java:304)
  17. at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
  18. at java.io.BufferedInputStream.read(BufferedInputStream.java:237)
  19. - locked <0x00007f1808539178> (a java.io.BufferedInputStream)
  20. at java.io.DataInputStream.readInt(DataInputStream.java:370)
  21. at org.apache.hadoop.ipc.Client$Connection.receiveResponse(Client.java:569)
  22. at org.apache.hadoop.ipc.Client$Connection.run(Client.java:477)

And here is a master trying to recover a lease after a RegionServer died:

  1. "LeaseChecker" daemon prio=10 tid=0x00000000407ef800 nid=0x76cd waiting on condition [0x00007f6d0eae2000..0x00007f6d0eae2a70]
  2. --
  3. java.lang.Thread.State: WAITING (on object monitor)
  4. at java.lang.Object.wait(Native Method)
  5. at java.lang.Object.wait(Object.java:485)
  6. at org.apache.hadoop.ipc.Client.call(Client.java:726)
  7. - locked <0x00007f6d1cd28f80> (a org.apache.hadoop.ipc.Client$Call)
  8. at org.apache.hadoop.ipc.RPC$Invoker.invoke(RPC.java:220)
  9. at $Proxy1.recoverBlock(Unknown Source)
  10. at org.apache.hadoop.hdfs.DFSClient$DFSOutputStream.processDatanodeError(DFSClient.java:2636)
  11. at org.apache.hadoop.hdfs.DFSClient$DFSOutputStream.<init>(DFSClient.java:2832)
  12. at org.apache.hadoop.hdfs.DFSClient.append(DFSClient.java:529)
  13. at org.apache.hadoop.hdfs.DistributedFileSystem.append(DistributedFileSystem.java:186)
  14. at org.apache.hadoop.fs.FileSystem.append(FileSystem.java:530)
  15. at org.apache.hadoop.hbase.util.FSUtils.recoverFileLease(FSUtils.java:619)
  16. at org.apache.hadoop.hbase.regionserver.wal.HLog.splitLog(HLog.java:1322)
  17. at org.apache.hadoop.hbase.regionserver.wal.HLog.splitLog(HLog.java:1210)
  18. at org.apache.hadoop.hbase.master.HMaster.splitLogAfterStartup(HMaster.java:648)
  19. at org.apache.hadoop.hbase.master.HMaster.joinCluster(HMaster.java:572)
  20. at org.apache.hadoop.hbase.master.HMaster.run(HMaster.java:503)

131.2.5. OpenTSDB

OpenTSDB is an excellent alternative to Ganglia as it uses Apache HBase to store all the time series and doesn’t have to downsample. Monitoring your own HBase cluster that hosts OpenTSDB is a good exercise.

Here’s an example of a cluster that’s suffering from hundreds of compactions launched almost all around the same time, which severely affects the IO performance: (TODO: insert graph plotting compactionQueueSize)

It’s a good practice to build dashboards with all the important graphs per machine and per cluster so that debugging issues can be done with a single quick look. For example, at StumbleUpon there’s one dashboard per cluster with the most important metrics from both the OS and Apache HBase. You can then go down at the machine level and get even more detailed metrics.

131.2.6. clusterssh+top

clusterssh+top, it’s like a poor man’s monitoring system and it can be quite useful when you have only a few machines as it’s very easy to setup. Starting clusterssh will give you one terminal per machine and another terminal in which whatever you type will be retyped in every window. This means that you can type top once and it will start it for all of your machines at the same time giving you full view of the current state of your cluster. You can also tail all the logs at the same time, edit files, etc.

132. Client

For more information on the HBase client, see client.

132.1. ScannerTimeoutException or UnknownScannerException

This is thrown if the time between RPC calls from the client to RegionServer exceeds the scan timeout. For example, if Scan.setCaching is set to 500, then there will be an RPC call to fetch the next batch of rows every 500 .next() calls on the ResultScanner because data is being transferred in blocks of 500 rows to the client. Reducing the setCaching value may be an option, but setting this value too low makes for inefficient processing on numbers of rows.

See Scan Caching.

132.2. Performance Differences in Thrift and Java APIs

Poor performance, or even ScannerTimeoutExceptions, can occur if Scan.setCaching is too high, as discussed in ScannerTimeoutException or UnknownScannerException. If the Thrift client uses the wrong caching settings for a given workload, performance can suffer compared to the Java API. To set caching for a given scan in the Thrift client, use the scannerGetList(scannerId, numRows) method, where numRows is an integer representing the number of rows to cache. In one case, it was found that reducing the cache for Thrift scans from 1000 to 100 increased performance to near parity with the Java API given the same queries.

See also Jesse Andersen’s blog post about using Scans with Thrift.

132.3. LeaseException when calling Scanner.next

In some situations clients that fetch data from a RegionServer get a LeaseException instead of the usual ScannerTimeoutException or UnknownScannerException. Usually the source of the exception is org.apache.hadoop.hbase.regionserver.Leases.removeLease(Leases.java:230) (line number may vary). It tends to happen in the context of a slow/freezing RegionServer#next call. It can be prevented by having hbase.rpc.timeout > hbase.client.scanner.timeout.period. Harsh J investigated the issue as part of the mailing list thread HBase, mail # user - Lease does not exist exceptions

132.4. Shell or client application throws lots of scary exceptions during normal operation

Since 0.20.0 the default log level for org.apache.hadoop.hbase.*is DEBUG.

On your clients, edit $HBASE_HOME/conf/log4j.properties and change this: log4j.logger.org.apache.hadoop.hbase=DEBUG to this: log4j.logger.org.apache.hadoop.hbase=INFO, or even log4j.logger.org.apache.hadoop.hbase=WARN.

132.5. Long Client Pauses With Compression

This is a fairly frequent question on the Apache HBase dist-list. The scenario is that a client is typically inserting a lot of data into a relatively un-optimized HBase cluster. Compression can exacerbate the pauses, although it is not the source of the problem.

See Table Creation: Pre-Creating Regions on the pattern for pre-creating regions and confirm that the table isn’t starting with a single region.

See HBase Configurations for cluster configuration, particularly hbase.hstore.blockingStoreFiles, hbase.hregion.memstore.block.multiplier, MAX_FILESIZE (region size), and MEMSTORE_FLUSHSIZE.

A slightly longer explanation of why pauses can happen is as follows: Puts are sometimes blocked on the MemStores which are blocked by the flusher thread which is blocked because there are too many files to compact because the compactor is given too many small files to compact and has to compact the same data repeatedly. This situation can occur even with minor compactions. Compounding this situation, Apache HBase doesn’t compress data in memory. Thus, the 64MB that lives in the MemStore could become a 6MB file after compression - which results in a smaller StoreFile. The upside is that more data is packed into the same region, but performance is achieved by being able to write larger files - which is why HBase waits until the flushsize before writing a new StoreFile. And smaller StoreFiles become targets for compaction. Without compression the files are much bigger and don’t need as much compaction, however this is at the expense of I/O.

For additional information, see this thread on Long client pauses with compression.

132.6. Secure Client Connect ([Caused by GSSException: No valid credentials provided…])

You may encounter the following error:

  1. Secure Client Connect ([Caused by GSSException: No valid credentials provided
  2. (Mechanism level: Request is a replay (34) V PROCESS_TGS)])

This issue is caused by bugs in the MIT Kerberos replay_cache component, #1201 and #5924. These bugs caused the old version of krb5-server to erroneously block subsequent requests sent from a Principal. This caused krb5-server to block the connections sent from one Client (one HTable instance with multi-threading connection instances for each RegionServer); Messages, such as Request is a replay (34), are logged in the client log You can ignore the messages, because HTable will retry 5 * 10 (50) times for each failed connection by default. HTable will throw IOException if any connection to the RegionServer fails after the retries, so that the user client code for HTable instance can handle it further. NOTE: HTable is deprecated in HBase 1.0, in favor of Table.

Alternatively, update krb5-server to a version which solves these issues, such as krb5-server-1.10.3. See JIRA HBASE-10379 for more details.

132.7. ZooKeeper Client Connection Errors

Errors like this…

  1. 11/07/05 11:26:41 WARN zookeeper.ClientCnxn: Session 0x0 for server null,
  2. unexpected error, closing socket connection and attempting reconnect
  3. java.net.ConnectException: Connection refused: no further information
  4. at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
  5. at sun.nio.ch.SocketChannelImpl.finishConnect(Unknown Source)
  6. at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1078)
  7. 11/07/05 11:26:43 INFO zookeeper.ClientCnxn: Opening socket connection to
  8. server localhost/127.0.0.1:2181
  9. 11/07/05 11:26:44 WARN zookeeper.ClientCnxn: Session 0x0 for server null,
  10. unexpected error, closing socket connection and attempting reconnect
  11. java.net.ConnectException: Connection refused: no further information
  12. at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
  13. at sun.nio.ch.SocketChannelImpl.finishConnect(Unknown Source)
  14. at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1078)
  15. 11/07/05 11:26:45 INFO zookeeper.ClientCnxn: Opening socket connection to
  16. server localhost/127.0.0.1:2181

…are either due to ZooKeeper being down, or unreachable due to network issues.

The utility zkcli may help investigate ZooKeeper issues.

132.8. Client running out of memory though heap size seems to be stable (but the off-heap/direct heap keeps growing)

You are likely running into the issue that is described and worked through in the mail thread HBase, mail # user - Suspected memory leak and continued over in HBase, mail # dev - FeedbackRe: Suspected memory leak. A workaround is passing your client-side JVM a reasonable value for -XX:MaxDirectMemorySize. By default, the MaxDirectMemorySize is equal to your -Xmx max heapsize setting (if -Xmx is set). Try setting it to something smaller (for example, one user had success setting it to 1g when they had a client-side heap of 12g). If you set it too small, it will bring on FullGCs so keep it a bit hefty. You want to make this setting client-side only especially if you are running the new experimental server-side off-heap cache since this feature depends on being able to use big direct buffers (You may have to keep separate client-side and server-side config dirs).

132.9. Secure Client Cannot Connect ([Caused by GSSException: No valid credentials provided(Mechanism level: Failed to find any Kerberos tgt)])

There can be several causes that produce this symptom.

First, check that you have a valid Kerberos ticket. One is required in order to set up communication with a secure Apache HBase cluster. Examine the ticket currently in the credential cache, if any, by running the klist command line utility. If no ticket is listed, you must obtain a ticket by running the kinit command with either a keytab specified, or by interactively entering a password for the desired principal.

Then, consult the Java Security Guide troubleshooting section. The most common problem addressed there is resolved by setting javax.security.auth.useSubjectCredsOnly system property value to false.

Because of a change in the format in which MIT Kerberos writes its credentials cache, there is a bug in the Oracle JDK 6 Update 26 and earlier that causes Java to be unable to read the Kerberos credentials cache created by versions of MIT Kerberos 1.8.1 or higher. If you have this problematic combination of components in your environment, to work around this problem, first log in with kinit and then immediately refresh the credential cache with kinit -R. The refresh will rewrite the credential cache without the problematic formatting.

Prior to JDK 1.4, the JCE was an unbundled product, and as such, the JCA and JCE were regularly referred to as separate, distinct components. As JCE is now bundled in the JDK 7.0, the distinction is becoming less apparent. Since the JCE uses the same architecture as the JCA, the JCE should be more properly thought of as a part of the JCA.

You may need to install the Java Cryptography Extension, or JCE because of JDK 1.5 or earlier version. Insure the JCE jars are on the classpath on both server and client systems.

You may also need to download the unlimited strength JCE policy files. Uncompress and extract the downloaded file, and install the policy jars into /lib/security.

133. MapReduce

133.1. You Think You’re On The Cluster, But You’re Actually Local

This following stacktrace happened using ImportTsv, but things like this can happen on any job with a mis-configuration.

  1. WARN mapred.LocalJobRunner: job_local_0001
  2. java.lang.IllegalArgumentException: Can't read partitions file
  3. at org.apache.hadoop.hbase.mapreduce.hadoopbackport.TotalOrderPartitioner.setConf(TotalOrderPartitioner.java:111)
  4. at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:62)
  5. at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:117)
  6. at org.apache.hadoop.mapred.MapTask$NewOutputCollector.<init>(MapTask.java:560)
  7. at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:639)
  8. at org.apache.hadoop.mapred.MapTask.run(MapTask.java:323)
  9. at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:210)
  10. Caused by: java.io.FileNotFoundException: File _partition.lst does not exist.
  11. at org.apache.hadoop.fs.RawLocalFileSystem.getFileStatus(RawLocalFileSystem.java:383)
  12. at org.apache.hadoop.fs.FilterFileSystem.getFileStatus(FilterFileSystem.java:251)
  13. at org.apache.hadoop.fs.FileSystem.getLength(FileSystem.java:776)
  14. at org.apache.hadoop.io.SequenceFile$Reader.<init>(SequenceFile.java:1424)
  15. at org.apache.hadoop.io.SequenceFile$Reader.<init>(SequenceFile.java:1419)
  16. at org.apache.hadoop.hbase.mapreduce.hadoopbackport.TotalOrderPartitioner.readPartitions(TotalOrderPartitioner.java:296)

…see the critical portion of the stack? It’s…

  1. at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:210)

LocalJobRunner means the job is running locally, not on the cluster.

To solve this problem, you should run your MR job with your HADOOP_CLASSPATH set to include the HBase dependencies. The “hbase classpath” utility can be used to do this easily. For example (substitute VERSION with your HBase version):

  1. HADOOP_CLASSPATH=`hbase classpath` hadoop jar $HBASE_HOME/hbase-mapreduce-VERSION.jar rowcounter usertable

See HBase, MapReduce, and the CLASSPATH for more information on HBase MapReduce jobs and classpaths.

133.2. Launching a job, you get java.lang.IllegalAccessError: com/google/protobuf/HBaseZeroCopyByteString or class com.google.protobuf.ZeroCopyLiteralByteString cannot access its superclass com.google.protobuf.LiteralByteString

See HBASE-10304 Running an hbase job jar: IllegalAccessError: class com.google.protobuf.ZeroCopyLiteralByteString cannot access its superclass com.google.protobuf.LiteralByteString and HBASE-11118 non environment variable solution for “IllegalAccessError: class com.google.protobuf.ZeroCopyLiteralByteString cannot access its superclass com.google.protobuf.LiteralByteString”. The issue can also show up when trying to run spark jobs. See HBASE-10877 HBase non-retriable exception list should be expanded.

134. NameNode

For more information on the NameNode, see HDFS.

134.1. HDFS Utilization of Tables and Regions

To determine how much space HBase is using on HDFS use the hadoop shell commands from the NameNode. For example…

  1. hadoop fs -dus /hbase/

…returns the summarized disk utilization for all HBase objects.

  1. hadoop fs -dus /hbase/myTable

…returns the summarized disk utilization for the HBase table ‘myTable’.

  1. hadoop fs -du /hbase/myTable

…returns a list of the regions under the HBase table ‘myTable’ and their disk utilization.

For more information on HDFS shell commands, see the HDFS FileSystem Shell documentation.

134.2. Browsing HDFS for HBase Objects

Sometimes it will be necessary to explore the HBase objects that exist on HDFS. These objects could include the WALs (Write Ahead Logs), tables, regions, StoreFiles, etc. The easiest way to do this is with the NameNode web application that runs on port 50070. The NameNode web application will provide links to the all the DataNodes in the cluster so that they can be browsed seamlessly.

The HDFS directory structure of HBase tables in the cluster is…

  1. /hbase
  2. /data
  3. /<Namespace> (Namespaces in the cluster)
  4. /<Table> (Tables in the cluster)
  5. /<Region> (Regions for the table)
  6. /<ColumnFamily> (ColumnFamilies for the Region for the table)
  7. /<StoreFile> (StoreFiles for the ColumnFamily for the Regions for the table)

The HDFS directory structure of HBase WAL is..

  1. /hbase
  2. /WALs
  3. /<RegionServer> (RegionServers)
  4. /<WAL> (WAL files for the RegionServer)

See the HDFS User Guide for other non-shell diagnostic utilities like fsck.

134.2.1. Zero size WALs with data in them

Problem: when getting a listing of all the files in a RegionServer’s WALs directory, one file has a size of 0 but it contains data.

Answer: It’s an HDFS quirk. A file that’s currently being written to will appear to have a size of 0 but once it’s closed it will show its true size

134.2.2. Use Cases

Two common use-cases for querying HDFS for HBase objects is research the degree of uncompaction of a table. If there are a large number of StoreFiles for each ColumnFamily it could indicate the need for a major compaction. Additionally, after a major compaction if the resulting StoreFile is “small” it could indicate the need for a reduction of ColumnFamilies for the table.

134.3. Unexpected Filesystem Growth

If you see an unexpected spike in filesystem usage by HBase, two possible culprits are snapshots and WALs.

Snapshots

When you create a snapshot, HBase retains everything it needs to recreate the table’s state at that time of the snapshot. This includes deleted cells or expired versions. For this reason, your snapshot usage pattern should be well-planned, and you should prune snapshots that you no longer need. Snapshots are stored in /hbase/.hbase-snapshot, and archives needed to restore snapshots are stored in /hbase/archive/<_tablename_>/<_region_>/<_column_family_>/.

  1. *Do not* manage snapshots or archives manually via HDFS. HBase provides APIs and
  2. HBase Shell commands for managing them. For more information, see <<ops.snapshots>>.

WAL

Write-ahead logs (WALs) are stored in subdirectories of the HBase root directory, typically /hbase/, depending on their status. Already-processed WALs are stored in /hbase/oldWALs/ and corrupt WALs are stored in /hbase/.corrupt/ for examination. If the size of one of these subdirectories is growing, examine the HBase server logs to find the root cause for why WALs are not being processed correctly.

If you use replication and /hbase/oldWALs/ is using more space than you expect, remember that WALs are saved when replication is disabled, as long as there are peers.

Do not manage WALs manually via HDFS.

135. Network

135.1. Network Spikes

If you are seeing periodic network spikes you might want to check the compactionQueues to see if major compactions are happening.

See Managed Compactions for more information on managing compactions.

135.2. Loopback IP

HBase expects the loopback IP Address to be 127.0.0.1.

135.3. Network Interfaces

Are all the network interfaces functioning correctly? Are you sure? See the Troubleshooting Case Study in Case Studies.

136. RegionServer

For more information on the RegionServers, see RegionServer.

136.1. Startup Errors

136.1.1. Master Starts, But RegionServers Do Not

The Master believes the RegionServers have the IP of 127.0.0.1 - which is localhost and resolves to the master’s own localhost.

The RegionServers are erroneously informing the Master that their IP addresses are 127.0.0.1.

Modify /etc/hosts on the region servers, from…

  1. # Do not remove the following line, or various programs
  2. # that require network functionality will fail.
  3. 127.0.0.1 fully.qualified.regionservername regionservername localhost.localdomain localhost
  4. ::1 localhost6.localdomain6 localhost6

… to (removing the master node’s name from localhost)…

  1. # Do not remove the following line, or various programs
  2. # that require network functionality will fail.
  3. 127.0.0.1 localhost.localdomain localhost
  4. ::1 localhost6.localdomain6 localhost6

136.1.2. Compression Link Errors

Since compression algorithms such as LZO need to be installed and configured on each cluster this is a frequent source of startup error. If you see messages like this…

  1. 11/02/20 01:32:15 ERROR lzo.GPLNativeCodeLoader: Could not load native gpl library
  2. java.lang.UnsatisfiedLinkError: no gplcompression in java.library.path
  3. at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1734)
  4. at java.lang.Runtime.loadLibrary0(Runtime.java:823)
  5. at java.lang.System.loadLibrary(System.java:1028)

… then there is a path issue with the compression libraries. See the Configuration section on link:[LZO compression configuration].

136.1.3. RegionServer aborts due to lack of hsync for filesystem

In order to provide data durability for writes to the cluster HBase relies on the ability to durably save state in a write ahead log. When using a version of Apache Hadoop Common’s filesystem API that supports checking on the availability of needed calls, HBase will proactively abort the cluster if it finds it can’t operate safely.

For RegionServer roles, the failure will show up in logs like this:

  1. 2018-04-05 11:36:22,785 ERROR [regionserver/192.168.1.123:16020] wal.AsyncFSWALProvider: The RegionServer async write ahead log provider relies on the ability to call hflush and hsync for proper operation during component failures, but the current FileSystem does not support doing so. Please check the config value of 'hbase.wal.dir' and ensure it points to a FileSystem mount that has suitable capabilities for output streams.
  2. 2018-04-05 11:36:22,799 ERROR [regionserver/192.168.1.123:16020] regionserver.HRegionServer: ***** ABORTING region server 192.168.1.123,16020,1522946074234: Unhandled: cannot get log writer *****
  3. java.io.IOException: cannot get log writer
  4. at org.apache.hadoop.hbase.wal.AsyncFSWALProvider.createAsyncWriter(AsyncFSWALProvider.java:112)
  5. at org.apache.hadoop.hbase.regionserver.wal.AsyncFSWAL.createWriterInstance(AsyncFSWAL.java:612)
  6. at org.apache.hadoop.hbase.regionserver.wal.AsyncFSWAL.createWriterInstance(AsyncFSWAL.java:124)
  7. at org.apache.hadoop.hbase.regionserver.wal.AbstractFSWAL.rollWriter(AbstractFSWAL.java:759)
  8. at org.apache.hadoop.hbase.regionserver.wal.AbstractFSWAL.rollWriter(AbstractFSWAL.java:489)
  9. at org.apache.hadoop.hbase.regionserver.wal.AsyncFSWAL.<init>(AsyncFSWAL.java:251)
  10. at org.apache.hadoop.hbase.wal.AsyncFSWALProvider.createWAL(AsyncFSWALProvider.java:69)
  11. at org.apache.hadoop.hbase.wal.AsyncFSWALProvider.createWAL(AsyncFSWALProvider.java:44)
  12. at org.apache.hadoop.hbase.wal.AbstractFSWALProvider.getWAL(AbstractFSWALProvider.java:138)
  13. at org.apache.hadoop.hbase.wal.AbstractFSWALProvider.getWAL(AbstractFSWALProvider.java:57)
  14. at org.apache.hadoop.hbase.wal.WALFactory.getWAL(WALFactory.java:252)
  15. at org.apache.hadoop.hbase.regionserver.HRegionServer.getWAL(HRegionServer.java:2105)
  16. at org.apache.hadoop.hbase.regionserver.HRegionServer.buildServerLoad(HRegionServer.java:1326)
  17. at org.apache.hadoop.hbase.regionserver.HRegionServer.tryRegionServerReport(HRegionServer.java:1191)
  18. at org.apache.hadoop.hbase.regionserver.HRegionServer.run(HRegionServer.java:1007)
  19. at java.lang.Thread.run(Thread.java:745)
  20. Caused by: org.apache.hadoop.hbase.util.CommonFSUtils$StreamLacksCapabilityException: hflush and hsync
  21. at org.apache.hadoop.hbase.io.asyncfs.AsyncFSOutputHelper.createOutput(AsyncFSOutputHelper.java:69)
  22. at org.apache.hadoop.hbase.regionserver.wal.AsyncProtobufLogWriter.initOutput(AsyncProtobufLogWriter.java:168)
  23. at org.apache.hadoop.hbase.regionserver.wal.AbstractProtobufLogWriter.init(AbstractProtobufLogWriter.java:167)
  24. at org.apache.hadoop.hbase.wal.AsyncFSWALProvider.createAsyncWriter(AsyncFSWALProvider.java:99)
  25. ... 15 more

If you are attempting to run in standalone mode and see this error, please walk back through the section Quick Start - Standalone HBase and ensure you have included all the given configuration settings.

136.1.4. RegionServer aborts due to can not initialize access to HDFS

We will try to use AsyncFSWAL for HBase-2.x as it has better performance while consuming less resources. But the problem for AsyncFSWAL is that it hacks into the internal of the DFSClient implementation, so it will easily be broken when upgrading hadoop, even for a simple patch release.

If you do not specify the wal provider, we will try to fall back to the old FSHLog if we fail to initialize AsyncFSWAL, but it may not always work. The failure will show up in logs like this:

  1. 18/07/02 18:51:06 WARN concurrent.DefaultPromise: An exception was
  2. thrown by org.apache.hadoop.hbase.io.asyncfs.FanOutOneBlockAsyncDFSOutputHelper$13.operationComplete()
  3. java.lang.Error: Couldn't properly initialize access to HDFS
  4. internals. Please update your WAL Provider to not make use of the
  5. 'asyncfs' provider. See HBASE-16110 for more information.
  6. at org.apache.hadoop.hbase.io.asyncfs.FanOutOneBlockAsyncDFSOutputSaslHelper.<clinit>(FanOutOneBlockAsyncDFSOutputSaslHelper.java:268)
  7. at org.apache.hadoop.hbase.io.asyncfs.FanOutOneBlockAsyncDFSOutputHelper.initialize(FanOutOneBlockAsyncDFSOutputHelper.java:661)
  8. at org.apache.hadoop.hbase.io.asyncfs.FanOutOneBlockAsyncDFSOutputHelper.access$300(FanOutOneBlockAsyncDFSOutputHelper.java:118)
  9. at org.apache.hadoop.hbase.io.asyncfs.FanOutOneBlockAsyncDFSOutputHelper$13.operationComplete(FanOutOneBlockAsyncDFSOutputHelper.java:720)
  10. at org.apache.hadoop.hbase.io.asyncfs.FanOutOneBlockAsyncDFSOutputHelper$13.operationComplete(FanOutOneBlockAsyncDFSOutputHelper.java:715)
  11. at org.apache.hbase.thirdparty.io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:507)
  12. at org.apache.hbase.thirdparty.io.netty.util.concurrent.DefaultPromise.notifyListeners0(DefaultPromise.java:500)
  13. at org.apache.hbase.thirdparty.io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:479)
  14. at org.apache.hbase.thirdparty.io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:420)
  15. at org.apache.hbase.thirdparty.io.netty.util.concurrent.DefaultPromise.trySuccess(DefaultPromise.java:104)
  16. at org.apache.hbase.thirdparty.io.netty.channel.DefaultChannelPromise.trySuccess(DefaultChannelPromise.java:82)
  17. at org.apache.hbase.thirdparty.io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe.fulfillConnectPromise(AbstractEpollChannel.java:638)
  18. at org.apache.hbase.thirdparty.io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe.finishConnect(AbstractEpollChannel.java:676)
  19. at org.apache.hbase.thirdparty.io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe.epollOutReady(AbstractEpollChannel.java:552)
  20. at org.apache.hbase.thirdparty.io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:394)
  21. at org.apache.hbase.thirdparty.io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:304)
  22. at org.apache.hbase.thirdparty.io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
  23. at org.apache.hbase.thirdparty.io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:138)
  24. at java.lang.Thread.run(Thread.java:748)
  25. Caused by: java.lang.NoSuchMethodException:
  26. org.apache.hadoop.hdfs.DFSClient.decryptEncryptedDataEncryptionKey(org.apache.hadoop.fs.FileEncryptionInfo)
  27. at java.lang.Class.getDeclaredMethod(Class.java:2130)
  28. at org.apache.hadoop.hbase.io.asyncfs.FanOutOneBlockAsyncDFSOutputSaslHelper.createTransparentCryptoHelper(FanOutOneBlockAsyncDFSOutputSaslHelper.java:232)
  29. at org.apache.hadoop.hbase.io.asyncfs.FanOutOneBlockAsyncDFSOutputSaslHelper.<clinit>(FanOutOneBlockAsyncDFSOutputSaslHelper.java:262)
  30. ... 18 more

If you hit this error, please specify FSHLog, i.e, filesystem, explicitly in your config file.

  1. <property>
  2. <name>hbase.wal.provider</name>
  3. <value>filesystem</value>
  4. </property>

And do not forget to send an email to the user@hbase.apache.org or dev@hbase.apache.org to report the failure and also your hadoop version, we will try to fix the problem ASAP in the next release.

136.2. Runtime Errors

136.2.1. RegionServer Hanging

Are you running an old JVM (< 1.6.0u21?)? When you look at a thread dump, does it look like threads are BLOCKED but no one holds the lock all are blocked on? See HBASE 3622 Deadlock in HBaseServer (JVM bug?). Adding -XX:+UseMembar to the HBase HBASE_OPTS in _conf/hbase-env.sh may fix it.

136.2.2. java.io.IOException…(Too many open files)

If you see log messages like this…

  1. 2010-09-13 01:24:17,336 WARN org.apache.hadoop.hdfs.server.datanode.DataNode:
  2. Disk-related IOException in BlockReceiver constructor. Cause is java.io.IOException: Too many open files
  3. at java.io.UnixFileSystem.createFileExclusively(Native Method)
  4. at java.io.File.createNewFile(File.java:883)

… see the Getting Started section on link:[ulimit and nproc configuration].

136.2.3. xceiverCount 258 exceeds the limit of concurrent xcievers 256

This typically shows up in the DataNode logs.

See the Getting Started section on link:[xceivers configuration].

136.2.4. System instability, and the presence of “java.lang.OutOfMemoryError: unable to createnew native thread in exceptions” HDFS DataNode logs or that of any system daemon

See the Getting Started section on ulimit and nproc configuration. The default on recent Linux distributions is 1024 - which is far too low for HBase.

136.2.5. DFS instability and/or RegionServer lease timeouts

If you see warning messages like this…

  1. 2009-02-24 10:01:33,516 WARN org.apache.hadoop.hbase.util.Sleeper: We slept xxx ms, ten times longer than scheduled: 10000
  2. 2009-02-24 10:01:33,516 WARN org.apache.hadoop.hbase.util.Sleeper: We slept xxx ms, ten times longer than scheduled: 15000
  3. 2009-02-24 10:01:36,472 WARN org.apache.hadoop.hbase.regionserver.HRegionServer: unable to report to master for xxx milliseconds - retrying

… or see full GC compactions then you may be experiencing full GC’s.

136.2.6. “No live nodes contain current block” and/or YouAreDeadException

These errors can happen either when running out of OS file handles or in periods of severe network problems where the nodes are unreachable.

See the Getting Started section on ulimit and nproc configuration and check your network.

136.2.7. ZooKeeper SessionExpired events

Master or RegionServers shutting down with messages like those in the logs:

  1. WARN org.apache.zookeeper.ClientCnxn: Exception
  2. closing session 0x278bd16a96000f to sun.nio.ch.SelectionKeyImpl@355811ec
  3. java.io.IOException: TIMED OUT
  4. at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:906)
  5. WARN org.apache.hadoop.hbase.util.Sleeper: We slept 79410ms, ten times longer than scheduled: 5000
  6. INFO org.apache.zookeeper.ClientCnxn: Attempting connection to server hostname/IP:PORT
  7. INFO org.apache.zookeeper.ClientCnxn: Priming connection to java.nio.channels.SocketChannel[connected local=/IP:PORT remote=hostname/IP:PORT]
  8. INFO org.apache.zookeeper.ClientCnxn: Server connection successful
  9. WARN org.apache.zookeeper.ClientCnxn: Exception closing session 0x278bd16a96000d to sun.nio.ch.SelectionKeyImpl@3544d65e
  10. java.io.IOException: Session Expired
  11. at org.apache.zookeeper.ClientCnxn$SendThread.readConnectResult(ClientCnxn.java:589)
  12. at org.apache.zookeeper.ClientCnxn$SendThread.doIO(ClientCnxn.java:709)
  13. at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:945)
  14. ERROR org.apache.hadoop.hbase.regionserver.HRegionServer: ZooKeeper session expired

The JVM is doing a long running garbage collecting which is pausing every threads (aka “stop the world”). Since the RegionServer’s local ZooKeeper client cannot send heartbeats, the session times out. By design, we shut down any node that isn’t able to contact the ZooKeeper ensemble after getting a timeout so that it stops serving data that may already be assigned elsewhere.

  • Make sure you give plenty of RAM (in hbase-env.sh), the default of 1GB won’t be able to sustain long running imports.

  • Make sure you don’t swap, the JVM never behaves well under swapping.

  • Make sure you are not CPU starving the RegionServer thread. For example, if you are running a MapReduce job using 6 CPU-intensive tasks on a machine with 4 cores, you are probably starving the RegionServer enough to create longer garbage collection pauses.

  • Increase the ZooKeeper session timeout

If you wish to increase the session timeout, add the following to your hbase-site.xml to increase the timeout from the default of 60 seconds to 120 seconds.

  1. <property>
  2. <name>zookeeper.session.timeout</name>
  3. <value>120000</value>
  4. </property>
  5. <property>
  6. <name>hbase.zookeeper.property.tickTime</name>
  7. <value>6000</value>
  8. </property>

Be aware that setting a higher timeout means that the regions served by a failed RegionServer will take at least that amount of time to be transferred to another RegionServer. For a production system serving live requests, we would instead recommend setting it lower than 1 minute and over-provision your cluster in order the lower the memory load on each machines (hence having less garbage to collect per machine).

If this is happening during an upload which only happens once (like initially loading all your data into HBase), consider bulk loading.

See ZooKeeper, The Cluster Canary for other general information about ZooKeeper troubleshooting.

136.2.8. NotServingRegionException

This exception is “normal” when found in the RegionServer logs at DEBUG level. This exception is returned back to the client and then the client goes back to hbase:meta to find the new location of the moved region.

However, if the NotServingRegionException is logged ERROR, then the client ran out of retries and something probably wrong.

136.2.9. Logs flooded with ‘2011-01-10 12:40:48,407 INFO org.apache.hadoop.io.compress.CodecPool: Gotbrand-new compressor’ messages

We are not using the native versions of compression libraries. See HBASE-1900 Put back native support when hadoop 0.21 is released. Copy the native libs from hadoop under HBase lib dir or symlink them into place and the message should go away.

136.2.10. Server handler X on 60020 caught: java.nio.channels.ClosedChannelException

If you see this type of message it means that the region server was trying to read/send data from/to a client but it already went away. Typical causes for this are if the client was killed (you see a storm of messages like this when a MapReduce job is killed or fails) or if the client receives a SocketTimeoutException. It’s harmless, but you should consider digging in a bit more if you aren’t doing something to trigger them.

136.3. Snapshot Errors Due to Reverse DNS

Several operations within HBase, including snapshots, rely on properly configured reverse DNS. Some environments, such as Amazon EC2, have trouble with reverse DNS. If you see errors like the following on your RegionServers, check your reverse DNS configuration:

  1. 2013-05-01 00:04:56,356 DEBUG org.apache.hadoop.hbase.procedure.Subprocedure: Subprocedure 'backup1'
  2. coordinator notified of 'acquire', waiting on 'reached' or 'abort' from coordinator.

In general, the hostname reported by the RegionServer needs to be the same as the hostname the Master is trying to reach. You can see a hostname mismatch by looking for the following type of message in the RegionServer’s logs at start-up.

  1. 2013-05-01 00:03:00,614 INFO org.apache.hadoop.hbase.regionserver.HRegionServer: Master passed us hostname
  2. to use. Was=myhost-1234, Now=ip-10-55-88-99.ec2.internal

136.4. Shutdown Errors

137. Master

For more information on the Master, see master.

137.1. Startup Errors

137.1.1. Master says that you need to run the HBase migrations script

Upon running that, the HBase migrations script says no files in root directory.

HBase expects the root directory to either not exist, or to have already been initialized by HBase running a previous time. If you create a new directory for HBase using Hadoop DFS, this error will occur. Make sure the HBase root directory does not currently exist or has been initialized by a previous run of HBase. Sure fire solution is to just use Hadoop dfs to delete the HBase root and let HBase create and initialize the directory itself.

137.1.2. Packet len6080218 is out of range!

If you have many regions on your cluster and you see an error like that reported above in this sections title in your logs, see HBASE-4246 Cluster with too many regions cannot withstand some master failover scenarios.

137.1.3. Master fails to become active due to lack of hsync for filesystem

HBase’s internal framework for cluster operations requires the ability to durably save state in a write ahead log. When using a version of Apache Hadoop Common’s filesystem API that supports checking on the availability of needed calls, HBase will proactively abort the cluster if it finds it can’t operate safely.

For Master roles, the failure will show up in logs like this:

  1. 2018-04-05 11:18:44,653 ERROR [Thread-21] master.HMaster: Failed to become active master
  2. java.lang.IllegalStateException: The procedure WAL relies on the ability to hsync for proper operation during component failures, but the underlying filesystem does not support doing so. Please check the config value of 'hbase.procedure.store.wal.use.hsync' to set the desired level of robustness and ensure the config value of 'hbase.wal.dir' points to a FileSystem mount that can provide it.
  3. at org.apache.hadoop.hbase.procedure2.store.wal.WALProcedureStore.rollWriter(WALProcedureStore.java:1034)
  4. at org.apache.hadoop.hbase.procedure2.store.wal.WALProcedureStore.recoverLease(WALProcedureStore.java:374)
  5. at org.apache.hadoop.hbase.procedure2.ProcedureExecutor.start(ProcedureExecutor.java:530)
  6. at org.apache.hadoop.hbase.master.HMaster.startProcedureExecutor(HMaster.java:1267)
  7. at org.apache.hadoop.hbase.master.HMaster.startServiceThreads(HMaster.java:1173)
  8. at org.apache.hadoop.hbase.master.HMaster.finishActiveMasterInitialization(HMaster.java:881)
  9. at org.apache.hadoop.hbase.master.HMaster.startActiveMasterManager(HMaster.java:2048)
  10. at org.apache.hadoop.hbase.master.HMaster.lambda$run$0(HMaster.java:568)
  11. at java.lang.Thread.run(Thread.java:745)

If you are attempting to run in standalone mode and see this error, please walk back through the section Quick Start - Standalone HBase and ensure you have included all the given configuration settings.

137.2. Shutdown Errors

138. ZooKeeper

138.1. Startup Errors

138.1.1. Could not find my address: xyz in list of ZooKeeper quorum servers

A ZooKeeper server wasn’t able to start, throws that error. xyz is the name of your server.

This is a name lookup problem. HBase tries to start a ZooKeeper server on some machine but that machine isn’t able to find itself in the hbase.zookeeper.quorum configuration.

Use the hostname presented in the error message instead of the value you used. If you have a DNS server, you can set hbase.zookeeper.dns.interface and hbase.zookeeper.dns.nameserver in hbase-site.xml to make sure it resolves to the correct FQDN.

138.2. ZooKeeper, The Cluster Canary

ZooKeeper is the cluster’s “canary in the mineshaft”. It’ll be the first to notice issues if any so making sure its happy is the short-cut to a humming cluster.

See the ZooKeeper Operating Environment Troubleshooting page. It has suggestions and tools for checking disk and networking performance; i.e. the operating environment your ZooKeeper and HBase are running in.

Additionally, the utility zkcli may help investigate ZooKeeper issues.

139. Amazon EC2

139.1. ZooKeeper does not seem to work on Amazon EC2

HBase does not start when deployed as Amazon EC2 instances. Exceptions like the below appear in the Master and/or RegionServer logs:

  1. 2009-10-19 11:52:27,030 INFO org.apache.zookeeper.ClientCnxn: Attempting
  2. connection to server ec2-174-129-15-236.compute-1.amazonaws.com/10.244.9.171:2181
  3. 2009-10-19 11:52:27,032 WARN org.apache.zookeeper.ClientCnxn: Exception
  4. closing session 0x0 to sun.nio.ch.SelectionKeyImpl@656dc861
  5. java.net.ConnectException: Connection refused

Security group policy is blocking the ZooKeeper port on a public address. Use the internal EC2 host names when configuring the ZooKeeper quorum peer list.

139.2. Instability on Amazon EC2

Questions on HBase and Amazon EC2 come up frequently on the HBase dist-list. Search for old threads using Search Hadoop

139.3. Remote Java Connection into EC2 Cluster Not Working

See Andrew’s answer here, up on the user list: Remote Java client connection into EC2 instance.

140. HBase and Hadoop version issues

140.1. …cannot communicate with client version…

If you see something like the following in your logs … 2012-09-24 10:20:52,168 FATAL org.apache.hadoop.hbase.master.HMaster: Unhandled exception. Starting shutdown. org.apache.hadoop.ipc.RemoteException: Server IPC version 7 cannot communicate with client version 4 … …are you trying to talk to an Hadoop 2.0.x from an HBase that has an Hadoop 1.0.x client? Use the HBase built against Hadoop 2.0 or rebuild your HBase passing the -Dhadoop.profile=2.0 attribute to Maven (See Building against various hadoop versions. for more).

141. HBase and HDFS

General configuration guidance for Apache HDFS is out of the scope of this guide. Refer to the documentation available at https://hadoop.apache.org/ for extensive information about configuring HDFS. This section deals with HDFS in terms of HBase.

In most cases, HBase stores its data in Apache HDFS. This includes the HFiles containing the data, as well as the write-ahead logs (WALs) which store data before it is written to the HFiles and protect against RegionServer crashes. HDFS provides reliability and protection to data in HBase because it is distributed. To operate with the most efficiency, HBase needs data to be available locally. Therefore, it is a good practice to run an HDFS DataNode on each RegionServer.

Important Information and Guidelines for HBase and HDFS

HBase is a client of HDFS.

HBase is an HDFS client, using the HDFS DFSClient class, and references to this class appear in HBase logs with other HDFS client log messages.

Configuration is necessary in multiple places.

Some HDFS configurations relating to HBase need to be done at the HDFS (server) side. Others must be done within HBase (at the client side). Other settings need to be set at both the server and client side.

Write errors which affect HBase may be logged in the HDFS logs rather than HBase logs.

When writing, HDFS pipelines communications from one DataNode to another. HBase communicates to both the HDFS NameNode and DataNode, using the HDFS client classes. Communication problems between DataNodes are logged in the HDFS logs, not the HBase logs.

HBase communicates with HDFS using two different ports.

HBase communicates with DataNodes using the ipc.Client interface and the DataNode class. References to these will appear in HBase logs. Each of these communication channels use a different port (50010 and 50020 by default). The ports are configured in the HDFS configuration, via the dfs.datanode.address and dfs.datanode.ipc.address parameters.

Errors may be logged in HBase, HDFS, or both.

When troubleshooting HDFS issues in HBase, check logs in both places for errors.

HDFS takes a while to mark a node as dead. You can configure HDFS to avoid using stale DataNodes.

By default, HDFS does not mark a node as dead until it is unreachable for 630 seconds. In Hadoop 1.1 and Hadoop 2.x, this can be alleviated by enabling checks for stale DataNodes, though this check is disabled by default. You can enable the check for reads and writes separately, via dfs.namenode.avoid.read.stale.datanode and dfs.namenode.avoid.write.stale.datanode settings. A stale DataNode is one that has not been reachable for dfs.namenode.stale.datanode.interval (default is 30 seconds). Stale datanodes are avoided, and marked as the last possible target for a read or write operation. For configuration details, see the HDFS documentation.

Settings for HDFS retries and timeouts are important to HBase.

You can configure settings for various retries and timeouts. Always refer to the HDFS documentation for current recommendations and defaults. Some of the settings important to HBase are listed here. Defaults are current as of Hadoop 2.3. Check the Hadoop documentation for the most current values and recommendations.

The HBase Balancer and HDFS Balancer are incompatible

The HDFS balancer attempts to spread HDFS blocks evenly among DataNodes. HBase relies on compactions to restore locality after a region split or failure. These two types of balancing do not work well together.

In the past, the generally accepted advice was to turn off the HDFS load balancer and rely on the HBase balancer, since the HDFS balancer would degrade locality. This advice is still valid if your HDFS version is lower than 2.7.1.

HDFS-6133 provides the ability to exclude favored-nodes (pinned) blocks from the HDFS load balancer, by setting the dfs.datanode.block-pinning.enabled property to true in the HDFS service configuration.

HBase can be enabled to use the HDFS favored-nodes feature by switching the HBase balancer class (conf: hbase.master.loadbalancer.class) to org.apache.hadoop.hbase.favored.FavoredNodeLoadBalancer which is documented here.

HDFS-6133 is available in HDFS 2.7.0 and higher, but HBase does not support running on HDFS 2.7.0, so you must be using HDFS 2.7.1 or higher to use this feature with HBase.

Connection Timeouts

Connection timeouts occur between the client (HBASE) and the HDFS DataNode. They may occur when establishing a connection, attempting to read, or attempting to write. The two settings below are used in combination, and affect connections between the DFSClient and the DataNode, the ipc.cClient and the DataNode, and communication between two DataNodes.

dfs.client.socket-timeout (default: 60000)

The amount of time before a client connection times out when establishing a connection or reading. The value is expressed in milliseconds, so the default is 60 seconds.

dfs.datanode.socket.write.timeout (default: 480000)

The amount of time before a write operation times out. The default is 8 minutes, expressed as milliseconds.

Typical Error Logs

The following types of errors are often seen in the logs.

INFO HDFS.DFSClient: Failed to connect to /xxx50010, add to deadNodes and continue java.net.SocketTimeoutException: 60000 millis timeout while waiting for channel to be ready for connect. ch : java.nio.channels.SocketChannel[connection-pending remote=/region-server-1:50010]:: All DataNodes for a block are dead, and recovery is not possible. Here is the sequence of events that leads to this error:

INFO org.apache.hadoop.HDFS.DFSClient: Exception in createBlockOutputStream java.net.SocketTimeoutException: 69000 millis timeout while waiting for channel to be ready for connect. ch : java.nio.channels.SocketChannel[connection-pending remote=/ xxx:50010]:: This type of error indicates a write issue. In this case, the master wants to split the log. It does not have a local DataNodes so it tries to connect to a remote DataNode, but the DataNode is dead.

142. Running unit or integration tests

142.1. Runtime exceptions from MiniDFSCluster when running tests

If you see something like the following

  1. ...
  2. java.lang.NullPointerException: null
  3. at org.apache.hadoop.hdfs.MiniDFSCluster.startDataNodes
  4. at org.apache.hadoop.hdfs.MiniDFSCluster.<init>
  5. at org.apache.hadoop.hbase.MiniHBaseCluster.<init>
  6. at org.apache.hadoop.hbase.HBaseTestingUtility.startMiniDFSCluster
  7. at org.apache.hadoop.hbase.HBaseTestingUtility.startMiniCluster
  8. ...

or

  1. ...
  2. java.io.IOException: Shutting down
  3. at org.apache.hadoop.hbase.MiniHBaseCluster.init
  4. at org.apache.hadoop.hbase.MiniHBaseCluster.<init>
  5. at org.apache.hadoop.hbase.MiniHBaseCluster.<init>
  6. at org.apache.hadoop.hbase.HBaseTestingUtility.startMiniHBaseCluster
  7. at org.apache.hadoop.hbase.HBaseTestingUtility.startMiniCluster
  8. ...

… then try issuing the command umask 022 before launching tests. This is a workaround for HDFS-2556

143. Case Studies

For Performance and Troubleshooting Case Studies, see Apache HBase Case Studies.

144. Cryptographic Features

144.1. sun.security.pkcs11.wrapper.PKCS11Exception: CKR_ARGUMENTS_BAD

This problem manifests as exceptions ultimately caused by:

  1. Caused by: sun.security.pkcs11.wrapper.PKCS11Exception: CKR_ARGUMENTS_BAD
  2. at sun.security.pkcs11.wrapper.PKCS11.C_DecryptUpdate(Native Method)
  3. at sun.security.pkcs11.P11Cipher.implDoFinal(P11Cipher.java:795)

This problem appears to affect some versions of OpenJDK 7 shipped by some Linux vendors. NSS is configured as the default provider. If the host has an x86_64 architecture, depending on if the vendor packages contain the defect, the NSS provider will not function correctly.

To work around this problem, find the JRE home directory and edit the file lib/security/java.security. Edit the file to comment out the line:

  1. security.provider.1=sun.security.pkcs11.SunPKCS11 ${java.home}/lib/security/nss.cfg

Then renumber the remaining providers accordingly.

145. Operating System Specific Issues

145.1. Page Allocation Failure

This issue is known to affect CentOS 6.2 and possibly CentOS 6.5. It may also affect some versions of Red Hat Enterprise Linux, according to https://bugzilla.redhat.com/show_bug.cgi?id=770545.

Some users have reported seeing the following error:

  1. kernel: java: page allocation failure. order:4, mode:0x20

Raising the value of min_free_kbytes was reported to fix this problem. This parameter is set to a percentage of the amount of RAM on your system, and is described in more detail at http://www.centos.org/docs/5/html/5.1/Deployment_Guide/s3-proc-sys-vm.html.

To find the current value on your system, run the following command:

  1. [user@host]# cat /proc/sys/vm/min_free_kbytes

Next, raise the value. Try doubling, then quadrupling the value. Note that setting the value too low or too high could have detrimental effects on your system. Consult your operating system vendor for specific recommendations.

Use the following command to modify the value of min_free_kbytes, substituting with your intended value:

  1. [user@host]# echo <value> > /proc/sys/vm/min_free_kbytes

146. JDK Issues

146.1. NoSuchMethodError: java.util.concurrent.ConcurrentHashMap.keySet

If you see this in your logs:

  1. Caused by: java.lang.NoSuchMethodError: java.util.concurrent.ConcurrentHashMap.keySet()Ljava/util/concurrent/ConcurrentHashMap$KeySetView;
  2. at org.apache.hadoop.hbase.master.ServerManager.findServerWithSameHostnamePortWithLock(ServerManager.java:393)
  3. at org.apache.hadoop.hbase.master.ServerManager.checkAndRecordNewServer(ServerManager.java:307)
  4. at org.apache.hadoop.hbase.master.ServerManager.regionServerStartup(ServerManager.java:244)
  5. at org.apache.hadoop.hbase.master.MasterRpcServices.regionServerStartup(MasterRpcServices.java:304)
  6. at org.apache.hadoop.hbase.protobuf.generated.RegionServerStatusProtos$RegionServerStatusService$2.callBlockingMethod(RegionServerStatusProtos.java:7910)
  7. at org.apache.hadoop.hbase.ipc.RpcServer.call(RpcServer.java:2020)
  8. ... 4 more

then check if you compiled with jdk8 and tried to run it on jdk7. If so, this won’t work. Run on jdk8 or recompile with jdk7. See HBASE-10607 JDK8 NoSuchMethodError involving ConcurrentHashMap.keySet if running on JRE 7.