MySQL 8 通过非 SSL 连接进行复制

MySQL 8 通过非 SSL 连接进行复制

我正在尝试使用 percona-server-server.x86_64-8.0.27-18.1.el8 设置微型主从环境。

计划是在节点之间使用非 SSL 连接,因为服务器将仅在 LAN 中通信。但在从属节点上收到以下错误:

连接主服务器时出错'[电子邮件保护]:3306' - 重试时间:60 重试次数:3 消息:SSL 连接错误:需要 SSL,但服务器不支持

两个节点上的最新 mysql.cnf:

[mysqld]

port = 3306
bind-address = 0.0.0.0
datadir = /var/lib/mysql
socket = /var/run/mysql/mysql.sock
pid-file = /var/run/mysql/mysql.pid
tmpdir = /var/tmp/mysql
# User is ignored when systemd is used (fedora >= 15).
user = mysql
# adding this to allow replication w/o ssl
default_authentication_plugin = mysql_native_password
# disable ssl
ssl = 0

##
# Logging configuration.
##
log-error = /var/log/mysql/mysqld.err

##
# Replication
##
server-id = 1
report_host = hv3-db1
gtid_mode = on
enforce-gtid-consistency = on
sync_binlog         = 1
log_bin             = /var/lib/mysql/mysql-bin
log_bin_index       = /var/lib/mysql/mysql-bin.index
binlog_expire_logs_seconds    = 864000
max_binlog_size     = 100M
log_replica_updates   = 1

##
# Memory settings.
##
key_buffer_size = 256M
max_allowed_packet = 128M
table_open_cache = 256
sort_buffer_size = 1M
read_buffer_size = 1M
read_rnd_buffer_size = 4M
myisam_sort_buffer_size = 64M
thread_cache_size = 8
max_connections = 151
tmp_table_size = 64M
max_heap_table_size = 64M
join_buffer_size = 3M

##
# Other settings.
##
wait_timeout = 1800
# Disabling symbolic-links is recommended to prevent assorted security risks
skip-symbolic-links = 1
net_read_timeout = 120
skip-name-resolve
back_log = 100
max_connect_errors = 10000
open-files-limit = 20000
interactive_timeout = 3600
connect_timeout = 120
explicit_defaults_for_timestamp = True

##
# InnoDB settings
##
innodb_buffer_pool_size = 50G
innodb_log_buffer_size = 1M
innodb_flush_method = O_DIRECT
innodb_file_per_table = 1
innodb_flush_log_at_trx_commit = 2
innodb_lock_wait_timeout = 600
innodb_adaptive_hash_index = off
innodb_fill_factor = 50
innodb_log_file_size = 2G
# Move logs on separate directory/partition
innodb_undo_directory = /var/tmp/mysql
innodb_log_group_home_dir = /var/tmp/mysql

副本通过以下命令启动:

CHANGE REPLICATION SOURCE TO  SOURCE_HOST = '192.168.3.100', SOURCE_PORT = 3306, SOURCE_USER = 'replica', SOURCE_PASSWORD = 'xxx', SOURCE_AUTO_POSITION = 1, SOURCE_SSL=0;

您知道如何解决这个问题吗?

答案1

mysql_ssl_rsa_setup --uid=mysql

解决了一个问题,即使您在复制中不使用它们,mysql 8 似乎也应该存在 ssl 证书。

相关内容