我的环境是用docker 一个是canal-server 容器,一个是canal-admin容器。使用是的Canal+Rocketmq来进行通信。用的版本号是1.1.5。不清楚为什么canal-admin启动成功之后,会过一段时间就停止了。查看日志都找不到,后来试一下修改mysql的监听的表。发现就算canal-admin停止了。也可以传信息给Rocketmq。所以可能是canal-admin挂了。那么可能是内存不足,所以我就去查看内存发现,还很正常 过一段时间,我在去看发现增加了。
这个是其中的一段时间 CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS b9f5eda7385d canal-admin 0.15% 803.2MiB / 1GiB 53.52% 21.6MB / 9.06MB 38.8MB / 16.4kB 118 在过一段时间
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS b9f5eda7385d canal-admin 0.21% 803.2MiB / 1GiB 79.21% 21.6MB / 9.06MB 38.8MB / 16.4kB 118
在过一段时间 CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS b9f5eda7385d canal-admin 0.23% 829.5MiB / 1GiB 81.01% 22.5MB / 9.45MB 38.8MB / 16.4kB 118
canal-admin上的日志没有显示问题 如下 2022-02-09 13:33:27.817 [main] INFO o.s.w.s.m.method.annotation.RequestMappingHandlerMapping - Mapped "{[/api/{env}/nodeServer/stop/{id}],methods=[PUT]}" onto public com.alibaba.otter.canal.admin.model.BaseModel<java.lang.Boolean> com.alibaba.otter.canal.admin.controller.NodeServerController.stop(java.lang.Long,java.lang.String) 2022-02-09 13:33:27.817 [main] INFO o.s.w.s.m.method.annotation.RequestMappingHandlerMapping - Mapped "{[/api/{env}/nodeServer],methods=[POST]}" onto public com.alibaba.otter.canal.admin.model.BaseModel<java.lang.String> com.alibaba.otter.canal.admin.controller.NodeServerController.save(com.alibaba.otter.canal.admin.model.NodeServer,java.lang.String) 2022-02-09 13:33:27.817 [main] INFO o.s.w.s.m.method.annotation.RequestMappingHandlerMapping - Mapped "{[/api/{env}/nodeServer/status],methods=[GET]}" onto public com.alibaba.otter.canal.admin.model.BaseModel<java.lang.Integer> com.alibaba.otter.canal.admin.controller.NodeServerController.status(java.lang.String,java.lang.Integer,java.lang.String) 2022-02-09 13:33:27.818 [main] INFO o.s.w.s.m.method.annotation.RequestMappingHandlerMapping - Mapped "{[/api/{env}/nodeServers],methods=[GET]}" onto public com.alibaba.otter.canal.admin.model.BaseModel<com.alibaba.otter.canal.admin.model.Pager<com.alibaba.otter.canal.admin.model.NodeServer>> com.alibaba.otter.canal.admin.controller.NodeServerController.nodeServers(com.alibaba.otter.canal.admin.model.NodeServer,com.alibaba.otter.canal.admin.model.Pager<com.alibaba.otter.canal.admin.model.NodeServer>,java.lang.String) 2022-02-09 13:33:27.820 [main] INFO o.s.w.s.m.method.annotation.RequestMappingHandlerMapping - Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.error(javax.servlet.http.HttpServletRequest) 2022-02-09 13:33:27.821 [main] INFO o.s.w.s.m.method.annotation.RequestMappingHandlerMapping - Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse) 2022-02-09 13:33:27.850 [main] INFO o.s.web.servlet.handler.SimpleUrlHandlerMapping - Mapped URL path [/webjars/] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler] 2022-02-09 13:33:27.851 [main] INFO o.s.web.servlet.handler.SimpleUrlHandlerMapping - Mapped URL path [/] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler] 2022-02-09 13:33:27.866 [main] INFO o.s.w.s.m.m.annotation.ExceptionHandlerExceptionResolver - Detected @ExceptionHandler methods in customExceptionHandler 2022-02-09 13:33:27.900 [main] INFO o.s.b.a.web.servlet.WelcomePageHandlerMapping - Adding welcome page: class path resource [public/index.html] 2022-02-09 13:33:28.161 [main] INFO o.s.jmx.export.annotation.AnnotationMBeanExporter - Registering beans for JMX exposure on startup 2022-02-09 13:33:28.163 [main] INFO o.s.jmx.export.annotation.AnnotationMBeanExporter - Bean with name 'dataSource' has been autodetected for JMX exposure 2022-02-09 13:33:28.170 [main] INFO o.s.jmx.export.annotation.AnnotationMBeanExporter - Located MBean 'dataSource': registering with JMX server as MBean [com.zaxxer.hikari:name=dataSource,type=HikariDataSource] 2022-02-09 13:33:28.185 [main] INFO org.apache.coyote.http11.Http11NioProtocol - Starting ProtocolHandler ["http-nio-12089"] 2022-02-09 13:33:28.191 [main] INFO org.apache.tomcat.util.net.NioSelectorPool - Using a shared selector for servlet write/read 2022-02-09 13:33:28.214 [main] INFO o.s.boot.web.embedded.tomcat.TomcatWebServer - Tomcat started on port(s): 12089 (http) with context path '' 2022-02-09 13:33:28.222 [main] INFO com.alibaba.otter.canal.admin.CanalAdminApplication - Started CanalAdminApplication in 4.492 seconds (JVM running for 5.311) 2022-02-09 13:33:29.327 [http-nio-12089-exec-3] INFO o.a.catalina.core.ContainerBase.[Tomcat].[localhost].[/] - Initializing Spring FrameworkServlet 'dispatcherServlet' 2022-02-09 13:33:29.327 [http-nio-12089-exec-3] INFO org.springframework.web.servlet.DispatcherServlet - FrameworkServlet 'dispatcherServlet': initialization started 2022-02-09 13:33:29.350 [http-nio-12089-exec-3] INFO org.springframework.web.servlet.DispatcherServlet - FrameworkServlet 'dispatcherServlet': initialization completed in 23 ms 是我哪里没有配置清楚吗
原提问者GitHub用户2594636985
我在去查看一下。最终明白为什么会用一段时间就会关闭,原来是因为Docker内部的启动脚本的JVM内存分配是2G 以上,而官方提供的run_admin.sh脚本里面给DOCKER是1G。所以内存直接不够。所以我就进入docker 容器的内部,修改startup.sh的脚本,把配置的内存修改为1G。等过一个晚上发现好像可以了。
原回答者GitHub用户agapple2594636985
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。