文档:
https://github.com/openark/orchestrator/tree/master/docs
参考:
https://www.cnblogs.com/zhoujinyi/p/10387581.html
https://www.cnblogs.com/zhoujinyi/p/10394389.html
https://ghostwritten.blog.csdn.net/article/details/106099648
下载地址:
https://github.com/openark/orchestrator/releases
例:
wget https://github.com/openark/orchestrator/releases/download/v3.2.4/orchestrator-3.2.4-1.x86_64.rpm
1.安装:将会安装至/usr/local/orchestrator/ 目录下
rpm -ivh orchestrator-3.2.4-1.x86_64.rpm
2.为后端设置一个MySQL服务器 我这里起了一个5000端口的数据库
3.创建数据库并授权:
CREATE DATABASE IF NOT EXISTS orchestrator;
CREATE USER 'orchestrator'@'127.0.0.1' IDENTIFIED BY 'orch_backend_password';
GRANT ALL PRIVILEGES ON `orchestrator`.* TO 'orchestrator'@'127.0.0.1';
编辑/usr/local/orchestrator/orchestrator.conf.json配置文件
…
“MySQLOrchestratorHost”: “127.0.0.1”,
“MySQLOrchestratorPort”: 5000,
“MySQLOrchestratorDatabase”: “orchestrator”,
“MySQLOrchestratorUser”: “orchestrator”,
“MySQLOrchestratorPassword”: “orch_backend_password”,
…
4.在需要监控的mysql实例赋权:
CREATE USER 'orchestrator'@'%' IDENTIFIED BY 'orch_topology_password';
GRANT SUPER, PROCESS, REPLICATION SLAVE, RELOAD,select ON *.* TO 'orchestrator'@'%';
5.编辑配置文件参数:
…
“MySQLTopologyUser”: “orchestrator”,
“MySQLTopologyPassword”: “orch_topology_password”,
…
6.其他配置:
“Debug”: false, --设置debug模式
“ListenAddress”: “:3000”, --http访问端口
“MySQLHostnameResolveMethod”: “@@hostname”:发出一个 select @@hostname --让orchestrator知道如何解析主机名。
高可用测试
配置三个节点
10.10.80.55
10.10.80.60
10.10.80.33
三台机器分别安装orchestrator 和 mariadb(5000端口)
修改配置:
数据库赋权和数据库相关配置见上文
高可用配置 RaftBind根据主机ip来修改:
“RaftEnabled”:true,
“BackendDB”: “mariadb”,
“RaftBind”:“10.10.80.55”,
“RaftDataDir”:"/var/lib/orchestrator",
“DefaultRaftPort”:10008,
“RaftNodes”:[
“10.10.80.33”,
“10.10.80.60”,
“10.10.80.55”
]
分别启动:
[root@slave1 /usr/local/orchestrator]# nohup ./orchestrator http &
[root@slave2 /usr/local/orchestrator]# nohup ./orchestrator http &
[root@slave3 /usr/local/orchestrator]# nohup ./orchestrator http &
在浏览器中访问:
http://10.10.80.60:3000/api/leader-check
返回"OK" 代表是主
返回"Not leader" 代表是从
http://10.10.80.60:3000/api/raft-health
返回"healthy" 代表正常工作
高可用配置下 关闭leader orchestrator 服务 leader自动切换到一个从上,旧leader重新启动后会变为从;