InnoDB Cluster添加节点报错:ERROR: RuntimeError: Authentication error during connection check
  yd2rX1n7Kvhq 2023年12月02日 30 0

背景

近期在做InnoDB Cluster的压测,期间想偷个懒,直接克隆了一台虚拟机,想拿来直接做集群的一个新节点 虚拟机克隆出来之后,执行了以下操作

  • 更改了IP地址和主机名
  • 删除了datadir下的auto.cnf文件
  • 更改了my.cnf中的server_id然后启动数据库
  • 并将新的IP地址和主机名对应关系加入到了/etc/hosts

但是在添加节点时一直报错

报错信息

通过MySQL Shell添加实例时提示:

JS >cluster.addInstance("test20231201:3306")

WARNING: A GTID set check of the MySQL instance at 'test20231201:3306' determined that it contains transactions that do not originate from the cluster, which must be discarded before it can join the cluster.

test20231201:3306 has the following errant GTIDs that do not exist in the cluster:
9c55f128-8f31-11ee-8f22-fa163e2b3e11:1

WARNING: Discarding these extra GTID events can either be done manually or by completely overwriting the state of test20231201:3306 with a physical snapshot from an existing cluster member. To use this method by default, set the 'recoveryMethod' option to 'clone'.

Having extra GTID events is not expected, and it is recommended to investigate this further and ensure that the data can be removed prior to choosing the clone recovery method.

Please select a recovery method [C]lone/[A]bort (default Abort): C
Validating instance configuration at test20231201:3306...

This instance reports its own address as test20231201:3306

Instance configuration is suitable.
NOTE: Group Replication will communicate with other members using 'test20231201:3306'. Use the localAddress option to override.

* Checking connectivity and SSL configuration...
ERROR: RuntimeError: Authentication error during connection check
Cluster.addInstance: Authentication error during connection check (RuntimeError)

新机器的错误日志:

rce_bind=''. New state source_host='gxjtest20231130', source_port= 3306, source_log_file='', source_log_pos= 4, source_bind=''.
2023-12-01T14:17:49.036551+08:00 243 [Warning] [MY-010897] [Repl] Storing MySQL user name or password information in the connection metadata repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START REPLICA; see the 'START REPLICA Syntax' in the MySQL Manual for more information.
2023-12-01T14:17:49.042996+08:00 243 [ERROR] [MY-013117] [Repl] Replica I/O for channel 'mysqlsh.test': Fatal error: The replica I/O thread stops because source and replica have equal MySQL server ids; these ids must be different for replication to work (or the --replicate-same-server-id option must be used on replica but this does not always make sense; please check the manual before using it). Error_code: MY-013117
2023-12-01T14:17:49.258054+08:00 240 [System] [MY-010597] [Repl] 'CHANGE REPLICATION SOURCE TO FOR CHANNEL 'mysqlsh.test' executed'. Previous state source_host='', source_port= 3306, source_log_file='', source_log_pos= 4, source_bind=''. New state source_host='dbtest20231201', source_port= 3306, source_log_file='', source_log_pos= 4, source_bind=''.
2023-12-01T14:17:49.271013+08:00 246 [Warning] [MY-010897] [Repl] Storing MySQL user name or password information in the connection metadata repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START REPLICA; see the 'START REPLICA Syntax' in the MySQL Manual for more information.
2023-12-01T14:17:49.279509+08:00 246 [ERROR] [MY-010584] [Repl] Replica I/O for channel 'mysqlsh.test': Error connecting to source 'mysqlsh.test@dbtest20231201:3306'. This was attempt 1/0, with a delay of 60 seconds between attempts. Message: Access denied for user 'mysqlsh.test'@'127.0.0.1' (using password: YES), Error_code: MY-001045

排查过程

经历一番波折,最后发现是克隆机器的hosts文件中存在这样一行,导致 127.0.0.1 dbtest20231201

处理方法

删除/etc/hosts中的以下内容就可以正常添加集群节点了 127.0.0.1 dbtest20231201

结论:一定要仔细检查hosts文件!!!

【版权声明】本文内容来自摩杜云社区用户原创、第三方投稿、转载,内容版权归原作者所有。本网站的目的在于传递更多信息,不拥有版权,亦不承担相应法律责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@moduyun.com

  1. 分享:
最后一次编辑于 2023年12月02日 0

暂无评论

推荐阅读
  xaeiTka4h8LY   2024年05月31日   34   0   0 MySQL索引
  xaeiTka4h8LY   2024年05月31日   46   0   0 MySQLSQL
  xaeiTka4h8LY   2024年05月31日   30   0   0 字段MySQL
  xaeiTka4h8LY   2024年05月31日   40   0   0 MySQL数据库
  xaeiTka4h8LY   2024年05月17日   47   0   0 MySQLgithub
  xaeiTka4h8LY   2024年05月17日   38   0   0 MySQL数据库
yd2rX1n7Kvhq