Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
2.1.0
-
None
-
None
-
Hive 2.1.0, Hadoop 2.7.2
Description
WebHCat fails to start if SyslogAppender is set instead of a more conventional FileAppender or DailyRollingFileAppender. However, Hive itself can work with a syslog appender.
The error displayed when the webhcat service is killed is:
2016-10-25 09:45:29,538 main ERROR Unable to write to stream UDP:127.0.0.1:514 for appender SYSLOG 2016-10-25 09:45:29,540 main ERROR An exception occurred processing Appender SYSLOG org.apache.logging.log4j.core.appender.AppenderLoggingException: Error flushing stream UDP:127.0.0.1:514 at org.apache.logging.log4j.core.appender.OutputStreamManager.flush(OutputStreamManager.java:159) at org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender.append(AbstractOutputStreamAppender.java:107) at org.apache.logging.log4j.core.config.AppenderControl.tryCallAppender(AppenderControl.java:152) at org.apache.logging.log4j.core.config.AppenderControl.callAppender0(AppenderControl.java:125) at org.apache.logging.log4j.core.config.AppenderControl.callAppenderPreventRecursion(AppenderControl.java:116) at org.apache.logging.log4j.core.config.AppenderControl.callAppender(AppenderControl.java:84) at org.apache.logging.log4j.core.config.LoggerConfig.callAppenders(LoggerConfig.java:390) at org.apache.logging.log4j.core.config.LoggerConfig.processLogEvent(LoggerConfig.java:378) at org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:362) at org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:352) at org.apache.logging.log4j.core.config.AwaitCompletionReliabilityStrategy.log(AwaitCompletionReliabilityStrategy.java:63) at org.apache.logging.log4j.core.Logger.logMessage(Logger.java:143) at org.apache.logging.log4j.spi.AbstractLogger.logMessage(AbstractLogger.java:1016) at org.apache.logging.log4j.spi.AbstractLogger.logIfEnabled(AbstractLogger.java:964) at org.apache.logging.slf4j.Log4jLogger.info(Log4jLogger.java:178) at org.apache.hive.hcatalog.templeton.AppConfig.init(AppConfig.java:197) at org.apache.hive.hcatalog.templeton.AppConfig.<init>(AppConfig.java:176) at org.apache.hive.hcatalog.templeton.Main.loadConfig(Main.java:101) at org.apache.hive.hcatalog.templeton.Main.init(Main.java:85) at org.apache.hive.hcatalog.templeton.Main.<init>(Main.java:80) at org.apache.hive.hcatalog.templeton.Main.main(Main.java:305) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.hadoop.util.RunJar.run(RunJar.java:221) at org.apache.hadoop.util.RunJar.main(RunJar.java:136) Caused by: java.io.IOException: Message too long at java.net.PlainDatagramSocketImpl.send(Native Method) at java.net.DatagramSocket.send(DatagramSocket.java:698) at org.apache.logging.log4j.core.net.DatagramOutputStream.flush(DatagramOutputStream.java:103) at org.apache.logging.log4j.core.appender.OutputStreamManager.flush(OutputStreamManager.java:156) ... 26 more
The syslog appender configuration used here is:
status = INFO name = WebhcatLog4j2 packages = org.apache.hadoop.hive.ql.log # list of properties property.webhcat.log.level = INFO property.webhcat.root.logger = SYSLOG #property.webhcat.log.dir = . #property.webhcat.log.file = webhcat.log # console appender appender.console.type = Console appender.console.name = console appender.console.target = SYSTEM_ERR appender.console.layout.type = PatternLayout appender.console.layout.pattern = %d{yy/MM/dd HH:mm:ss} [%t]: %p %c{2}: %m%n # syslog appender appender.SYSLOG.type = Syslog appender.SYSLOG.name = SYSLOG appender.SYSLOG.host = 127.0.0.1 appender.SYSLOG.port = 514 appender.SYSLOG.protocol = UDP appender.SYSLOG.facility = LOCAL1 # list of all loggers loggers = Jersey, WebComponent, Hadoop, HadoopConf, Zookeeper, Jetty logger.Jersey.name = com.sun.jersey logger.Jersey.level = DEBUG logger.WebComponent.name = com.sun.jersey.spi.container.servlet.WebComponent logger.WebComponent.level = ERROR logger.Hadoop.name = org.apache.hadoop logger.Hadoop.level = INFO logger.HadoopConf.name = org.apache.hadoop.conf logger.HadoopConf.level = WARN logger.Zookeeper.name = org.apache.zookeeper logger.Zookeeper.level = WARN logger.Jetty.name = org.eclipse.jetty logger.Jetty.level = INFO # root logger rootLogger.level = ${sys:webhcat.log.level} rootLogger.appenderRefs = root rootLogger.appenderRef.root.ref = ${sys:webhcat.root.logger}