本文主要是介绍hive truncate 命令卡死问题,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
hive 执行create,drop,insert等语句没有问题
执行truncate命令卡死,查看log:/tmp/root/hive.log
2017-06-16T09:16:16,658 INFO [main] lockmgr.DbTxnManager: Setting lock request transaction to txnid:0 for queryId=root_20170616091616_a575e3d7-ff4e-40fc-a5ed-771ab991219d 2017-06-16T09:16:16,658 INFO [main] lockmgr.DbLockManager: Requesting: queryId=root_20170616091616_a575e3d7-ff4e-40fc-a5ed-771ab991219d LockRequest(component:[LockComponent(type:EXCLUSIVE, level:TABLE, dbname:alarm, tablename:alarm_no_partition, operationType:NO_TXN, isAcid:true)], txnid:0, user:root, hostname:master, agentInfo:root_20170616091616_a575e3d7-ff4e-40fc-a5ed-771ab991219d) 2017-06-16T09:16:16,678 INFO [main] txn.TxnHandler: 'CheckLock' locked by 'master' 2017-06-16T09:16:16,696 INFO [main] txn.TxnHandler: 'CheckLock' unlocked by 'master' 2017-06-16T09:16:16,700 INFO [main] lockmgr.DbLockManager: Response to queryId=root_20170616091616_a575e3d7-ff4e-40fc-a5ed-771ab991219d LockResponse(lockid:227, state:WAITING) 2017-06-16T09:16:16,818 INFO [main] txn.TxnHandler: 'CheckLock' locked by 'master' 2017-06-16T09:16:16,835 INFO [main] txn.TxnHandler: 'CheckLock' unlocked by 'master' 2017-06-16T09:16:17,057 INFO [main] txn.TxnHandler: 'CheckLock' locked by 'master' 2017-06-16T09:16:17,074 INFO [main] txn.TxnHandler: 'CheckLock' unlocked by 'master' 2017-06-16T09:16:17,495 INFO [main] txn.TxnHandler: 'CheckLock' locked by 'master' 2017-06-16T09:16:17,512 INFO [main] txn.TxnHandler: 'CheckLock' unlocked by 'master' 2017-06-16T09:16:18,334 INFO [main] txn.TxnHandler: 'CheckLock' locked by 'master'
出现在hive lock,问题查看官网介绍:https://cwiki.apache.org/confluence/display/Hive/Configuration+Properties#ConfigurationProperties-Locking
hive.lock.mapred.only.operation
- Default Value: false
- Added In:
This configuration property is to control whether or not only do lock on queries that need to execute at least one mapred job.
设置值为true,解决问题
shell上设置只是临时设置,hive-site.xml中需要重启HiveMetaStore
这篇关于hive truncate 命令卡死问题的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!