3

I want to create a MySQL cluster (InnoDB) so I create three AWS EC2 Instances (CentOS 7).
When I run var cluster = dba.createCluster('testCluster');
I got a Error below:

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)

I don't know which part did I wrong. How could I fix it ? Hope someone could help me.

Here is my steps:

  1. Install mysql, mysql shell, mysql router
  2. sed -i --follow-symlinks 's/SELINUX=.*/SELINUX=disabled/g' /etc/sysconfig/selinux
  3. systemctl stop firewalld & systemctl disable firewalld
  4. service mysqld start
  5. grep 'temporary password' /var/log/mysqld.log
  6. mysql -u root -p
  7. 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;
  8. mysqlsh --log-level=DEBUG3
    dba.verbose=2
  9. dba.checkInstanceConfiguration('demo@ec2:3306');
  10. dba.configureInstance('demo@ec2:3306');
  11. \c demo@ec2:3306
  12. var cluster = dba.createCluster('testCluster');

Here is my log

enter image description here

Rukeith
  • 665
  • 1
  • 8
  • 22

1 Answers1

0

What version of MySQL Server do you use? Error message tells you to check error log. Did you checked error.log? What is in error.log?

This information

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

shows that your instance host and report_host are different.

Try to set report_host in your MySQL Server configuration to externally visible host (https://dev.mysql.com/doc/refman/8.0/en/replication-options-slave.html#option_mysqld_report-host), i.e. to ec2-52-196-251-99.ap-northeast-1.compute.amazonaws.com or 52.196.251.99.

Community
  • 1
  • 1
kgr
  • 779
  • 6
  • 8