When hive executes the job, it is stuck, the execution progress is always 0%, and then the problem of the error is analyzed and solved

Because of business needs across computer rooms, a small hadoop cluster was deployed in another computer room. One of the nodes was the namenode without computing node datanode, and the other two nodes were datanode nodes. Each node was allocated 50G of memory, with a total of 100G of memory resources; Each machine has a 32-core CPU, and the maximum usage is 80%, that is, 26 cores. The configuration is as follows:
yarn-site.xml
<property>
        <name>yarn.nodemanager.resource.memory-mb</name>
        <value>51200</value>
</property>
<property>
        <name>yarn.nodemanager.resource.cpu-vcores</name>
        <value>26</value>
</property>


Because hive is currently mainly used for offline data analysis, there is basically no problem with hive execution when the amount of data is small. The hive task execution failed. Later, the following problems were found through the execution of this console:


the execution progress is always 0%


, and the error in the above figure is reported after a period of time, and then exits.
Sometimes a memory overflow is reported:
Diagnostic Messages for this Task:
Error: java.lang.OutOfMemoryError: Java heap space

is probably caused by insufficient cluster resources. So I searched the Internet for articles about hive memory overflow related issues and found http://blog.csdn.net/godspeedlaile9/article/details/13776595, according to the solution proposed in this article:
Currently hive.map.aggr. hash.percentmemory is set to 0.5. Try setting it to a lower value. ie 'set hive.map.aggr.hash.percentmemory = 0.25;'
That means the current property of hive is 0.5, we adjust it in hive It is 0.25. After the adjustment, the task can be executed normally.

But the reason does give me a deep question mark?

Check out the description of the hive.map.aggr.hash.percentmemory property in hive: The memory ratio of the virtual machine occupied by the hash storage aggregated on the Hive Map side.
It means that when the map size of the memory accounts for 25% of the Map process configured by the JVM (the default is 50%), the data is flushed to the reducer to release the space of the memory map.
Cause of the error: The memory ratio occupied by the hash table when the Map is aggregated is 0.5 by default. This value exceeds the available memory size, resulting in memory overflow.

PS: Insufficient resources, many students may first think of adding a machine. I also thought so at the beginning, but there is always a gap in reality.



Welcome everyone to propose different solutions or supplements!



References:
http://dacoolbaby.iteye.com/blog/1880089
http://blog.csdn.net/lixucpf/article/details/20458617

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326643173&siteId=291194637