📣 极限科技诚招搜索运维工程师(Elasticsearch/Easysearch)- 全职/北京 👉 : 立即申请加入

版本: 6.8-8.9

简而言之,当 Elasticsearch 尝试访问线程 CPU 时间时,但当前的 Java 开发工具包(JDK)版本不支持该功能时,就会出现此错误。这通常是由于使用了过时或不兼容的 JDK 版本导致的。要解决此问题,您可以升级到支持线程 CPU 时间的较新 JDK 版本。或者,如果线程 CPU 时间对您的操作并不关键,您可以在 Elasticsearch 设置中禁用线程 CPU 时间的使用。

日志上下文 #

日志"thread CPU time is not supported on this JDK"的类名是 HotThreads.java. 我们从 Elasticsearch 源代码中提取了以下内容,供那些寻求深入上下文的人参考:

}  String innerDetect(ThreadMXBean threadBean; SunThreadInfo sunThreadInfo; long currentThreadId; SleepFunctionthreadSleep)
 throws Exception {
 if (threadBean.isThreadCpuTimeSupported() == false) {
 throw new ElasticsearchException("thread CPU time is not supported on this JDK");
 }  if (type == ReportType.MEM && sunThreadInfo.isThreadAllocatedMemorySupported() == false) {
 throw new ElasticsearchException("thread allocated memory is not supported on this JDK");
 }