CREATE DATABASE IF NOT EXISTS orchestrator; CREATE USER 'orchestrator'@'127.0.0.1' IDENTIFIED BY 'orchestrator'; GRANT ALL PRIVILEGES ON `orchestrator`.* TO 'orchestrator'@'127.0.0.1';
这里元数据库MySQL和orchestrator在同一台机器上,所以创建账号的时候用的'127.0.0.1',如果不在同一台机器上,将IP换成orchestrator所在机器ip。
密码按需修改
tar -xvzf orchestrator-3.1.2-linux-amd64.tar.gz -C /
[root@10-10-30-150 orchestrator]# ls orchestrator orchestrator-sample-sqlite.conf.json orchestrator-sample.conf.json resources [root@10-10-30-150 orchestrator]# cp orchestrator-sample.conf.json /etc/orchestrator.conf.json
CREATE
USER
'orchestrator'@
'orch_host'
IDENTIFIED
BY
'orch_topology_password';
GRANT SUPER, PROCESS,
REPLICATION
SLAVE, RELOAD
ON *.*
TO
'orchestrator'@
'orch_host';
GRANT
SELECT
ON mysql.slave_master_info
TO
'orchestrator'@
'orch_host';
GRANT
SELECT
ON ndbinfo.processes
TO
'orchestrator'@
'orch_host';
-- Only for NDB Cluster其中,将'orch_host' 改成对应orch所在服务器的ip,'orch_topology_password'改成合适的密码。这里orch_host是10.10.30.%,将密码改为orchestrator。
/// 配置orchestrator后端元数据库信息 ... "MySQLOrchestratorHost": "127.0.0.1", "MySQLOrchestratorPort": 3306, "MySQLOrchestratorDatabase": "orchestrator", "MySQLOrchestratorUser": "orchestrator", "MySQLOrchestratorPassword": "orchestrator", ... /// 配置orchestrator监控的目标数据库信息 "MySQLTopologyUser": "orchestrator", "MySQLTopologyPassword": "orchestrator", ... /// 配置raft的相关参数 "RaftEnabled": true, "RaftDataDir": "/var/lib/orchestrator", "RaftBind": "10.10.30.150", #本机ip或者hostname "DefaultRaftPort": 10008, #raft端口 "RaftNodes": [ "10.10.30.150", "10.10.30.128", "10.10.30.145" ]
cd /usr/local/orchestrator && ./orchestrator --config=/etc/orchestrator.conf.json http > /usr/local/orchestrator/orchestrator.log 2>&1 &

这里假定环境:
10.10.30.170是从库
10.10.30.130是主库
如上图所示
3.1.2版本的orchestrator在通过从库10.10.30.170发现主库的时候,通过show slave status得到的master_host虽然是10.10.30.130,但是页面上显示的却是10.10.30.130这个ip对应的hostname:10-10-30-130,如下图所示:
因此,orchestrator会报10-10-30-130找不到:
2019-11-27 13:48:29 ERROR dial tcp: lookup 10-10-30-130 on 223.5.5.5:53: no such host
10.10.30.130 10-10-30-130 10.10.30.183 10-10-30-183 10.10.30.170 10-10-30-170
| 作者简介
韩杰 沃趣科技高级数据库工程师
专注MySQL数据库三年,精通MySQL体系结构,数据库优化,trouble shooting。服务过多家银行客户,熟悉银行业务及系统下数据库不同架构使用场景。熟悉MySQL主从复制原理,及应用的各种高可用场景。
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/28218939/viewspace-2670835/ ,如需转载,请注明出处,否则将追究法律责任。