Reply
Highlighted
New Contributor
Posts: 1
Registered: ‎05-22-2018

flume hivesink excception : Failed connecting to EndPoint metaStoreUri

[ Edited ]

hi

 

I set up a CDH(5.11.2) cluster to backup logs, and use flume hivesink to sink logs(json format) into hive table(with year, month, day partitions)

This data flow has run normally for several months.

in last weekend, my colleague restarted the cluster, then flume hivesink always throw exceptions as

2018-05-22 16:35:26,767 ERROR org.apache.flume.SinkRunner: Unable to deliver event. Exception follows.
org.apache.flume.EventDeliveryException: org.apache.flume.sink.hive.HiveWriter$ConnectException: Failed connecting to EndPoint {metaStoreUri='thrift://172.21.0.12:9083', database='vivavideo', table='video_negative_feedback', partitionVals=[2018, 05, 22] }
    at org.apache.flume.sink.hive.HiveSink.process(HiveSink.java:267)
    at org.apache.flume.sink.DefaultSinkProcessor.process(DefaultSinkProcessor.java:67)
    at org.apache.flume.SinkRunner$PollingRunner.run(SinkRunner.java:145)
    at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.flume.sink.hive.HiveWriter$ConnectException: Failed connecting to EndPoint {metaStoreUri='thrift://172.21.0.12:9083', database='vivavideo', table='video_negative_feedback', partitionVals=[2018, 05, 22] }
    at org.apache.flume.sink.hive.HiveWriter.<init>(HiveWriter.java:99)
    at org.apache.flume.sink.hive.HiveSink.getOrCreateWriter(HiveSink.java:343)
    at org.apache.flume.sink.hive.HiveSink.drainOneBatch(HiveSink.java:295)
    at org.apache.flume.sink.hive.HiveSink.process(HiveSink.java:253)
    ... 3 more
Caused by: org.apache.flume.sink.hive.HiveWriter$ConnectException: Failed connecting to EndPoint {metaStoreUri='thrift://172.21.0.12:9083', database='vivavideo', table='video_negative_feedback', partitionVals=[2018, 05, 22] }
    at org.apache.flume.sink.hive.HiveWriter.newConnection(HiveWriter.java:383)
    at org.apache.flume.sink.hive.HiveWriter.<init>(HiveWriter.java:86)
    ... 6 more
Caused by: java.util.concurrent.TimeoutException
    at java.util.concurrent.FutureTask.get(FutureTask.java:201)
    at org.apache.flume.sink.hive.HiveWriter.timedCall(HiveWriter.java:434)
    at org.apache.flume.sink.hive.HiveWriter.newConnection(HiveWriter.java:376)
    ... 7 more

 

The partitions [2018, 05, 22] for table "video_negative_feedback" is added by flume:

year=2018/month=05/day=18
year=2018/month=05/day=19
year=2018/month=05/day=20
year=2018/month=05/day=21
year=2018/month=05/day=22

 

I has tried some solutions as :

1. increase hive timeout config from 60 to 3600

2. make hdfs://tmp/hive writable(chmod 777)

 

but this exception still remains.

 

the flume config as follows

###define agent

a1.sources = video_negative_feedback
a1.channels = video_negative_feedback
a1.sinks = video_negative_feedback


###define sources

a1.sources.video_negative_feedback.type = org.apache.flume.source.kafka.KafkaSource
a1.sources.video_negative_feedback.kafka.bootstrap.servers = 47.74.191.224:9092
a1.sources.video_negative_feedback.kafka.topics = video_negative_feedback


###define channels


a1.channels.video_negative_feedback.type = memory
a1.channels.video_negative_feedback.capacity = 5000
a1.channels.video_negative_feedback.transactionCapacity = 1000


###define sink

a1.sinks.video_negative_feedback.type = hive
a1.sinks.video_negative_feedback.hive.metastore = thrift://172.21.0.12:9083
a1.sinks.video_negative_feedback.hive.database = vivavideo
a1.sinks.video_negative_feedback.hive.table = video_negative_feedback
a1.sinks.video_negative_feedback.hive.partition = %Y,%m,%d
a1.sinks.video_negative_feedback.useLocalTimeStamp = false
a1.sinks.video_negative_feedback.serializer = JSON
a1.sinks.video_negative_feedback.txnsPerBatchAsk = 100
a1.sinks.video_negative_feedback.batchSize = 150


###bind the sources and sink to the channel

a1.sources.video_negative_feedback.channels = video_negative_feedback
a1.sinks.video_negative_feedback.channel = video_negative_feedback

 

look forward to your reply

Announcements
New solutions