9.1 运行和部署

Juno Agent管理了节点信息、注册信息、配置信息、探活信息、消息总线等功能。

9.1.1 部署Agent模式

我们有两种运行Juno-Agent的模式:Client模式和Server模式。

  • Client模式:该模式需要我们将Agent部署到每个应用的节点上,这样我们的Juno-Agent,可以获取更多应用的信息,例如机器上的启动信息,还可以执行HShell指令,帮助我们排查线上问题。
  • Server模式:该模式需要我们将多个Agent组成一个Server进行部署,虽然这种模式,有部分组件功能无法启用,但是这种模式下,我们可以更方便的部署我们的Agent,减少我们的运维成本。

9.1.2 运行一个Agent

Juno-Agent可以通过命令行启动。当Juno-Agent运行后,你可以看到以下输出

  1. (_)_ _ _ __ (_) |_ ___ _ __
  2. | | | | | '_ \| | __/ _ \ '__|
  3. | | |_| | |_) | | || __/ |
  4. _/ |\__,_| .__/|_|\__\___|_|
  5. |__/ |_|
  6. Welcome to jupiter, starting jupiter ...
  7. 1590412508 INFO load local file {"mod": "config", "addr": "./config/config-live.toml"}
  8. 1590412508 INFO auto max procs {"mod": "proc", "procs": 4}
  9. 1590412508 INFO plugin {"reportAgentStatus": "start"}
  10. 1590412508 INFO plugin {"process": "start"}
  11. 1590412508 INFO plugin {"appConf.etcd": "start"}
  12. 1590412508 INFO dial etcd server {"mod": "client.etcd", "addr": ["wsd-projecta-etcd-cc.pre.unp.oyw:2379"]}
  13. 1590412508 ERROR init get update error {"plugin": "confProxy", "msg": "key check: port empty", "hostKey": "/Juno-agent/ubuntu", "err": "key check: port empty"}
  14. 1590412508 ERROR init get update error {"plugin": "confProxy", "msg": "open /home/www/server: is a directory", "hostKey": "/Juno-agent/ubuntu", "err": "open /home/www/server: is a directory"}
  15. 1590412508 INFO dial etcd server {"mod": "client.etcd", "addr": ["wsd-projecta-etcd-rd.pre.unp.oyw:2379"]}
  16. 1590412508 INFO plugin {"supervisorScanner": "start"}
  17. 1590412508 ERROR fsnotify add dir err {"msg": "no such file or directory"}
  18. 1590412508 INFO plugin {"systemdScanner": "start"}
  19. 1590412508 ERROR SystemdScanner add dir err {"err": "no such file or directory"}
  20. 1590412508 INFO plugin {"healCheck": "start"}
  21. 1590412508 INFO start governor {"mod": "app", "addr": "http://127.0.0.1:9099"}
  22. 1590412508 INFO start servers {"mod": "app", "addr": "http://0.0.0.0:50000"}
  23. 1590412508 INFO start servers {"mod": "app", "addr": "grpc://0.0.0.0:50001"}
  24. 1590412508 INFO echo add route {"mod": "server.echo", "method": "POST", "path": "/api/v1/conf/command_line/status"}
  25. 1590412508 INFO echo add route {"mod": "server.echo", "method": "GET", "path": "/api/v1/agent/config"}
  26. 1590412508 INFO echo add route {"mod": "server.echo", "method": "GET", "path": "/api/agent/reload"}
  27. 1590412508 INFO echo add route {"mod": "server.echo", "method": "GET", "path": "/api/agent/process/status"}
  28. 1590412508 INFO echo add route {"mod": "server.echo", "method": "GET", "path": "/api/process/status"}
  29. 1590412508 INFO echo add route {"mod": "server.echo", "method": "POST", "path": "/api/agent/process/shell"}
  30. 1590412508 INFO echo add route {"mod": "server.echo", "method": "GET", "path": "/api/v1/agent/:target"}
  31. http server started on [::]:50000

以下为输出的描述:

  • Info: 输出Agent的基本信息。
  • Plugin: 输出Agent启动的组件
  • Server: 输出Agent提供的服务