首页 > 其他分享 >orchestrator安装部署(raft版本)

orchestrator安装部署(raft版本)

时间:2022-11-04 17:44:51浏览次数:42  
标签:orchestrator 64 192.168 1.100 MASTER 版本 mysql raft

环境
OS:Centos 7
mysql(5.7)主从:
192.168.1.100 hmaster 主
192.168.1.102 hslavea 从
192.168.1.103 hslaveb 从

192.168.1.104 orchestrator元数据使用的数据库

 

前提条件:部署好被管控的mysql主从

1.下载安装介质
下载地址:https://github.com/openark/orchestrator/releases,选择相应的版本
orchestrator-client-3.1.4-1.x86_64.rpm
orchestrator-3.1.4-1.x86_64.rpm

下面两个安装包需要自行下载
oniguruma-6.8.2-2.el7.x86_64.rpm
jq-1.6-2.el7.x86_64.rpm

 

2.安装在每个mysql服务器上都进行安装
rpm -ivh orchestrator-client-3.1.4-1.x86_64.rpm
rpm -ivh orchestrator-3.1.4-1.x86_64.rpm
rpm -ivh oniguruma-6.8.2-2.el7.x86_64.rpm
rpm -ivh jq-1.6-2.el7.x86_64.rpm

 

3.设置hostname
每台机器设置相应的hostname
hostnamectl set-hostname hmaster ##192.168.1.100
hostnamectl set-hostname hslavea ##192.168.1.102
hostnamectl set-hostname hslaveb ##192.168.1.103
hostnamectl set-hostname orcmgr ##192.168.1.104

 

4.设置hostname
每台机器设置hosts文件
vi /etc/hosts文件添加如下项目
192.168.1.100 hmaster
192.168.1.102 hslavea
192.168.1.103 hslaveb
192.168.1.104 orcmgr

 

5.orchestrator元数据使用的数据库安装
192.168.1.104上操作
安装mysql数据库步骤省略,然后需要创建元数据库和用户

[mysql@localhost bin]$ /opt/mysql57/bin/mysql -h localhost -uroot -p -S /opt/mysql57/mysql.sock
mysql>create database orchestrator;
mysql>create user 'orchestrator'@'%' identified by 'mysql';
mysql>grant all on orchestrator.* to 'orchestrator'@'%';

 

6.在主库上创建用户
192.168.1.100上操作

GRANT SELECT, RELOAD, PROCESS, SUPER, REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'orchestrator'@'%' identified by 'mysql';

创建后会自动同步到另外2个从库

 

7.编辑配置文件
在192.168.1.100上操作,然后拷贝到另外2个节点
拷贝一个模板的过来进行修改

[root@localhost orchestrator]# cd /usr/local/orchestrator/
[root@localhost orchestrator]# cp orchestrator-sample.conf.json orchestrator.conf.json
{
  "Debug": true,
  "EnableSyslog": false,
  "ListenAddress": ":3000",
  "MySQLTopologyUser": "orchestrator",
  "MySQLTopologyPassword": "mysql",
  "MySQLTopologyCredentialsConfigFile": "",
  "MySQLTopologySSLPrivateKeyFile": "",
  "MySQLTopologySSLCertFile": "",
  "MySQLTopologySSLCAFile": "",
  "MySQLTopologySSLSkipVerify": true,
  "MySQLTopologyUseMutualTLS": false,
  "MySQLOrchestratorHost": "192.168.1.104",
  "MySQLOrchestratorPort": 3306,
  "MySQLOrchestratorDatabase": "orchestrator",
  "MySQLOrchestratorUser": "orchestrator",
  "MySQLOrchestratorPassword": "mysql",
  "MySQLOrchestratorCredentialsConfigFile": "",
  "MySQLOrchestratorSSLPrivateKeyFile": "",
  "MySQLOrchestratorSSLCertFile": "",
  "MySQLOrchestratorSSLCAFile": "",
  "MySQLOrchestratorSSLSkipVerify": true,
  "MySQLOrchestratorUseMutualTLS": false,
  "MySQLConnectTimeoutSeconds": 1,
  "RaftEnabled": true,
  "RaftDataDir": "/data/orchestrator",
  "RaftBind": "192.168.1.100",
  "DefaultRaftPort": 10008,
  "RaftNodes": [
    "192.168.1.100",
    "192.168.1.102",
    "192.168.1.103"
  ],

 

模板默认是没有raft配置项的,需要自行加入

  "RaftEnabled": true,
  "RaftDataDir": "/data/orchestrator",
  "RaftBind": "192.168.1.100",
  "DefaultRaftPort": 10008,
  "RaftNodes": [
    "192.168.1.100",
    "192.168.1.102",
    "192.168.1.103"
  ],

 

需要创建目录(每个数据库节点都需要执行)
mkdir -p /data/orchestrator

 

8.拷贝配置文件到另外2个节点
scp /usr/local/orchestrator/orchestrator.conf.json [email protected]:/usr/local/orchestrator/
scp /usr/local/orchestrator/orchestrator.conf.json [email protected]:/usr/local/orchestrator/

拷贝过来修改的地方:
"RaftBind": "192.168.1.100" 这里分别修改更各自节点的ip

 

9.启动
每台机器都需要执行,也可以使用nohup后台执行
cd /usr/local/orchestrator
./orchestrator --config=./orchestrator.conf.json http

 

10.web访问
每个数据库节点都可以访问
http://192.168.1.100:3000
http://192.168.1.102:3000
http://192.168.1.103:3000

 

1.主从切换
orchestrator-client -c graceful-master-takeover -a hslavea:3306 -d hmaster:3306
新主库为:hmaster,但是hslavea不会自动成为新主库的从,需要手工指定后重启动

mysql> CHANGE MASTER TO MASTER_HOST='hmaster', 
              MASTER_PORT=3306,
              MASTER_USER='repl', 
              MASTER_PASSWORD='mysql', 
              MASTER_AUTO_POSITION=1,
              MASTER_CONNECT_RETRY=1, 
              MASTER_RETRY_COUNT=86400, 
              MASTER_HEARTBEAT_PERIOD=2;

mysql> start slave;

 

2.查看拓扑情况
[root@hmaster orchestrator]# orchestrator-client -c topology -i hmaster:3306
hmaster:3306 [0s,ok,5.7.29-log,rw,ROW,>>,GTID]
+ hslavea:3306 [0s,ok,5.7.29-log,ro,ROW,>>,GTID]
+ hslaveb:3306 [0s,ok,5.7.29-log,rw,ROW,>>,GTID]

 

-- The End--

 

标签:orchestrator,64,192.168,1.100,MASTER,版本,mysql,raft
From: https://www.cnblogs.com/hxlasky/p/16858590.html

相关文章

  • Unity + XLua + VS Code断点调试 之 luaPanda (免费版本调试)
    官方文档:https://github.com/Tencent/LuaPanda/blob/master/Docs/Manual/quick-use.md官方文档已经够详细了,我这里既不多说什么了,我就说说自己在弄这个luapanda遇到的问题,......
  • ObjectArx多版本编译
    您必须使用Microsoft®VisualStudio®2019版本16.7编译ObjectARX应用程序以在AutoCAD2022 中使用。AutoCAD2022面向.NETFramework4.8,这是Microsoft®VisualS......
  • mysql旧版本实现row_number
    mysql8.0已经有row_number了,但是很多同学用的还是老版本,当需要用到row_number的功能时,老版本也是有解决方案的。比如我们有一张表sync_task_log,有三个字段ds_id,state,sy......
  • Google 软件版本经历周期
    前言经常会看到依赖jar后缀一些alpha、release、rc、beta等,所代表的含义也很容易通过搜索引擎找到,以下就是通过搜索引擎找到的说明梳理。Jetpact库遵循​​严格的语义版本控......
  • linux 升级内核版本
    #安装最新的内核#我这里选择的是稳定版kernel-ml  如需更新长期维护版本kernel-lt yum --enablerepo=elrepo-kernel install kernel-ml#查看已安装那些内核r......
  • 如何下载火狐浏览器历史版本
    ​​http://ftp.mozilla.org/pub/firefox/releases/​​​​http://t.zoukankan.com/yczcc-p-9032860.html​​......
  • 278.第一个错误的版本
    你是产品经理,目前正在带领一个团队开发新的产品。不幸的是,你的产品的最新版本没有通过质量检测。由于每个版本都是基于之前的版本开发的,所以错误的版本之后的所有版本都是......
  • node node-sass npm 版本
    1、安装指定版本的nodenvminstall16.14.2安装完之后npm会自动变为8.5.0 2、安装完之后使用这个版本nvmuse16.14.2 3、node-sass和node版本对应关系可参照下面......
  • NCF(NeuCharFramework)框架的使用 当前所用框架版本(0.3.1-beta3)
    1、官网介绍:NCF-NeuCharFramework|NCF文档2、下载NCF框架代码:https://github.com/NeuCharFramework/NCF3、运行NCF框架用vs2022打开下载的NCF项目NCF\src\back-en......
  • 安装Mariadb-10.6.10 需要升级CMake 3.0 以上版本
    下载wgethttps://cmake.org/files/v3.22/cmake-3.22.6.tar.gz安装tarzxvfcmake-3.22.6.tar.gzcdcmake-3.22.6./bootstrapgmakegmakeinstall注意安装完后......