Я хочу создать кластер 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 оболочки, 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');
Вот мой лог