hive运行HQL语句 报以下错误
Failing this attempt.Diagnostics: [2022-07-21 18:37:14.460]Container [pid=8866,containerID=container_1658399470383_0006_02_000001] is running 648595968B beyond the 'VIRTUAL' memory limit. Current usage: 277.9 MB of 1 GB physical memory used; 2.7 GB of 2.1 GB virtual memory used. Killing container.
Dump of the process-tree for container_1658399470383_0006_02_000001 :
|- PID PPID PGRPID SESSID CMD_NAME USER_MODE_TIME(MILLIS) SYSTEM_TIME(MILLIS) VMEM_USAGE(BYTES) RSSMEM_USAGE(PAGES) FULL_CMD_LINE
|- 8866 8864 8866 8866 (bash) 0 0 11964416 348 /bin/bash -c /opt/module/jdk1.8.0_212/bin/java -Djava.io.tmpdir=/opt/module/hadoop-3.1.3/data/nm-local-dir/usercache/ztx/appcache/application_1658399470383_0006/container_1658399470383_0006_02_000001/tmp -server -Djava.net.preferIPv4Stack=true -Dhadoop.metrics.log.level=WARN -Xmx1024m -Dlog4j.configuratorClass=org.apache.tez.common.TezLog4jConfigurator -Dlog4j.configuration=tez-container-log4j.properties -Dyarn.app.container.log.dir=/opt/module/hadoop-3.1.3/logs/userlogs/application_1658399470383_0006/container_1658399470383_0006_02_000001 -Dtez.root.logger=INFO,CLA -Dsun.nio.ch.bugLevel='' org.apache.tez.dag.app.DAGAppMaster --session 1>/opt/module/hadoop-3.1.3/logs/userlogs/application_1658399470383_0006/container_1658399470383_0006_02_000001/stdout 2>/opt/module/hadoop-3.1.3/logs/userlogs/application_1658399470383_0006/container_1658399470383_0006_02_000001/stderr
|- 8877 8866 8866 8866 (java) 547 75 2891489280 70799 /opt/module/jdk1.8.0_212/bin/java -Djava.io.tmpdir=/opt/module/hadoop-3.1.3/data/nm-local-dir/usercache/ztx/appcache/application_1658399470383_0006/container_1658399470383_0006_02_000001/tmp -server -Djava.net.preferIPv4Stack=true -Dhadoop.metrics.log.level=WARN -Xmx1024m -Dlog4j.configuratorClass=org.apache.tez.common.TezLog4jConfigurator -Dlog4j.configuration=tez-container-log4j.properties -Dyarn.app.container.log.dir=/opt/module/hadoop-3.1.3/logs/userlogs/application_1658399470383_0006/container_1658399470383_0006_02_000001 -Dtez.root.logger=INFO,CLA -Dsun.nio.ch.bugLevel= org.apache.tez.dag.app.DAGAppMaster --session
[2022-07-21 18:37:14.468]Container killed on request. Exit code is 143
[2022-07-21 18:37:14.474]Container exited with a non-zero exit code 143.
For more detailed output, check the application tracking page: http://hadoop103:8088/cluster/app/application_1658399470383_0006 Then click on links to logs of each attempt.
. Failing the application.
FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.tez.TezTask. Application application_1658399470383_0006 failed 2 times due to AM Container for appattempt_1658399470383_0006_000002 exited with exitCode: -103
Failing this attempt.Diagnostics: [2022-07-21 18:37:14.460]Container [pid=8866,containerID=container_1658399470383_0006_02_000001] is running 648595968B beyond the 'VIRTUAL' memory limit. Current usage: 277.9 MB of 1 GB physical memory used; 2.7 GB of 2.1 GB virtual memory used. Killing container.
Dump of the process-tree for container_1658399470383_0006_02_000001 :
|- PID PPID PGRPID SESSID CMD_NAME USER_MODE_TIME(MILLIS) SYSTEM_TIME(MILLIS) VMEM_USAGE(BYTES) RSSMEM_USAGE(PAGES) FULL_CMD_LINE
|- 8866 8864 8866 8866 (bash) 0 0 11964416 348 /bin/bash -c /opt/module/jdk1.8.0_212/bin/java -Djava.io.tmpdir=/opt/module/hadoop-3.1.3/data/nm-local-dir/usercache/ztx/appcache/application_1658399470383_0006/container_1658399470383_0006_02_000001/tmp -server -Djava.net.preferIPv4Stack=true -Dhadoop.metrics.log.level=WARN -Xmx1024m -Dlog4j.configuratorClass=org.apache.tez.common.TezLog4jConfigurator -Dlog4j.configuration=tez-container-log4j.properties -Dyarn.app.container.log.dir=/opt/module/hadoop-3.1.3/logs/userlogs/application_1658399470383_0006/container_1658399470383_0006_02_000001 -Dtez.root.logger=INFO,CLA -Dsun.nio.ch.bugLevel='' org.apache.tez.dag.app.DAGAppMaster --session 1>/opt/module/hadoop-3.1.3/logs/userlogs/application_1658399470383_0006/container_1658399470383_0006_02_000001/stdout 2>/opt/module/hadoop-3.1.3/logs/userlogs/application_1658399470383_0006/container_1658399470383_0006_02_000001/stderr
|- 8877 8866 8866 8866 (java) 547 75 2891489280 70799 /opt/module/jdk1.8.0_212/bin/java -Djava.io.tmpdir=/opt/module/hadoop-3.1.3/data/nm-local-dir/usercache/ztx/appcache/application_1658399470383_0006/container_1658399470383_0006_02_000001/tmp -server -Djava.net.preferIPv4Stack=true -Dhadoop.metrics.log.level=WARN -Xmx1024m -Dlog4j.configuratorClass=org.apache.tez.common.TezLog4jConfigurator -Dlog4j.configuration=tez-container-log4j.properties -Dyarn.app.container.log.dir=/opt/module/hadoop-3.1.3/logs/userlogs/application_1658399470383_0006/container_1658399470383_0006_02_000001 -Dtez.root.logger=INFO,CLA -Dsun.nio.ch.bugLevel= org.apache.tez.dag.app.DAGAppMaster --session
[2022-07-21 18:37:14.468]Container killed on request. Exit code is 143
[2022-07-21 18:37:14.474]Container exited with a non-zero exit code 143.
For more detailed output, check the application tracking page: http://hadoop103:8088/cluster/app/application_1658399470383_0006 Then click on links to logs of each attempt.
. Failing the application.
报错原因是:Hadoop的虚拟内存不够用了,需要增加虚拟内存
在hadoop的 yarn-site.xml 文件添加以下配置信息
<property>
<name>yarn.nodemanager.vmem-check-enabled</name>
<value>false</value>
</property>
<property>
<name>yarn.nodemanager.vmem-pmem-ratio</name>
<value>5</value>
</property>
运行就会成功了
hive (default)> select count(*) from emp;
Query ID = ztx_20220721185502_2c88f6f4-1b8a-4a38-8eab-caf67a85e29b
Total jobs = 1
Launching Job 1 out of 1
Tez session was closed. Reopening...
Session re-established.
Session re-established.
Status: Running (Executing on YARN cluster with App id application_1658400616483_0003)
----------------------------------------------------------------------------------------------
VERTICES MODE STATUS TOTAL COMPLETED RUNNING PENDING FAILED KILLED
----------------------------------------------------------------------------------------------
Map 1 .......... container SUCCEEDED 1 1 0 0 0 0
Reducer 2 ...... container SUCCEEDED 1 1 0 0 0 0
----------------------------------------------------------------------------------------------
VERTICES: 02/02 [==========================>>] 100% ELAPSED TIME: 3.48 s
----------------------------------------------------------------------------------------------
OK
_c0
13
Time taken: 14.135 seconds, Fetched: 1 row(s)