• xxl-job不停刷日志导致磁盘很快就满


    关注 码龄 粉丝数 原力等级 -- 被采纳 被点赞 采纳率 ???jier? 2024-04-17 20:03 采纳率: 0% 浏览 7 首页/ 编程语言 / xxl-job不停刷日志导致磁盘很快就满 java xxljob调度器执行错误任务之后 修改错误再启动jar包时一直循环打印日志输出:调度失败,在调度中心打印了,sql报错日志。经修复之后。中心还在打印错误日志于是中心重启,还是在打印旧调度的报错。调度中心服务器重启之后,再起调度中心。还是疯狂打印旧代码的报错于是把执行器都改名,再起调度中心。还是疯狂打印旧代码的报错调度中心日志疯狂在刷,磁盘很快就满。伤心~~代码都改了,还是报同一行错,怎么办?错误: 19:39:58.692 logback [http-nio-7878-exec-10] ERROR c.x.job.admin.core.util.JacksonUtil - Unexpected character ('Z' (code 90)): was expecting comma to separate Object entries at [Source: (String)"[{"logId":"1780446084784476164","logDateTim":1713326400359,"executeResult":{"code":500,"msg":"java.util.concurrent.ExecutionException: java.lang.reflect.InvocationTargetException\n\tat java.util.concurrent.FutureTask.report(FutureTask.java:122)\n\tat java.util.concurrent.FutureTask.get(FutureTask.java:206)\n\tat com.xxl.job.core.thread.JobThread.run(JobThread.java:140)\nCaused by: java.lang.reflect.InvocationTargetException\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\tat "[truncated 7090 chars]; line: 1, column: 94] (through reference chain: java.util.ArrayList[0]->com.xxl.job.core.biz.model.HandleCallbackParam["executeResult"]) com.fasterxml.jackson.databind.JsonMappingException: Unexpected character ('Z' (code 90)): was expecting comma to separate Object entries at [Source: (String)"[{"logId":"1780446084784476164","logDateTim":1713326400359,"executeResult":{"code":500,"msg":"java.util.concurrent.ExecutionException: java.lang.reflect.InvocationTargetException\n\tat java.util.concurrent.FutureTask.report(FutureTask.java:122)\n\tat java.util.concurrent.FutureTask.get(FutureTask.java:206)\n\tat com.xxl.job.core.thread.JobThread.run(JobThread.java:140)\nCaused by: java.lang.reflect.InvocationTargetException\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\tat "[truncated 7090 chars]; line: 1, column: 94] (through reference chain: java.util.ArrayList[0]->com.xxl.job.core.biz.model.HandleCallbackParam["executeResult"]) at com.fasterxml.jackson.databind.JsonMappingException.wrapWithPath(JsonMappingException.java:394) at com.fasterxml.jackson.databind.JsonMappingException.wrapWithPath(JsonMappingException.java:353) at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.wrapAndThrow(BeanDeserializerBase.java:1711) at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:290) at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151) at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:286) at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:245) at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:27) at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4014) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3043) at com.xxl.job.admin.core.util.JacksonUtil.readValue(JacksonUtil.java:82) at com.xxl.job.admin.controller.JobApiController.parseParam(JobApiController.java:53) at com.xxl.job.admin.controller.JobApiController.callback(JobApiController.java:80) at sun.reflect.GeneratedMethodAccessor67.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:892) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:797) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1039) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1005) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:908) at javax.servlet.http.HttpServlet.service(HttpServlet.java:660) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:882) at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.boot.actuate.web.trace.servlet.HttpTraceFilter.doFilterInternal(HttpTraceFilter.java:88) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:118) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:118) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:92) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:118) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:93) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:118) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.filterAndRecordMetrics(WebMvcMetricsFilter.java:114) at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:104) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:118) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:118) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:526) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:860) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1587) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:750) 服务器日志一直不停往服务器刷日志 两分钟一个G 应该怎么解决 展开全部 收起 写回答 好问题 0 提建议 追加酬金 关注问题 微信扫一扫 点击复制链接 分享 邀请回答 编辑 收藏 删除 结题 收藏 举报 追加酬金 (90%的用户在追加酬金后获得了解决方案) 当前问题酬金 ¥ 0 (可追加 ¥500) ¥ 15¥ 20¥ 50¥ 100¥ 200 支付方式 扫码支付 二维码出错 点击刷新 支付金额 15 元 提供问题酬金的用户不参与问题酬金结算和分配 支付即为同意 《付费问题酬金结算规则》 结题 再想想 删除 再等等

    2条回答 默认 最新

    • 码农阿豪 Java领域优质创作者 2024-04-17 20:24
      关注
      让阿豪来帮你解答,本回答参考chatgpt3.5编写提供,如果还有疑问可以评论或留言
      问题描述: 在xxljob调度器执行错误任务之后,修改错误再启动jar包时,出现了循环打印日志输出的问题。调度中心服务器重启之后,再次起调度中心,仍然不停地打印旧调度的报错信息,而且日志一直在刷,导致磁盘很快就满了。即使尝试将执行器改名后再起调度中心,问题仍然存在。即使代码已经全部改了,仍然会出现同一行错的情况。 问题原因: 这个问题是由于xxljob调度器在报错后,会将错误信息保存在job_logs表中,并不断重试执行失败的任务,直到调用成功或者超过重试次数。因此,即使修复了错误,调度器仍然会不停地重试旧调度,导致疯狂打印旧代码的报错信息。 解决方法: 1、如果只是想要停止调度器的重试任务,可以在job_info表中将需要停止的任务的status字段改为1(1代表暂停状态),或者在调度中心网页端手动停止任务。 2、如果想要清空job_logs表中的历史记录,可以直接在数据库中删除job_logs表中相关的错误记录。 3、如果想要完全清除调度器的错误状态,可以将调度器整个重置,并重新启动。具体操作方法是:(1)在调度器配置文件(job-admin.properties)中将xxl.job.admin.addresses和xxl.job.executor.address字段修改为新的地址;(2)在执行器配置文件(job-conf.properties)中将xxl.job.admin.address字段修改为新的地址;(3)将重新编译的执行器jar包放到执行器服务器上,并启动执行器;(4)将调度中心服务器的/tmp/jobhandler/目录清空,并重新启动调度中心。 案例代码: 停止任务的示例代码: // 将任务暂停 XxlJobInfo jobInfo = new XxlJobInfo(); jobInfo.setId(123); jobInfo.setStatus(1); xxlJobAdminService.update(jobInfo); 删除job_logs表中记录的示例代码: // 清空job_logs表中的所有记录 xxlJobAdminDao.clearJobLog("all"); 或 // 清空指定任务的日志记录 xxlJobAdminDao.clearJobLog(jobId); 重置调度器的示例代码: // 修改调度中心的地址 XxlJobAdminConfig adminConfig = new XxlJobAdminConfig(); adminConfig.setAddresses("http://newAdminAddress:8090/xxl-job-admin"); xxlJobAdminService.updateAdminConfig(adminConfig); // 修改执行器的地址 XxlJobExecutorConfig executorConfig = new XxlJobExecutorConfig(); executorConfig.setAdminAddresses("http://newAdminAddress:8090/xxl-job-admin"); xxlJobExecutorService.updateExecutorConfig(executorConfig); // 清空调度中心的/tmp/jobhandler/目录 File jobHandlerDir = new File("/tmp/jobhandler/"); FileUtils.deleteDirectory(jobHandlerDir); // 启动执行器和调度中心 startExecutor(); startAdmin();
      评论
    • 夜郎king 2022博客之星IT其它领域TOP 12 2024-04-18 08:43
      关注

      可以在日志中配置日志不输出,实际在生产的时候,不需要那么多的日志输出。开发或者调试阶段单独打开就好。

      评论
    编辑
    预览

    报告相同问题?

  • 相关阅读:
    多线程(一)——委托与多线程
    汇编语言入门学习(有栈协程铺垫,32位寄存器,未完待续06/28)
    MFC中对编码文件的操作01
    webWorker
    Dockerfile详解与实践
    【Linux】VMware下载和安装
    计算机毕业设计之java+ssm基于web的校园短期闲置资源置换平台
    第三章搜索与图论(一)
    Linux操作系统3:Linux常用命令
    【springboot+vue项目(十四)】基于Oauth2的SSO单点登录(一)整体流程介绍
  • 原文地址:https://ask.csdn.net/questions/8090221