mysql:cannotcreateclustergot错误:服务器没有正确配置为组的活动成员

ruyhziif  于 2021-06-18  发布在  Mysql
关注(0)|答案(1)|浏览(589)

我想创建一个mysql集群(innodb),所以我创建了三个aws ec2示例(centos 7)。
当我跑的时候 var cluster = dba.createCluster('testCluster'); 我得到一个错误如下:

A new InnoDB cluster will be created on instance 'demo@ec2-52-196-251-99.ap-northeast-1.compute.amazonaws.com:3306'.

Validating instance at ec2-52-196-251-99.ap-northeast-1.compute.amazonaws.com:3306...

This instance reports its own address as ip-172-31-29-118.ap-northeast-1.compute.internal

Instance configuration is suitable.
Creating InnoDB cluster 'testCluster' on 'demo@ec2-52-196-251-99.ap-northeast-1.compute.amazonaws.com:3306'...
Dba.createCluster: ERROR: Error starting cluster: 'ec2-52-196-251-99.ap-northeast-1.compute.amazonaws.com:3306' - Query failed. MySQL Error (3092): ClassicSession.query: The server is not configured properly to be an active member of the group. Please see more details on error log.. Query: START group_replication: MySQL Error (3092): ClassicSession.query: The server is not configured properly to be an active member of the group. Please see more details on error log. (RuntimeError)

我不知道我错在哪一部分。我怎么能修好它?希望有人能帮我。
以下是我的步骤:
安装mysql,mysql shell,mysql路由器 sed -i --follow-symlinks 's/SELINUX=.*/SELINUX=disabled/g' /etc/sysconfig/selinux systemctl stop firewalld & systemctl disable firewalld service mysqld start grep 'temporary password' /var/log/mysqld.log mysql -u root -p ALTER USER root@'localhost' IDENTIFIED BY 'rootpassword'; SET sql_log_bin = 0; SET @@persist_only.enforce_gtid_consistency='ON'; CREATE USER 'root'@'%' IDENTIFIED BY 'rootpassword'; GRANT ALL PRIVILEGES ON . TO 'root'@'%' WITH GRANT OPTION; CREATE USER 'demo'@'%' IDENTIFIED BY 'demopassword'; GRANT ALL PRIVILEGES ON mysql_innodb_cluster_metadata.* TO 'demo'@'%' WITH GRANT OPTION; GRANT RELOAD, SHUTDOWN, PROCESS, FILE, SUPER, REPLICATION SLAVE, REPLICATION CLIENT, CREATE USER ON *.* TO 'demo'@'%' WITH GRANT OPTION; GRANT SELECT, DELETE, INSERT, UPDATE, SYSTEM_VARIABLES_ADMIN, PERSIST_RO_VARIABLES_ADMIN ON . TO 'demo'@'%' WITH GRANT OPTION; FLUSH PRIVILEGES; mysqlsh --log-level=DEBUG3 dba.verbose=2 dba.checkInstanceConfiguration('demo@ec2:3306'); dba.configureInstance('demo@ec2:3306'); \c demo@ec2:3306 var cluster = dba.createCluster('testCluster'); 这是我的日志

smtd7mpg

smtd7mpg1#

您使用什么版本的mysql服务器?错误消息告诉您检查错误日志。你查过了吗 error.log ? 里面有什么 error.log ?
此信息
正在验证ec2-52-196-251-99.ap-northeast-1.compute.amazonaws上的示例。com:3306...
此示例将其自己的地址报告为ip-172-31-29-118.ap-northeast-1.compute.internal
显示示例主机和 report_host 它们是不同的。
尝试设置 report_host 在您的mysql服务器配置中对外部可见的主机(https://dev.mysql.com/doc/refman/8.0/en/replication-options-slave.html#option_mysqld_report-主机),即 ec2-52-196-251-99.ap-northeast-1.compute.amazonaws.com 或者 52.196.251.99 .

相关问题