После недавнего обновления MySQL с 8.0.13 до 8.0.14 в Ubuntu 18.04.1 LTS я начал получать ошибку к тому времени, когда я выдаю dba.createCluster('mycluster')
после выполнения процедуры создания с нуля кластера InnoDB на 3 машины с использованием интерфейса оболочки MySQL:
MySQL | JS > dba.createCluster('mycluster')
A new InnoDB cluster will be created on instance 'root@server1:3306'.
Validating instance at server1:3306...
This instance reports its own address as server1
Instance configuration is suitable.
Creating InnoDB cluster 'mycluster' on 'root@server1:3306'...
Dba.createCluster: ERROR: Error starting cluster: 'server1: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)
Обратите внимание, что перед запуском указанной выше команды я уже запустил dba.checkInstanceConfiguration('server1')
и dba.configureInstance('server1')
с успехом.
Глядя на /var/log/mysql/error.log
файл сразу после запуска dba.createCluster('mycluster')
вот что я получаю:
[System] [MY-010597] [Repl] 'CHANGE MASTER TO FOR CHANNEL 'group_replication_recovery' executed'. Previous state master_host='', master_port= 3306, master_log_file='', master_log_pos= 4, master_bind=''. New state master_host='', master_port= 3306, master_log_file='', master_log_pos= 4, master_bind=''.
[Warning] [MY-011735] [Repl] Plugin group_replication reported: '[GCS] Automatically adding IPv4 localhost address to the whitelist. It is mandatory that it is added.'
[Warning] [MY-011735] [Repl] Plugin group_replication reported: '[GCS] Automatically adding IPv6 localhost address to the whitelist. It is mandatory that it is added.'
[System] [MY-010597] [Repl] 'CHANGE MASTER TO FOR CHANNEL 'group_replication_applier' executed'. Previous state master_host='<NULL>', master_port= 0, master_log_file='', master_log_pos= 4, master_bind=''. New state master_host='<NULL>', master_port= 0, master_log_file='', master_log_pos= 4, master_bind=''.
[ERROR] [MY-011735] [Repl] Plugin group_replication reported: '[GCS] Unable to announce tcp port 33061. Port already in use?'
[ERROR] [MY-011735] [Repl] Plugin group_replication reported: '[GCS] Error joining the group while waiting for the network layer to become ready.'
[ERROR] [MY-011735] [Repl] Plugin group_replication reported: '[GCS] The member was unable to join the group. Local port: 33061'
[ERROR] [MY-011640] [Repl] Plugin group_replication reported: 'Timeout on wait for view after joining group'
[ERROR] [MY-011735] [Repl] Plugin group_replication reported: '[GCS] The member is leaving a group without being on one.'
У меня ничего не работает на порту 33061, как можно предположить из приведенного выше журнала. До и после запуска dba.createCluster
команда это то, что у меня есть:
# netstat -ltupn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN 612/systemd-resolve
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 816/sshd
tcp 0 0 10.131.16.221:33060 0.0.0.0:* LISTEN 870/mysqld
tcp 0 0 10.131.16.221:33062 0.0.0.0:* LISTEN 870/mysqld
tcp 0 0 10.131.16.221:3306 0.0.0.0:* LISTEN 870/mysqld
udp 0 0 127.0.0.53:53 0.0.0.0:* 612/systemd-resolve
Ожидаемым поведением будет появление новой записи в приведенном выше выводе с 10.131.16.221:33061
после бега dba.createCluster
но ничего не меняется ...
Это то, что у меня есть /etc/mysql/mysql.conf.d/mysqld.cnf
файл:
[mysqld]
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
datadir = /var/lib/mysql
log-error = /var/log/mysql/error.log
admin-address = server1
bind-address = server1
mysqlx_bind_address = server1
session_track_gtids = OWN_GTID
log_timestamps = SYSTEM
default-authentication-plugin = mysql_native_password
И вот что показывает настройки репликации группы серверов при запуске:
MySQL | SQL > show variables like '%replication%'
+-----------------------------------------------------+--------------------------------------+
| Variable_name | Value |
+-----------------------------------------------------+--------------------------------------+
| group_replication_allow_local_lower_version_join | OFF |
| group_replication_auto_increment_increment | 7 |
| group_replication_bootstrap_group | ON |
| group_replication_communication_debug_options | GCS_DEBUG_NONE |
| group_replication_components_stop_timeout | 31536000 |
| group_replication_compression_threshold | 1000000 |
| group_replication_consistency | EVENTUAL |
| group_replication_enforce_update_everywhere_checks | OFF |
| group_replication_exit_state_action | READ_ONLY |
| group_replication_flow_control_applier_threshold | 25000 |
| group_replication_flow_control_certifier_threshold | 25000 |
| group_replication_flow_control_hold_percent | 10 |
| group_replication_flow_control_max_quota | 0 |
| group_replication_flow_control_member_quota_percent | 0 |
| group_replication_flow_control_min_quota | 0 |
| group_replication_flow_control_min_recovery_quota | 0 |
| group_replication_flow_control_mode | QUOTA |
| group_replication_flow_control_period | 1 |
| group_replication_flow_control_release_percent | 50 |
| group_replication_force_members | |
| group_replication_group_name | de380568-1fc9-11e9-9a08-cad7c4f1e463 |
| group_replication_group_seeds | |
| group_replication_gtid_assignment_block_size | 1000000 |
| group_replication_ip_whitelist | AUTOMATIC |
| group_replication_local_address | server1:33061 |
| group_replication_member_expel_timeout | 0 |
| group_replication_member_weight | 50 |
| group_replication_poll_spin_loops | 0 |
| group_replication_recovery_complete_at | TRANSACTIONS_APPLIED |
| group_replication_recovery_get_public_key | OFF |
| group_replication_recovery_public_key_path | |
| group_replication_recovery_reconnect_interval | 60 |
| group_replication_recovery_retry_count | 10 |
| group_replication_recovery_ssl_ca | |
| group_replication_recovery_ssl_capath | |
| group_replication_recovery_ssl_cert | |
| group_replication_recovery_ssl_cipher | |
| group_replication_recovery_ssl_crl | |
| group_replication_recovery_ssl_crlpath | |
| group_replication_recovery_ssl_key | |
| group_replication_recovery_ssl_verify_server_cert | OFF |
| group_replication_recovery_use_ssl | ON |
| group_replication_single_primary_mode | ON |
| group_replication_ssl_mode | REQUIRED |
| group_replication_start_on_boot | ON |
| group_replication_transaction_size_limit | 150000000 |
| group_replication_unreachable_majority_timeout | 0 |
| innodb_replication_delay | 0 |
+-----------------------------------------------------+--------------------------------------+
Я не знаю, что может быть не так с моими настройками, поскольку я выполнил те же шаги с версией MySQL 8.0.13, и все работало хорошо на моем окружении Ubuntu 18.04 LTS с теми же настройками MySQL ... Только с версией MySQL 8.0. 14 это начало происходить.
Кто-нибудь испытывал такую же проблему? Помощь или подсказки очень ценятся!
Это ошибка в 8.0.14, в 8.0.15 проблема решена
https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-15.html