*GreatSQL社区首创体例未经受权不得随便哄骗,转载请联络小编并说明起因。
0.绪论
1.更正解说
2.编译mysql-shell
2.1处境预备
2.2起头编译mysqlmysql-shell
2.3行使patchelf更正mysqlsh二进制文献
3.运转mysql-shellforGreatSQL
0.绪论由于GreatSQL8.0.25-16版本中引入MGR仲裁节点(投票节点,ARBITRATOR)特点,MySQL供给的mysql-shell没法鉴别该特点,是以供给mysql-shellforGreatSQL版本。
1.更正解说需求更正mysql-shell源码,增长对仲裁节点(投票节点)脚色典型的扶助,波及到两个文献:
mysqlshdk/libs/mysql/group_replication.hmysqlshdk/libs/mysql/group_replication.cc在Member_role目标中增长ARBITRATOR脚色典型便可。全面patch文献惟独35行,很容易:$catmysqlsh-for-greatsql-8.0.25-16.patchdiff--gita/mysqlshdk/libs/mysql/group_replication.ccb/mysqlshdk/libs/mysql/group_replication.ccindexef6a8e1b9..9edbab---a/mysqlshdk/libs/mysql/group_replication.cc+++b/mysqlshdk/libs/mysql/group_replication.cc
-,6+,8std::stringto_string(constMember_rolerole){return"PRIMARY";caseMember_role::SECONDARY:return"SECONDARY";+caseMember_role::ARBITRATOR:+return"ARBITRATOR";caseMember_role::NONE:return"NONE";}-,6+,8Member_roleto_member_role(conststd::stringrole){returnMember_role::PRIMARY;}elseif(shcore::str_casecmp("SECONDARY",role.c_str())==0){returnMember_role::SECONDARY;+}elseif(shcore::str_casecmp("ARBITRATOR",role.c_str())==0){+returnMember_role::ARBITRATOR;}elseif(role.empty()){returnMember_role::NONE;}else{diff--gita/mysqlshdk/libs/mysql/group_replication.hb/mysqlshdk/libs/mysql/group_replication.hindexce4b..1deae---a/mysqlshdk/libs/mysql/group_replication.h+++b/mysqlshdk/libs/mysql/group_replication.h-73,7+73,7enumclassMember_state{MISSING};-enumclassMember_role{PRIMARY,SECONDARY,NONE};+enumclassMember_role{PRIMARY,SECONDARY,ARBITRATOR,NONE};enumclassTopology_mode{SINGLE_PRIMARY,MULTI_PRIMARY,NONE};2.编译mysql-shell从MySQL