Mysql

InnoDB 集群 - MySQL 8.0.13 在 Ubuntu 18.04.1 LTS 上升級到 8.0.14 - 集群創建失敗

  • February 20, 2019

dba.createCluster('mycluster')隨著最近在 Ubuntu 18.04.1 LTS 上將 MySQL 從 8.0.13 升級到 8.0.14,當我按照使用 MySQL Shell 介面從頭開始創建 3 台機器 InnoDB Cluster 的過程之後發出以下命令時,我開始收到錯誤:

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')and 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 執行了相同的步驟,並且在具有相同 MySQL 設置的 Ubuntu 18.04 LTS 環境中一切正常……僅使用 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

引用自:https://serverfault.com/questions/950556