原因和解决办法:
yarn2需要的内存大小至少是4Gb,报错的原因就是内存不够。
如果是用的vmware,将装yarn服务的主机内存大小调到6G就可以解决了。
报错:
Memory: 4k page, physical 3863576k(157772k free), swap 3145724k(1680636k free)vm_info: Java HotSpot(TM) 64-Bit Server VM (25.321-b07) for linux-amd64 JRE (1.8.0_321-b07), built on Dec 15 2021 19:16:05 by "java_re" with gcc 7.3.0time: Fri Apr 1 17:24:54 2022 timezone: CST elapsed time: 0.014674 seconds (0d 0h 0m 0s)==> /var/log/hadoop-yarn/embedded-yarn-ats-hbase/hbase-yarn-ats-regionserver-hdp-2.out.2 <== ==> /var/log/hadoop-yarn/embedded-yarn-ats-hbase/gc.log-202204011726 <== Java HotSpot(TM) 64-Bit Server VM (25.321-b07) for linux-amd64 JRE (1.8.0_321-b07), built on Dec 15 2021 19:16:05 by "java_re" with gcc 7.3.0 Memory: 4k page, physical 3863576k(2097824k free), swap 3145724k(2497020k free) CommandLine flags: -XX:ErrorFile=/var/log/hadoop-yarn/embedded-yarn-ats-hbase/hs_err_pid%p.log -XX:InitialHeapSize=61817216 -XX:MaxHeapSize=3435134976 -XX:MaxNewSize=174485504 -XX:MaxTenuringThreshold=6 -XX:OldPLABSize=16 -XX:OnOutOfMemoryError=kill -9 %p -XX:+PrintGC -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+UseCompressedClassPointers -XX:+UseCompressedOops -XX:+UseConcMarkSweepGC -XX:+UseParNewGC 2022-04-01T17:32:32.730+0800: 1.098: [GC (Allocation Failure) 2022-04-01T17:32:32.730+0800: 1.098: [ParNew: 16384K->2047K(18432K), 0.0039923 secs] 16384K->2931K(59392K), 0.0040882 secs] [Times: user=0.01 sys=0.00, real=0.00 secs] 2022-04-01T17:32:33.203+0800: 1.571: [GC (Allocation Failure) 2022-04-01T17:32:33.203+0800: 1.571: [ParNew: 18431K->2034K(18432K), 0.0158966 secs] 19315K->4215K(59392K), 0.0159610 secs] [Times: user=0.01 sys=0.01, real=0.02 secs] 2022-04-01T17:32:33.810+0800: 2.178: [GC (Allocation Failure) 2022-04-01T17:32:33.810+0800: 2.178: [ParNew: 18418K->2048K(18432K), 0.0073860 secs] 20599K->5315K(59392K), 0.0074752 secs] [Times: user=0.01 sys=0.00, real=0.01 secs] Heappar new generation total 18432K, used 13875K [0x00000006f3400000, 0x00000006f4800000, 0x00000006fda60000)eden space 16384K, 72% used [0x00000006f3400000, 0x00000006f3f8cd88, 0x00000006f4400000)from space 2048K, 100% used [0x00000006f4600000, 0x00000006f4800000, 0x00000006f4800000)to space 2048K, 0% used [0x00000006f4400000, 0x00000006f4400000, 0x00000006f4600000)concurrent mark-sweep generation total 40960K, used 3267K [0x00000006fda60000, 0x0000000700260000, 0x00000007c0000000)Metaspace used 10422K, capacity 10626K, committed 10752K, reserved 1058816Kclass space used 1147K, capacity 1220K, committed 1280K, reserved 1048576K ==> /var/log/hadoop-yarn/embedded-yarn-ats-hbase/hbase-yarn-ats-master-hdp-2.out.1 <== ==> /var/log/hadoop-yarn/embedded-yarn-ats-hbase/hbase-yarn-ats-regionserver-hdp-2.out.3 <== Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x00000006fda60000, 3260678144, 0) failed; error='Cannot allocate memory' (errno=12) # # There is insufficient memory for the Java Runtime Environment to continue. # Native memory allocation (mmap) failed to map 3260678144 bytes for committing reserved memory. # An error report file with more information is saved as: # /var/log/hadoop-yarn/embedded-yarn-ats-hbase/hs_err_pid29967.log ==> /var/log/hadoop-yarn/embedded-yarn-ats-hbase/hs_err_pid29967.log <== cache_alignment : 64 address sizes : 45 bits physical, 48 bits virtual power management:processor : 1 vendor_id : GenuineIntel cpu family : 6 model : 63 model name : Intel(R) Xeon(R) CPU E5-2630 v3 @ 2.40GHz stepping : 2 microcode : 0x3d cpu MHz : 2394.455 cache size : 20480 KB physical id : 0 siblings : 2 core id : 1 cpu cores : 2 apicid : 1 initial apicid : 1 fpu : yes fpu_exception : yes cpuid level : 15 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon nopl xtopology tsc_reliable nonstop_tsc eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm fsgsbase tsc_adjust bmi1 avx2 smep bmi2 invpcid xsaveopt ibpb ibrs stibp arat spec_ctrl intel_stibp arch_capabilities bogomips : 4788.91 clflush size : 64 cache_alignment : 64 address sizes : 45 bits physical, 48 bits virtual power management:Memory: 4k page, physical 3863576k(156568k free), swap 3145724k(1658876k free)vm_info: Java HotSpot(TM) 64-Bit Server VM (25.321-b07) for linux-amd64 JRE (1.8.0_321-b07), built on Dec 15 2021 19:16:05 by "java_re" with gcc 7.3.0time: Fri Apr 1 17:26:15 2022 timezone: CST elapsed time: 0.018410 seconds (0d 0h 0m 0s)==> /var/log/hadoop-yarn/embedded-yarn-ats-hbase/hbase-yarn-ats-regionserver-hdp-2.out <== Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x00000006fda60000, 3260678144, 0) failed; error='Cannot allocate memory' (errno=12) # # There is insufficient memory for the Java Runtime Environment to continue. # Native memory allocation (mmap) failed to map 3260678144 bytes for committing reserved memory. # An error report file with more information is saved as: # /var/log/hadoop-yarn/embedded-yarn-ats-hbase/hs_err_pid58968.log ==> /var/log/hadoop-yarn/embedded-yarn-ats-hbase/gc.log-202204021446 <== 2022-04-02T14:46:59.524+0800: 4.980: [GC (Allocation Failure) 2022-04-02T14:46:59.525+0800: 4.980: [ParNew: 18431K->2047K(18432K), 0.0174280 secs] 25121K->10567K(59392K), 0.0175027 secs] [Times: user=0.02 sys=0.00, real=0.02 secs] 2022-04-02T14:46:59.730+0800: 5.186: [GC (Allocation Failure) 2022-04-02T14:46:59.730+0800: 5.186: [ParNew: 18431K->1869K(18432K), 0.0044240 secs] 26951K->10537K(59392K), 0.0045141 secs] [Times: user=0.01 sys=0.00, real=0.00 secs] 2022-04-02T14:46:59.904+0800: 5.360: [GC (Allocation Failure) 2022-04-02T14:46:59.904+0800: 5.360: [ParNew: 18253K->1160K(18432K), 0.0108471 secs] 26921K->10120K(59392K), 0.0109380 secs] [Times: user=0.01 sys=0.00, real=0.01 secs] 2022-04-02T14:47:00.248+0800: 5.704: [GC (Allocation Failure) 2022-04-02T14:47:00.250+0800: 5.706: [ParNew: 17544K->1060K(18432K), 0.0127512 secs] 26504K->10350K(59392K), 0.0148516 secs] [Times: user=0.01 sys=0.00, real=0.01 secs] 2022-04-02T14:47:00.416+0800: 5.871: [GC (Allocation Failure) 2022-04-02T14:47:00.416+0800: 5.871: [ParNew: 17444K->693K(18432K), 0.0160933 secs] 26734K->9983K(59392K), 0.0161774 secs] [Times: user=0.01 sys=0.01, real=0.02 secs] 2022-04-02T14:47:00.835+0800: 6.291: [GC (Allocation Failure) 2022-04-02T14:47:00.835+0800: 6.291: [ParNew: 17077K->1083K(18432K), 0.0147214 secs] 26367K->10372K(59392K), 0.0148355 secs] [Times: user=0.02 sys=0.00, real=0.02 secs] 2022-04-02T14:47:01.016+0800: 6.471: [GC (Allocation Failure) 2022-04-02T14:47:01.016+0800: 6.472: [ParNew: 17467K->1148K(18432K), 0.0241840 secs] 26756K->10438K(59392K), 0.0242743 secs] [Times: user=0.02 sys=0.00, real=0.03 secs] 2022-04-02T14:47:01.105+0800: 6.561: [GC (Allocation Failure) 2022-04-02T14:47:01.105+0800: 6.561: [ParNew: 17532K->871K(18432K), 0.0077980 secs] 26822K->10334K(59392K), 0.0078924 secs] [Times: user=0.01 sys=0.00, real=0.01 secs] 2022-04-02T14:47:01.207+0800: 6.663: [GC (Allocation Failure) 2022-04-02T14:47:01.207+0800: 6.663: [ParNew: 17255K->1197K(18432K), 0.0019777 secs] 26718K->10660K(59392K), 0.0020476 secs] [Times: user=0.00 sys=0.00, real=0.00 secs] 2022-04-02T14:47:01.248+0800: 6.703: [GC (Allocation Failure) 2022-04-02T14:47:01.248+0800: 6.703: [ParNew: 17581K->979K(18432K), 0.0069126 secs] 27044K->10441K(59392K), 0.0069865 secs] [Times: user=0.00 sys=0.00, real=0.00 secs] 2022-04-02T14:47:01.289+0800: 6.745: [GC (Allocation Failure) 2022-04-02T14:47:01.289+0800: 6.745: [ParNew: 17363K->1000K(18432K), 0.0035972 secs] 26825K->10505K(59392K), 0.0036548 secs] [Times: user=0.01 sys=0.00, real=0.00 secs] 2022-04-02T14:47:01.332+0800: 6.788: [GC (Allocation Failure) 2022-04-02T14:47:01.332+0800: 6.788: [ParNew: 17384K->869K(18432K), 0.0038770 secs] 26889K->10567K(59392K), 0.0039423 secs] [Times: user=0.01 sys=0.00, real=0.00 secs] 2022-04-02T14:47:01.370+0800: 6.825: [GC (Allocation Failure) 2022-04-02T14:47:01.370+0800: 6.825: [ParNew: 17253K->801K(18432K), 0.0030295 secs] 26951K->10568K(59392K), 0.0030958 secs] [Times: user=0.00 sys=0.00, real=0.00 secs] 2022-04-02T14:47:01.514+0800: 6.970: [GC (Allocation Failure) 2022-04-02T14:47:01.514+0800: 6.970: [ParNew: 17185K->992K(18432K), 0.0048903 secs] 26952K->10790K(59392K), 0.0050008 secs] [Times: user=0.01 sys=0.00, real=0.01 secs] 2022-04-02T14:47:01.581+0800: 7.036: [GC (Allocation Failure) 2022-04-02T14:47:01.581+0800: 7.036: [ParNew: 17376K->851K(18432K), 0.0038587 secs] 27174K->10680K(59392K), 0.0039139 secs] [Times: user=0.01 sys=0.00, real=0.00 secs] 2022-04-02T14:47:01.669+0800: 7.124: [GC (Allocation Failure) 2022-04-02T14:47:01.669+0800: 7.124: [ParNew: 17235K->1045K(18432K), 0.0069038 secs] 27064K->10907K(59392K), 0.0069633 secs] [Times: user=0.01 sys=0.00, real=0.00 secs] 2022-04-02T14:47:01.784+0800: 7.239: [GC (Allocation Failure) 2022-04-02T14:47:01.784+0800: 7.239: [ParNew: 17429K->1394K(18432K), 0.0076023 secs] 27291K->11286K(59392K), 0.0076694 secs] [Times: user=0.01 sys=0.00, real=0.01 secs] 2022-04-02T14:47:02.354+0800: 7.810: [GC (Allocation Failure) 2022-04-02T14:47:02.354+0800: 7.810: [ParNew: 17778K->2047K(18432K), 0.0102117 secs] 27670K->12545K(59392K), 0.0105742 secs] [Times: user=0.01 sys=0.00, real=0.01 secs] 2022-04-02T14:47:02.611+0800: 8.067: [GC (Allocation Failure) 2022-04-02T14:47:02.611+0800: 8.067: [ParNew: 18431K->1619K(18432K), 0.0092325 secs] 28929K->13144K(59392K), 0.0093220 secs] [Times: user=0.00 sys=0.00, real=0.01 secs] 2022-04-02T14:47:02.874+0800: 8.330: [GC (Allocation Failure) 2022-04-02T14:47:02.874+0800: 8.330: [ParNew: 18003K->1834K(18432K), 0.0086819 secs] 29528K->13683K(59392K), 0.0087796 secs] [Times: user=0.01 sys=0.00, real=0.01 secs] 2022-04-02T14:47:02.891+0800: 8.347: [GC (CMS Initial Mark) [1 CMS-initial-mark: 11848K(40960K)] 14491K(59392K), 0.0026043 secs] [Times: user=0.00 sys=0.00, real=0.00 secs] 2022-04-02T14:47:02.897+0800: 8.352: [CMS-concurrent-mark-start] 2022-04-02T14:47:02.942+0800: 8.398: [CMS-concurrent-mark: 0.045/0.045 secs] [Times: user=0.06 sys=0.01, real=0.04 secs] 2022-04-02T14:47:02.942+0800: 8.398: [CMS-concurrent-preclean-start] 2022-04-02T14:47:02.943+0800: 8.399: [CMS-concurrent-preclean: 0.001/0.001 secs] [Times: user=0.00 sys=0.00, real=0.00 secs] 2022-04-02T14:47:02.943+0800: 8.399: [CMS-concurrent-abortable-preclean-start] 2022-04-02T14:47:03.158+0800: 8.614: [GC (Allocation Failure) 2022-04-02T14:47:03.158+0800: 8.614: [ParNew: 18218K->1038K(18432K), 0.0078242 secs] 30067K->13769K(59392K), 0.0079148 secs] [Times: user=0.00 sys=0.00, real=0.00 secs] 2022-04-02T14:47:03.291+0800: 8.747: [CMS-concurrent-abortable-preclean: 0.075/0.348 secs] [Times: user=0.32 sys=0.02, real=0.35 secs] 2022-04-02T14:47:03.296+0800: 8.751: [GC (CMS Final Remark) [YG occupancy: 10736 K (18432 K)]2022-04-02T14:47:03.296+0800: 8.751: [Rescan (parallel) , 0.0051480 secs]2022-04-02T14:47:03.301+0800: 8.757: [weak refs processing, 0.0000350 secs]2022-04-02T14:47:03.301+0800: 8.757: [class unloading, 0.0057419 secs]2022-04-02T14:47:03.307+0800: 8.762: [scrub symbol table, 0.0091306 secs]2022-04-02T14:47:03.316+0800: 8.771: [scrub string table, 0.0007615 secs][1 CMS-remark: 12731K(40960K)] 23468K(59392K), 0.0210517 secs] [Times: user=0.02 sys=0.00, real=0.03 secs] 2022-04-02T14:47:03.319+0800: 8.775: [CMS-concurrent-sweep-start] 2022-04-02T14:47:03.325+0800: 8.781: [CMS-concurrent-sweep: 0.005/0.005 secs] [Times: user=0.02 sys=0.00, real=0.00 secs] 2022-04-02T14:47:03.325+0800: 8.781: [CMS-concurrent-reset-start] 2022-04-02T14:47:03.337+0800: 8.793: [CMS-concurrent-reset: 0.009/0.012 secs] [Times: user=0.01 sys=0.00, real=0.02 secs] 2022-04-02T14:47:03.375+0800: 8.830: [GC (Allocation Failure) 2022-04-02T14:47:03.375+0800: 8.830: [ParNew: 17422K->936K(18432K), 0.0059220 secs] 27539K->11054K(59392K), 0.0060044 secs] [Times: user=0.01 sys=0.00, real=0.01 secs] 2022-04-02T14:47:03.505+0800: 8.961: [GC (Allocation Failure) 2022-04-02T14:47:03.506+0800: 8.961: [ParNew: 17320K->1080K(18432K), 0.0043436 secs] 27438K->11197K(59392K), 0.0044290 secs] [Times: user=0.01 sys=0.00, real=0.01 secs] 2022-04-02T14:47:03.562+0800: 9.018: [GC (Allocation Failure) 2022-04-02T14:47:03.562+0800: 9.018: [ParNew: 17457K->1412K(18432K), 0.0029831 secs] 27575K->11529K(59392K), 0.0030792 secs] [Times: user=0.00 sys=0.00, real=0.00 secs] 2022-04-02T14:47:03.804+0800: 9.260: [GC (Allocation Failure) 2022-04-02T14:47:03.804+0800: 9.260: [ParNew: 17796K->1593K(18432K), 0.0056917 secs] 27913K->11941K(59392K), 0.0057847 secs] [Times: user=0.00 sys=0.00, real=0.01 secs] 2022-04-02T14:47:04.245+0800: 9.701: [GC (Allocation Failure) 2022-04-02T14:47:04.245+0800: 9.701: [ParNew: 17977K->1599K(18432K), 0.0071955 secs] 28325K->12439K(59392K), 0.0073038 secs] [Times: user=0.01 sys=0.00, real=0.01 secs] 2022-04-02T14:47:04.488+0800: 9.944: [GC (Allocation Failure) 2022-04-02T14:47:04.488+0800: 9.944: [ParNew: 17983K->1638K(18432K), 0.0069252 secs] 28823K->12834K(59392K), 0.0070427 secs] [Times: user=0.01 sys=0.00, real=0.00 secs] 2022-04-02T14:47:04.819+0800: 10.275: [GC (Allocation Failure) 2022-04-02T14:47:04.819+0800: 10.275: [ParNew: 18022K->1432K(18432K), 0.0082630 secs] 29218K->12933K(59392K), 0.0083677 secs] [Times: user=0.01 sys=0.00, real=0.01 secs]Command failed after 1 tries