chaosblade-io / chaosblade-box

chaos-platform
216 stars 98 forks source link

内网自动和手动安装agent失败 #35

Closed zxh19920616 closed 2 years ago

zxh19920616 commented 3 years ago

内网搭建了一个http服务器,上面放了需要下载的文件,修改了代码和配置文件相关url,结果无论是手动还是自动安装都失败,手动安装命令如下: wget http://xxxxxx/chaosagentctl.sh -O chaosagentctl.sh && chmod +x chaosagentctl.sh && ./chaosagentctl.sh install -r http://xxxxxx/chaosagent -t 127.0.0.1:8080 报错如下: 2021-04-01 17:11:04 [INFO] [-rm f] /var/run/chaosagent.pid 2021-04-01 17:11:04 [INFO] [+stop] chaosagent is stopped. 2021-04-01 17:11:04 [INFO] [+downloading] chaosagent to [/opt/chaos/chaosagent] 2021-04-01 17:11:04 [INFO] [+saved] chaosagent to [/opt/chaos/chaosagent] 2021-04-01 17:11:04 [INFO] [+starting] chaosagent is starting... 2021-04-01 17:11:05 [WARN] start failed ./chaosagentctl.sh: line 69: exit: 2021-04-01 17:11:05 [WARN] [start] failed:time="2021-04-01T17:06:43+08:00" level=info msg="Init config completed" time="2021-04-01T17:06:43+08:00" level=warning msg="Connection to server failed, err: connect server failed, " time="2021-04-01T17:06:43+08:00" level=warning msg="start chaos failed because of connect server failed, " time="2021-04-01T17:06:43+08:00" level=error msg="chaos agent will exit" time="2021-04-01T17:09:36+08:00" level=info msg="Init config completed" time="2021-04-01T17:09:36+08:00" level=warning msg="Connection to server failed, err: connect server failed, " time="2021-04-01T17:09:36+08:00" level=warning msg="start chaos failed because of connect server failed, " time="2021-04-01T17:09:36+08:00" level=error msg="chaos agent will exit" time="2021-04-01T17:11:04+08:00" level=info msg="Init config completed" time="2021-04-01T17:11:04+08:00" level=warning msg="Connection to server failed, err: connect server failed, " time="2021-04-01T17:11:04+08:00" level=warning msg="start chaos failed because of connect server failed, " time="2021-04-01T17:11:04+08:00" level=error msg="chaos agent will exit"

tiny-x commented 3 years ago

-t 的参数值是控制台的地址,确认控制台是否启动成功。 -t parameter value is the address of the console, confirm whether the console started successfully.

fanglixuezi commented 3 years ago

内网搭建了一个http服务器,上面放了需要下载的文件,修改了代码和配置文件相关url,结果无论是手动还是自动安装都失败,手动安装命令如下: wget http://xxxxxx/chaosagentctl.sh -O chaosagentctl.sh && chmod +x chaosagentctl.sh && ./chaosagentctl.sh install -r http://xxxxxx/chaosagent -t 127.0.0.1:8080 报错如下: 2021-04-01 17:11:04 [INFO] [-rm f] /var/run/chaosagent.pid 2021-04-01 17:11:04 [INFO] [+stop] chaosagent is stopped. 2021-04-01 17:11:04 [INFO] [+downloading] chaosagent to [/opt/chaos/chaosagent] 2021-04-01 17:11:04 [INFO] [+saved] chaosagent to [/opt/chaos/chaosagent] 2021-04-01 17:11:04 [INFO] [+starting] chaosagent is starting... 2021-04-01 17:11:05 [WARN] start failed ./chaosagentctl.sh: line 69: exit: 2021-04-01 17:11:05 [WARN] [start] failed:time="2021-04-01T17:06:43+08:00" level=info msg="Init config completed" time="2021-04-01T17:06:43+08:00" level=warning msg="Connection to server failed, err: connect server failed, " time="2021-04-01T17:06:43+08:00" level=warning msg="start chaos failed because of connect server failed, " time="2021-04-01T17:06:43+08:00" level=error msg="chaos agent will exit" time="2021-04-01T17:09:36+08:00" level=info msg="Init config completed" time="2021-04-01T17:09:36+08:00" level=warning msg="Connection to server failed, err: connect server failed, " time="2021-04-01T17:09:36+08:00" level=warning msg="start chaos failed because of connect server failed, " time="2021-04-01T17:09:36+08:00" level=error msg="chaos agent will exit" time="2021-04-01T17:11:04+08:00" level=info msg="Init config completed" time="2021-04-01T17:11:04+08:00" level=warning msg="Connection to server failed, err: connect server failed, " time="2021-04-01T17:11:04+08:00" level=warning msg="start chaos failed because of connect server failed, " time="2021-04-01T17:11:04+08:00" level=error msg="chaos agent will exit"

请问您最后手动装chaosagent成功了吗? 需要如何改shell脚本啊? 本人对混动工程很感兴趣,之前一直使用chaosblade工具 才发现有开源这个平台,希望能和您多沟通一下呀~

zxh19920616 commented 3 years ago

内网搭建了一个http服务器,上面放了需要下载的文件,修改了代码和配置文件相关url,结果无论是手动还是自动安装都失败,手动安装命令如下: wget http://xxxxxx/chaosagentctl.sh -O chaosagentctl.sh && chmod +x chaosagentctl.sh && ./chaosagentctl.sh install -r http://xxxxxx/chaosagent -t 127.0.0.1:8080 报错如下: 2021-04-01 17:11:04 [INFO] [-rm f] /var/run/chaosagent.pid 2021-04-01 17:11:04 [INFO] [+stop] chaosagent is stopped. 2021-04-01 17:11:04 [INFO] [+downloading] chaosagent to [/opt/chaos/chaosagent] 2021-04-01 17:11:04 [INFO] [+saved] chaosagent to [/opt/chaos/chaosagent] 2021-04-01 17:11:04 [INFO] [+starting] chaosagent is starting... 2021-04-01 17:11:05 [WARN] start failed ./chaosagentctl.sh: line 69: exit: 2021-04-01 17:11:05 [WARN] [start] failed:time="2021-04-01T17:06:43+08:00" level=info msg="Init config completed" time="2021-04-01T17:06:43+08:00" level=warning msg="Connection to server failed, err: connect server failed, " time="2021-04-01T17:06:43+08:00" level=warning msg="start chaos failed because of connect server failed, " time="2021-04-01T17:06:43+08:00" level=error msg="chaos agent will exit" time="2021-04-01T17:09:36+08:00" level=info msg="Init config completed" time="2021-04-01T17:09:36+08:00" level=warning msg="Connection to server failed, err: connect server failed, " time="2021-04-01T17:09:36+08:00" level=warning msg="start chaos failed because of connect server failed, " time="2021-04-01T17:09:36+08:00" level=error msg="chaos agent will exit" time="2021-04-01T17:11:04+08:00" level=info msg="Init config completed" time="2021-04-01T17:11:04+08:00" level=warning msg="Connection to server failed, err: connect server failed, " time="2021-04-01T17:11:04+08:00" level=warning msg="start chaos failed because of connect server failed, " time="2021-04-01T17:11:04+08:00" level=error msg="chaos agent will exit"

请问您最后手动装chaosagent成功了吗? 需要如何改shell脚本啊? 本人对混动工程很感兴趣,之前一直使用chaosblade工具 才发现有开源这个平台,希望能和您多沟通一下呀~

成功了,就把脚本里url改成自己搭建的文件服务器地址

fanglixuezi commented 3 years ago

内网搭建了一个http服务器,上面放了需要下载的文件,修改了代码和配置文件相关url,结果无论是手动还是自动安装都失败,手动安装命令如下: wget http://xxxxxx/chaosagentctl.sh -O chaosagentctl.sh && chmod +x chaosagentctl.sh && ./chaosagentctl.sh install -r http://xxxxxx/chaosagent -t 127.0.0.1:8080 报错如下: 2021-04-01 17:11:04 [INFO] [-rm f] /var/run/chaosagent.pid 2021-04-01 17:11:04 [INFO] [+stop] chaosagent is stopped. 2021-04-01 17:11:04 [INFO] [+downloading] chaosagent to [/opt/chaos/chaosagent] 2021-04-01 17:11:04 [INFO] [+saved] chaosagent to [/opt/chaos/chaosagent] 2021-04-01 17:11:04 [INFO] [+starting] chaosagent is starting... 2021-04-01 17:11:05 [WARN] start failed ./chaosagentctl.sh: line 69: exit: 2021-04-01 17:11:05 [WARN] [start] failed:time="2021-04-01T17:06:43+08:00" level=info msg="Init config completed" time="2021-04-01T17:06:43+08:00" level=warning msg="Connection to server failed, err: connect server failed, " time="2021-04-01T17:06:43+08:00" level=warning msg="start chaos failed because of connect server failed, " time="2021-04-01T17:06:43+08:00" level=error msg="chaos agent will exit" time="2021-04-01T17:09:36+08:00" level=info msg="Init config completed" time="2021-04-01T17:09:36+08:00" level=warning msg="Connection to server failed, err: connect server failed, " time="2021-04-01T17:09:36+08:00" level=warning msg="start chaos failed because of connect server failed, " time="2021-04-01T17:09:36+08:00" level=error msg="chaos agent will exit" time="2021-04-01T17:11:04+08:00" level=info msg="Init config completed" time="2021-04-01T17:11:04+08:00" level=warning msg="Connection to server failed, err: connect server failed, " time="2021-04-01T17:11:04+08:00" level=warning msg="start chaos failed because of connect server failed, " time="2021-04-01T17:11:04+08:00" level=error msg="chaos agent will exit"

请问您最后手动装chaosagent成功了吗? 需要如何改shell脚本啊? 本人对混动工程很感兴趣,之前一直使用chaosblade工具 才发现有开源这个平台,希望能和您多沟通一下呀~

成功了,就把脚本里url改成自己搭建的文件服务器地址

请问chaosagentctl.sh脚本实怎么修改的呀? 看里面的insatll过程,在安装的时候只有下载和解压的过程 个人理解sh文件是安装chaosblade的脚本 请问是如何进行探针的安装的呀? 我应该如何改这个脚本从而安装chaosagent啊?

如果方便的话 可以加一下我嘛~~ 13011105988(tel同vx) 好想与您探讨一下呀~~~谢谢呀!!!

DamonLin1992 commented 3 years ago

我也遇到类似问题了,现在是手动安装探针报错: time="2021-10-25T10:57:45+08:00" level=info msg="Init config completed" time="2021-10-25T10:57:45+08:00" level=warning msg="Connection to server failed, err: connect server failed, " time="2021-10-25T10:57:45+08:00" level=warning msg="start chaos failed because of connect server failed, " time="2021-10-25T10:57:45+08:00" level=error msg="chaos agent will exit" ssh安装探针也报错了: Connection refused (Connection refused) #测试了一下,ssh是可以过去的 控制台会出现报错:

2021-10-25 11:24:33.864, ERROR, [http-nio-8080-exec-4] com.alibaba.chaosblade.box.toolsmgr.ssh.SSHChaosToolsMgr - Connection refused (Connection refused) java.net.ConnectException: Connection refused (Connection refused) at java.base/java.net.PlainSocketImpl.socketConnect(Native Method) at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:399) at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:242) at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:224) at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.base/java.net.Socket.connect(Socket.java:609) at ch.ethz.ssh2.transport.ClientTransportManager.connect(ClientTransportManager.java:62) at ch.ethz.ssh2.transport.ClientTransportManager.connect(ClientTransportManager.java:34) at ch.ethz.ssh2.Connection.connect(Connection.java:754) at ch.ethz.ssh2.Connection.connect(Connection.java:628) at com.alibaba.chaosblade.box.toolsmgr.ssh.SSHChaosToolsMgr.getStringResponse(SSHChaosToolsMgr.java:100) at com.alibaba.chaosblade.box.toolsmgr.ssh.SSHChaosToolsMgr.deployAgent(SSHChaosToolsMgr.java:64) at com.alibaba.chaosblade.box.toolsmgr.ssh.SSHChaosToolsMgr.deployAgent(SSHChaosToolsMgr.java:43) at com.alibaba.chaosblade.box.toolsmgr.api.ChaosToolsMgrStrategyContext.deployAgent(ChaosToolsMgrStrategyContext.java:61) at com.alibaba.chaosblade.box.service.probes.ProbesServiceImpl.installProbe(ProbesServiceImpl.java:406) at com.alibaba.chaosblade.box.service.probes.ProbesServiceImpl$$FastClassBySpringCGLIB$$6590699a.invoke() at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:684) at com.alibaba.chaosblade.box.service.probes.ProbesServiceImpl$$EnhancerBySpringCGLIB$$19f8c60d.installProbe() at com.alibaba.chaosblade.box.web.controller.ProbesController.installProbe(ProbesController.java:72) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) 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.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:109) 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:109) 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:109) 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:109) 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:490) 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:853) 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.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.base/java.lang.Thread.run(Thread.java:829) 2021-10-25 11:24:33.870, INFO , [http-nio-8080-exec-4] com.alibaba.chaosblade.box.web.advice.TraceAdvice - [Response], request id: 1ee1fba8a3d34847b35573a465718ac7, body: {"code":6000,"message":"Connection refused (Connection refused)","success":false,"requestId":"1ee1fba8a3d34847b35573a465718ac7"}

engly0 commented 2 years ago

我这是因为chaosblade-box有报错,我的mysql停掉了,脚本目前已跑通,没有问题