首页 > 其他分享 >orchestrator 中的 agent

orchestrator 中的 agent

时间:2023-06-23 17:23:32浏览次数:42  
标签:Orchestrator Get agent api mysql orchestrator

目录

Orchestrator是一个开源的MySQL高可用性解决方案,它可以自动化执行MySQL故障转移、主从切换、数据中心迁移等操作,同时提供了一个Web界面和API接口,方便运维人员进行MySQL集群管理和监控。

在Orchestrator 常用功能中,很少提及agent,实际上,Orchestrator 也有agent相关功能,并有一个独立的项目orchestrator-agent

Orchestrator 中的 agent 主要有以下功能:

  • 与 Orchestrator 服务端建立连接,接收来自服务端的指令并执行;
  • 支持通过 HTTP API 与 Orchestrator 服务端交互,如获取实例信息, 以及启动、停止 MySQL 实例等等操作;

在Orchestrator 中,通过配置项config.Config.ServeAgentsHttp 配置agent 相关功能是否开启,主要是http server。这个http server 默认监听端口3001,通过HTTP API agent 可以主动上报信息到 Orchestrator 服务端,例如,MySQL机器hostname等。

接下来,本文主要介绍 orchestrator-agent。

orchestrator-agent

orchestrator-agent是 Orchestrator 的子项目。

orchestrator-agent是一个运行在MySQL服务器上的进程,它可以通过与Orchestrator服务端的通信,将MySQL服务器的状态信息上报给Orchestrator服务端,从而实现MySQL集群的自动化管理和监控。同时,agent还可以执行一些MySQL操作,如启动、停止等操作,以及执行一些自定义的脚本。

Orchestrator和agent之间通过HTTP协议进行交互。当agent启动时,它会向Orchestrator服务器注册自己,并定期向Orchestrator发送MySQL实例的状态信息。在执行这些操作时,Orchestrator会向agent发送命令,agent会根据命令执行相应的操作,并将执行结果返回给Orchestrator。

orchestrator-agent端的http server ,默认监听3002端口。
主要http接口包括:

    m.Get("/api/hostname", this.Hostname)
    m.Get("/api/lvs", this.ListLogicalVolumes)
    m.Get("/api/lvs/:pattern", this.ListLogicalVolumes)
    m.Get("/api/lvs-snapshots", this.ListSnapshotsLogicalVolumes)
    m.Get("/api/lv", this.LogicalVolume)
    m.Get("/api/lv/:lv", this.LogicalVolume)
    m.Get("/api/mount", this.GetMount)
    m.Get("/api/mountlv", this.MountLV)
    m.Get("/api/removelv", this.RemoveLV)
    m.Get("/api/umount", this.Unmount)
    m.Get("/api/du", this.DiskUsage)
    m.Get("/api/mysql-du", this.MySQLDiskUsage)
    m.Get("/api/create-snapshot", this.CreateSnapshot)
    m.Get("/api/available-snapshots-local", this.AvailableLocalSnapshots)
    m.Get("/api/available-snapshots", this.AvailableSnapshots)
    m.Get("/api/mysql-error-log-tail", this.MySQLErrorLogTail)
    m.Get("/api/mysql-port", this.MySQLPort)
    m.Get("/api/mysql-status", this.MySQLRunning)
    m.Get("/api/mysql-stop", this.MySQLStop)
    m.Get("/api/mysql-start", this.MySQLStart)
    m.Get("/api/delete-mysql-datadir", this.DeleteMySQLDataDir)
    m.Get("/api/mysql-datadir-available-space", this.GetMySQLDataDirAvailableDiskSpace)
    m.Get("/api/post-copy", this.PostCopy)
    m.Get("/api/receive-mysql-seed-data/:seedId", this.ReceiveMySQLSeedData)
    m.Get("/api/send-mysql-seed-data/:targetHost/:seedId", this.SendMySQLSeedData)
    m.Get("/api/abort-seed/:seedId", this.AbortSeed)
    m.Get("/api/seed-command-completed/:seedId", this.SeedCommandCompleted)
    m.Get("/api/seed-command-succeeded/:seedId", this.SeedCommandSucceeded)
    m.Get("/api/mysql-relay-log-index-file", this.RelayLogIndexFile)
    m.Get("/api/mysql-relay-log-files", this.RelayLogFiles)
    m.Get("/api/mysql-relay-log-end-coordinates", this.RelayLogEndCoordinates)
    m.Get("/api/mysql-binlog-contents", this.BinlogContents)
    m.Get("/api/mysql-binlog-binary-contents", this.BinlogBinaryContents)
    m.Get("/api/mysql-relaylog-contents-tail/:relaylog/:start", this.RelaylogContentsTail)
    m.Post("/api/apply-relaylog-contents", this.ApplyRelaylogContents)
    m.Get("/api/custom-commands/:cmd", this.RunCommand)
    m.Get(config.Config.StatusEndpoint, this.Status)

从上面的http接口中可以看到,orchestrator-agent功能主要有
获取MySQL机器hostname,lvs相关操作,mount操作,mysql 启动、停止等操作,binlog、relay log 相关操作, 以及其他自定义的操作。

以上,本文介绍了 Orchestrator 中的agent的基本功能。

参考

orchestrator

orchestrator-agent

标签:Orchestrator,Get,agent,api,mysql,orchestrator
From: https://www.cnblogs.com/lanyangsh/p/17499384.html

相关文章

  • 3、【java程序运行监控byteman】Byteman脚本详解及javaagent和byteman结合使用详细示
    java程序运行监控byteman系列文章1、【java程序运行监控byteman】之安装部署和入门示例2、【java程序运行监控byteman】使用示例(运行中方法耗时监控、javaagent监控、jvm监控、规则的检查、是否运行以及查看等)3、【java程序运行监控byteman】Byteman脚本详解及javaagent和bytem......
  • 2、【java程序运行监控byteman】使用示例(运行中方法耗时监控、javaagent监控、jvm监控
    (文章目录)本文介绍了byteman的其他几种应用场景及示例,比如javaagent、监控jvm、bmjava命令、如何查看运行的规则、检查规则的正确性、检查规则是否在运行中等。本文分为2个部分,即运行中方法耗时监控和其他示例。一、统计方法耗时(程序运行中)该类是实时显示控制台输入的结果以......
  • [Selenium] 添加随机agent
    Agents=['(iPhone;U;CPUiPhoneOS4_1likeMacOSX;en-us)AppleWebKit/532.9(KHTML,likeGecko)Version/4.0.5Mobile/8B5097d','(WindowsNT5.1;U;en;rv:1.9.1.6)Gecko/20091201','(X11;U;Linuxx86_64;f......
  • zabbix agent系统时间晚于zabbix server系统时间
    zabbixweb-->“监测”-->“仪表盘”看到zabbixagent失效的报警 到zabbixagent确认:1.系统无异常2.系统未重启3.zabbix-agent服务正常4.zabbix-agent与zabbix-server之间的网络也正常 查看触发此报警的触发器,如果10分钟获取不到数据报zabbixagent失效上面的触......
  • Java Agent入门教程
    一、核心逻辑创建一个新的项目(or子module),然后我们新建一个SimpleAgent类:packagecom.raorao.text;importjava.lang.instrument.Instrumentation;/***@Description:启动类*@Author:cxw*@Date:2023/6/1214:18*@Version:1.0**/publicclassM......
  • 使用fake-useragent自动更换UserAgent
    安装:pipinstallfake-useragent使用:fromfake_useragentimportUserAgentif__name__=='__main__':agent__random=UserAgent().randomprint(str(agent__random))如果报错:fake_useragent.errors.FakeUserAgentError本地UserAgent和远程UserAgent不一致导致,同步一下......
  • User-Agent特征库
    User-Agent特征库爬行特征库(CRAWLERS)008ABACHOBotAccoona-AI-AgentAddSugarSpiderBotAnyApexBotArachmoB-l-i-t-z-B-O-TBaiduspiderBecomeBotBeslistBotBillyBobBotBimbotBingbotBlitzBOTboitho.com-dcboitho.com-robotbtbotCatchBotCerberianDrtrsCharlott......
  • Hugging News #0602: Transformers Agents 介绍、大语言模型排行榜发布!
    每一周,我们的同事都会向社区的成员们发布一些关于HuggingFace相关的更新,包括我们的产品和平台更新、社区活动、学习资源和内容更新、开源库和模型更新等,我们将其称之为「HuggingNews」,本期HuggingNews有哪些有趣的消息,快来看看吧!重磅更新TransformersAgents发布,通过自......
  • autogpt - agent
    目录导包__init__初始化方法start_interaction_loop方法1、初始化一些参数2、判断跳出循环的时机3、核心LLM调用函数4、将LLMresponse格式化为JSON5、遍历plugin进行LLMresponse的后处理6、打印assistant的thoughts解决报错6、打印assistant的thoughts7、记录对话周期信息和下一......
  • ubuntu22.04安装zabbix-agent2
    在库中https://repo.zabbix.com/zabbix/找到自己对应的zabbix的版本这里以6.2.4版本为例找到6.2版本的文件夹然后进入到对应的目录中https://repo.zabbix.com/zabbix/6.2/ubuntu/pool/main/z/zabbix-release/找到自己服务器的版本对应的版本我这里的服务器是22.04版本的......