Running Hive Beeline Commands as a Background Process

0 votes
asked Aug 30, 2017 in Hadoop by admin (4,410 points)
SummaryThis article aims to cover a known bug with running Beeline commands as a background process (via a fork, nohup, etc.)


Attempting to run a Beeline command as a background process, prepared with full arguments to avoid any prompts, with a fork symbol or a nohup directive, results in the process entering the STOP state in Linux instead of continuing to execute in the background as expected of it.

Applies To
  • Beeline
  • Hive
CauseIf the signal is further inspected, the Beeline process appears to receive the SIGTTOU signal for attempting to present bytes onto the standard output even when executing in the background, an act the shell deems illegal and thereby suspends the process entirely.

This may be cause of a bug in the implementation of the console used in Beeline, and an upstream bug HIVE-6758 tracks the investigation.
There are additional defects noted in 

Upgrade to CDH 5.9.0 or higher.


If you are unable to upgrade, apply the following environment change prior to running the beeline command.

export HADOOP_CLIENT_OPTS="-Djline.terminal=jline.UnsupportedTerminal"
beeline [arguments] &

Note: A Beeline script must contain a !quit at the end.

Please log in or register to answer this question.