docker 8.0.32-25 启动后内存使用率很高
- linux version : ubuntu20.04
- docker version : 20.10.21
```
Client:
Version: 20.10.21
API version: 1.41
Go version: go1.18.1
Git commit: 20.10.21-0ubuntu1~20.04.2
Built: Thu Apr 27 05:56:19 2023
OS/Arch: linux/amd64
Context: default
Experimental: true
Server:
Engine:
Version: 20.10.21
API version: 1.41 (minimum version 1.12)
Go version: go1.18.1
Git commit: 20.10.21-0ubuntu1~20.04.2
Built: Thu Apr 27 05:37:01 2023
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.6.12-0ubuntu1~20.04.3
GitCommit:
runc:
Version: 1.1.7-0ubuntu1~20.04.2
GitCommit:
docker-init:
Version: 0.19.0
GitCommit:
```
- docker 启动命令
```
docker run -d \
--name=greatsql-mgr-0 \
--restart=always \
--net=host \
-v /data/greatsql/conf/my.cnf:/etc/my.cnf \
-v /data/greatsql/data/:/data/GreatSQL \
-e MYSQL_ALLOW_EMPTY_PASSWORD=1 \
greatsql/greatsql:8.0.32-25
```
- my.cnf
```
#my.cnf
socket = /data/GreatSQL/mysql.sock
loose-skip-binary-as-hex
prompt="(\\D)[\\u@GreatSQL][\\d]> "
no-auto-rehash
user = mysql
port = 3306
server_id = 10000
basedir = /usr/
datadir = /data/GreatSQL
socket = /data/GreatSQL/mysql.sock
pid-file = mysql.pid
character-set-server = UTF8MB4
skip_name_resolve = 1
secure-file-priv = /data/GreatSQL
#若你的MySQL数据库主要运行在境外,请务必根据实际情况调整本参数
default_time_zone = "+00:00"
# 表名大小写设定,非常重要,初始化完后不能再修改,通常建议设置为1
# 如果设置为 0,表名将按指定方式存储,并且在对比表名时区分大小写。
# 如果设置为 1,表名将以小写形式存储在磁盘上,在对比表名时不区分大小写。
# 如果设置为 2,则表名按给定格式存储,但以小写形式进行比较。
lower_case_table_names = 1
#performance setttings
lock_wait_timeout = 3600
open_files_limit = 65535
back_log = 1024
max_connections = 512
max_connect_errors = 1000000
table_open_cache = 1024
table_definition_cache = 1024
thread_stack = 512K
sort_buffer_size = 4M
join_buffer_size = 4M
read_buffer_size = 8M
read_rnd_buffer_size = 4M
bulk_insert_buffer_size = 64M
thread_cache_size = 768
interactive_timeout = 600
wait_timeout = 600
tmp_table_size = 32M
max_heap_table_size = 32M
#log settings
log_timestamps = SYSTEM
log_error = /data/GreatSQL/error.log
log_error_verbosity = 3
slow_query_log = 1
log_slow_extra = 1
slow_query_log_file = /data/GreatSQL/slow.log
long_query_time = 0.1
log_queries_not_using_indexes = 1
log_throttle_queries_not_using_indexes = 60
min_examined_row_limit = 100
log_slow_admin_statements = 1
log_slow_slave_statements = 1
log_bin = /data/GreatSQL/binlog
binlog_format = ROW
sync_binlog = 1
binlog_cache_size = 4M
max_binlog_cache_size = 2G
max_binlog_size = 1G
binlog_rows_query_log_events = 1
binlog_expire_logs_seconds = 604800
#MySQL 8.0.22前,想启用MGR的话,需要设置binlog_checksum=NONE才行
binlog_checksum = CRC32
gtid_mode = ON
enforce_gtid_consistency = TRUE
# myisam settings
key_buffer_size = 32M
myisam_sort_buffer_size = 128M
# replication settings
# master_info_repository = TABLE
# relay_log_info_repository = TABLE
relay_log_recovery = 1
slave_parallel_type = LOGICAL_CLOCK
# 可以设置为逻辑CPU数量的2倍
slave_parallel_workers = 8
binlog_transaction_dependency_tracking = WRITESET
slave_preserve_commit_order = 1
slave_checkpoint_period = 2
# parallel query
loose-force_parallel_execute = ON
# parallel load data
loose-gdb_parallel_load = 1
# mgr settings
loose-plugin_load_add = 'mysql_clone.so'
loose-plugin_load_add = 'group_replication.so'
loose-group_replication_group_name = "aa81212f-7d86-4ad1-82a5-3ec2b30b0d9f"
loose-group_replication_view_change_uuid = 'AUTOMATIC'
# MGR本地节点IP:PORT,请自行替换
loose-group_replication_local_address = "192.168.10.130:33061"
# MGR集群所有节点IP:PORT,请自行替换
loose-group_replication_group_seeds = "192.168.10.130:33061,192.168.10.131:33061,192.168.10.132:33061,192.168.10.132:33061"
loose-group_replication_start_on_boot = ON
loose-group_replication_bootstrap_group = OFF
loose-group_replication_exit_state_action = READ_ONLY
loose-group_replication_flow_control_mode = "DISABLED"
loose-group_replication_single_primary_mode = 1
loose-group_replication_majority_after_mode = ON
loose-group_replication_communication_max_message_size = 10M
loose-group_replication_arbitrator = 0
loose-group_replication_single_primary_fast_mode = 1
loose-group_replication_request_time_threshold = 100
loose-group_replication_primary_election_mode = GTID_FIRST
loose-group_replication_unreachable_majority_timeout = 30
loose-group_replication_member_expel_timeout = 5
loose-group_replication_autorejoin_tries = 288
loose-group_replication_recovery_get_public_key = 1
# 本机的ip
report_host = "192.168.10.130"
report_port = 3306
# innodb settings
# 根据服务器的内存设置,不要超过一半
innodb_buffer_pool_size = 128M
innodb_buffer_pool_instances = 8
innodb_data_file_path = ibdata1:12M:autoextend
innodb_flush_log_at_trx_commit = 1
innodb_log_buffer_size = 32M
#innodb_log_file_size = 48M
#innodb_log_files_in_group = 3
innodb_redo_log_capacity = 8M
innodb_doublewrite_files = 2
innodb_max_undo_log_size = 4G
# 根据您的服务器IOPS能力适当调整
# 一般配普通SSD盘的话,可以调整到 10000 - 20000
# 配置高端PCIe SSD卡的话,则可以调整的更高,比如 50000 - 80000
innodb_io_capacity = 1500
innodb_io_capacity_max = 6000
innodb_open_files = 65534
#innodb_flush_method = O_DIRECT
innodb_lru_scan_depth = 4000
innodb_lock_wait_timeout = 10
innodb_rollback_on_timeout = 1
innodb_print_all_deadlocks = 1
innodb_online_alter_log_max_size = 4G
innodb_print_ddl_logs = 0
innodb_status_file = 1
#注意: 开启 innodb_status_output & innodb_status_output_locks 后, 可能会导致log_error文件增长较快
innodb_status_output = 0
innodb_status_output_locks = 1
innodb_sort_buffer_size = 67108864
# innodb monitor settings
# innodb_monitor_enable = "module_innodb,module_server,module_dml,module_ddl,module_trx,module_os,module_purge,module_log,module_lock,module_buffer,module_index,module_ibuf_system,module_buffer_page,module_adaptive_hash"
# pfs settings
performance_schema = 1
# performance_schema_instrument = '%memory%=on'
performance_schema_instrument = '%lock%=on'
```
- 在容器中使用top命令
- mysqladmin var > var.info
```
+--------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Variable_name | Value |
+--------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| activate_all_roles_on_login | OFF |
| admin_address | |
| admin_port | 33062 |
| admin_ssl_ca | |
| admin_ssl_capath | |
| admin_ssl_cert | |
| admin_ssl_cipher | |
| admin_ssl_crl | |
| admin_ssl_crlpath | |
| admin_ssl_key | |
| admin_tls_ciphersuites | |
| admin_tls_version | TLSv1.2,TLSv1.3 |
| audit_log_max_rows | 2147483647 |
| authentication_policy | *,, |
| auto_generate_certs | ON |
| auto_increment_increment | 1 |
| auto_increment_offset | 1 |
| autocommit | ON |
| automatic_sp_privileges | ON |
| avoid_temporal_upgrade | OFF |
| back_log | 1024 |
| basedir | /usr/ |
| big_tables | OFF |
| bind_address | * |
| binlog_cache_size | 4194304 |
| binlog_checksum | CRC32 |
| binlog_ddl_skip_rewrite | OFF |
| binlog_direct_non_transactional_updates | OFF |
| binlog_encryption | OFF |
| binlog_error_action | ABORT_SERVER |
| binlog_expire_logs_auto_purge | ON |
| binlog_expire_logs_seconds | 604800 |
| binlog_format | ROW |
| binlog_group_commit_sync_delay | 0 |
| binlog_group_commit_sync_no_delay_count | 0 |
| binlog_gtid_simple_recovery | ON |
| binlog_max_flush_queue_time | 0 |
| binlog_order_commits | ON |
| binlog_rotate_encryption_master_key_at_startup | OFF |
| binlog_row_event_max_size | 8192 |
| binlog_row_image | FULL |
| binlog_row_metadata | MINIMAL |
| binlog_row_value_options | |
| binlog_rows_query_log_events | ON |
| binlog_skip_flush_commands | OFF |
| binlog_space_limit | 0 |
| binlog_stmt_cache_size | 32768 |
| binlog_transaction_compression | OFF |
| binlog_transaction_compression_level_zstd | 3 |
| binlog_transaction_dependency_history_size | 25000 |
| binlog_transaction_dependency_tracking | WRITESET |
| block_encryption_mode | aes-128-ecb |
| buffered_error_log_filename | |
| buffered_error_log_size | 0 |
| build_id | e6d559b16772ed94ef957737bf4e2aac7e0cb8d6 |
| bulk_insert_buffer_size | 67108864 |
| caching_sha2_password_auto_generate_rsa_keys | ON |
| caching_sha2_password_digest_rounds | 5000 |
| caching_sha2_password_private_key_path | private_key.pem |
| caching_sha2_password_public_key_path | public_key.pem |
| character_set_client | utf8mb4 |
| character_set_connection | utf8mb4 |
| character_set_database | utf8mb4 |
| character_set_filesystem | binary |
| character_set_results | utf8mb4 |
| character_set_server | utf8mb4 |
| character_set_system | utf8mb3 |
| character_sets_dir | /usr/share/greatsql/charsets/ |
| check_proxy_users | OFF |
| clone_autotune_concurrency | ON |
| clone_block_ddl | OFF |
| clone_buffer_size | 4194304 |
| clone_ddl_timeout | 300 |
| clone_delay_after_data_drop | 0 |
| clone_donor_timeout_after_network_failure | 5 |
| clone_enable_compression | OFF |
| clone_encrypt_key_path | |
| clone_max_concurrency | 16 |
| clone_max_data_bandwidth | 0 |
| clone_max_network_bandwidth | 0 |
| clone_ssl_ca | |
| clone_ssl_cert | |
| clone_ssl_key | |
| clone_valid_donor_list | |
| collation_connection | utf8mb4_0900_ai_ci |
| collation_database | utf8mb4_0900_ai_ci |
| collation_server | utf8mb4_0900_ai_ci |
| completion_type | NO_CHAIN |
| concurrent_insert | AUTO |
| connect_timeout | 10 |
| connection_memory_chunk_size | 8912 |
| connection_memory_limit | 18446744073709551615 |
| core_file | OFF |
| create_admin_listener_thread | OFF |
| cte_max_recursion_depth | 1000 |
| datadir | /data/GreatSQL/ |
| dbms_profiler_max_data_size | 1000 |
| dbms_profiler_max_units_size | 100 |
| default_authentication_plugin | caching_sha2_password |
| default_collation_for_utf8mb4 | utf8mb4_0900_ai_ci |
| default_password_lifetime | 0 |
| default_storage_engine | InnoDB |
| default_table_encryption | OFF |
| default_tmp_storage_engine | InnoDB |
| default_week_format | 0 |
| delay_key_write | ON |
| delayed_insert_limit | 100 |
| delayed_insert_timeout | 300 |
| delayed_queue_size | 1000 |
| disabled_storage_engines | |
| disconnect_on_expired_password | ON |
| div_precision_increment | 4 |
| encrypt_tmp_files | OFF |
| end_markers_in_json | OFF |
| enforce_gtid_consistency | ON |
| enforce_storage_engine | |
| eq_range_index_dive_limit | 200 |
| errorlog_messages_language | en_US |
| event_scheduler | ON |
| expand_fast_index_creation | OFF |
| expire_logs_days | 0 |
| explain_format | TRADITIONAL |
| explicit_defaults_for_timestamp | ON |
| flush | OFF |
| flush_time | 0 |
| force_parallel_execute | ON |
| foreign_key_checks | ON |
| ft_boolean_syntax | + -><()~*:""&| |
| ft_max_word_len | 84 |
| ft_min_word_len | 4 |
| ft_query_expansion_limit | 20 |
| ft_query_extra_word_chars | OFF |
| ft_stopword_file | (built-in) |
| gdb_parallel_load_chunk_size | 4194304 |
| gdb_parallel_load_workers | 6 |
| gdb_sqld_version | 8.0.32.5 |
| general_log | OFF |
| general_log_file | /data/GreatSQL/greatsql-0.log |
| generated_random_password_length | 20 |
| global_connection_memory_limit | 18446744073709551615 |
| global_connection_memory_tracking | OFF |
| group_concat_max_len | 1024 |
| group_replication_advertise_recovery_endpoints | DEFAULT |
| group_replication_allow_local_lower_version_join | OFF |
| group_replication_applier_batch_size_threshold | 100000 |
| group_replication_arbitrator | OFF |
| group_replication_async_auto_failover_channel_read_only_mode | OFF |
| group_replication_auto_evict_timeout | 0 |
| group_replication_auto_increment_increment | 7 |
| group_replication_autorejoin_tries | 288 |
| group_replication_bootstrap_group | OFF |
| group_replication_broadcast_gtid_executed_period | 1000 |
| group_replication_clone_threshold | 9223372036854775807 |
| group_replication_communication_debug_options | GCS_DEBUG_NONE |
| group_replication_communication_flp_timeout | 5 |
| group_replication_communication_max_message_size | 10485760 |
| group_replication_communication_stack | XCOM |
| group_replication_components_stop_timeout | 300 |
| group_replication_compression_threshold | 1000000 |
| group_replication_consistency | EVENTUAL |
| group_replication_donor_threshold | 9223372036854775807 |
| 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_max_wait_time | 3600 |
| 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 | DISABLED |
| group_replication_flow_control_period | 1 |
| group_replication_flow_control_release_percent | 50 |
| group_replication_flow_control_replay_lag_behind | 600 |
| group_replication_force_members | |
| group_replication_group_name | aa81212f-7d86-4ad1-82a5-3ec2b30b0d9f |
| group_replication_group_seeds | 192.168.10.130:33061,192.168.10.131:33061,192.168.10.132:33061,192.168.10.132:33061 |
| group_replication_gtid_assignment_block_size | 1000000 |
| group_replication_ip_allowlist | AUTOMATIC |
| group_replication_ip_whitelist | AUTOMATIC |
| group_replication_local_address | 192.168.10.130:33061 |
| group_replication_majority_after_mode | ON |
| group_replication_member_expel_timeout | 5 |
| group_replication_member_weight | 50 |
| group_replication_message_cache_size | 1073741824 |
| group_replication_paxos_single_leader | OFF |
| group_replication_poll_spin_loops | 0 |
| group_replication_primary_election_mode | GTID_FIRST |
| group_replication_recovery_complete_at | TRANSACTIONS_APPLIED |
| group_replication_recovery_compression_algorithms | uncompressed |
| group_replication_recovery_get_public_key | ON |
| 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_tls_ciphersuites | |
| group_replication_recovery_tls_version | TLSv1.2,TLSv1.3 |
| group_replication_recovery_use_ssl | OFF |
| group_replication_recovery_zstd_compression_level | 3 |
| group_replication_request_time_threshold | 100 |
| group_replication_single_primary_fast_mode | 1 |
| group_replication_single_primary_mode | ON |
| group_replication_ssl_mode | DISABLED |
| group_replication_start_on_boot | ON |
| group_replication_tls_source | MYSQL_MAIN |
| group_replication_transaction_size_limit | 150000000 |
| group_replication_unreachable_majority_timeout | 30 |
| group_replication_view_change_uuid | AUTOMATIC |
| group_replication_xcom_cache_mode | 2 |
| group_replication_zone_id | 0 |
| group_replication_zone_id_sync_mode | ON |
| gtid_executed | aa81212f-7d86-4ad1-82a5-3ec2b30b0d9f:1 |
| gtid_executed_compression_period | 0 |
| gtid_mode | ON |
| gtid_owned | |
| gtid_purged | |
| have_backup_locks | YES |
| have_backup_safe_binlog_info | YES |
| have_compress | YES |
| have_dynamic_loading | YES |
| have_geometry | YES |
| have_openssl | YES |
| have_profiling | YES |
| have_query_cache | NO |
| have_rtree_keys | YES |
| have_snapshot_cloning | YES |
| have_ssl | YES |
| have_statement_timeout | YES |
| have_symlink | DISABLED |
| histogram_generation_max_mem_size | 20000000 |
| host_cache_size | 628 |
| hostname | greatsql-0 |
| information_schema_stats_expiry | 86400 |
| init_connect | |
| init_file | |
| init_replica | |
| init_slave | |
| innodb_adaptive_flushing | ON |
| innodb_adaptive_flushing_lwm | 10 |
| innodb_adaptive_hash_index | ON |
| innodb_adaptive_hash_index_parts | 8 |
| innodb_adaptive_max_sleep_delay | 150000 |
| innodb_api_bk_commit_interval | 5 |
| innodb_api_disable_rowlock | OFF |
| innodb_api_enable_binlog | OFF |
| innodb_api_enable_mdl | OFF |
| innodb_api_trx_level | 0 |
| innodb_autoextend_increment | 64 |
| innodb_autoinc_lock_mode | 2 |
| innodb_buffer_pool_chunk_size | 134217728 |
| innodb_buffer_pool_dump_at_shutdown | ON |
| innodb_buffer_pool_dump_now | OFF |
| innodb_buffer_pool_dump_pct | 25 |
| innodb_buffer_pool_filename | ib_buffer_pool |
| innodb_buffer_pool_in_core_file | ON |
| innodb_buffer_pool_instances | 1 |
| innodb_buffer_pool_load_abort | OFF |
| innodb_buffer_pool_load_at_startup | ON |
| innodb_buffer_pool_load_now | OFF |
| innodb_buffer_pool_size | 134217728 |
| innodb_change_buffer_max_size | 25 |
| innodb_change_buffering | all |
| innodb_checksum_algorithm | crc32 |
| innodb_cleaner_lsn_age_factor | high_checkpoint |
| innodb_cmp_per_index_enabled | OFF |
| innodb_commit_concurrency | 0 |
| innodb_compressed_columns_threshold | 96 |
| innodb_compressed_columns_zip_level | 6 |
| innodb_compression_failure_threshold_pct | 5 |
| innodb_compression_level | 6 |
| innodb_compression_pad_pct_max | 50 |
| innodb_concurrency_tickets | 5000 |
| innodb_corrupt_table_action | assert |
| innodb_data_file_async_purge | OFF |
| innodb_data_file_async_purge_all_at_shutdown | OFF |
| innodb_data_file_async_purge_error_retry_count | 10 |
| innodb_data_file_async_purge_interval | 100 |
| innodb_data_file_async_purge_max_size | 268435456 |
| innodb_data_file_path | ibdata1:12M:autoextend |
| innodb_data_force_async_purge_file_size | 10737418240 |
| innodb_data_home_dir | |
| innodb_ddl_buffer_size | 1048576 |
| innodb_ddl_threads | 4 |
| innodb_deadlock_detect | ON |
| innodb_dedicated_server | OFF |
| innodb_default_row_format | dynamic |
| innodb_directories | |
| innodb_disable_sort_file_cache | OFF |
| innodb_doublewrite | ON |
| innodb_doublewrite_batch_size | 0 |
| innodb_doublewrite_dir | |
| innodb_doublewrite_files | 2 |
| innodb_doublewrite_pages | 4 |
| innodb_empty_free_list_algorithm | legacy |
| innodb_encrypt_online_alter_logs | OFF |
| innodb_extend_and_initialize | ON |
| innodb_fast_shutdown | 1 |
| innodb_file_per_table | ON |
| innodb_fill_factor | 100 |
| innodb_flush_log_at_timeout | 1 |
| innodb_flush_log_at_trx_commit | 1 |
| innodb_flush_method | fsync |
| innodb_flush_neighbors | 0 |
| innodb_flush_sync | ON |
| innodb_flushing_avg_loops | 30 |
| innodb_force_index_records_in_range | 0 |
| innodb_force_load_corrupted | OFF |
| innodb_force_recovery | 0 |
| innodb_fsync_threshold | 0 |
| innodb_ft_aux_table | |
| innodb_ft_cache_size | 8000000 |
| innodb_ft_enable_diag_print | OFF |
| innodb_ft_enable_stopword | ON |
| innodb_ft_ignore_stopwords | OFF |
| innodb_ft_max_token_size | 84 |
| innodb_ft_min_token_size | 3 |
| innodb_ft_num_word_optimize | 2000 |
| innodb_ft_result_cache_limit | 2000000000 |
| innodb_ft_server_stopword_table | |
| innodb_ft_sort_pll_degree | 2 |
| innodb_ft_total_cache_size | 640000000 |
| innodb_ft_user_stopword_table | |
| innodb_idle_flush_pct | 100 |
| innodb_io_capacity | 1500 |
| innodb_io_capacity_max | 6000 |
| innodb_lock_wait_timeout | 10 |
| innodb_log_buffer_size | 33554432 |
| innodb_log_checksums | ON |
| innodb_log_compressed_pages | ON |
| innodb_log_file_size | 50331648 |
| innodb_log_files_in_group | 2 |
| innodb_log_group_home_dir | ./ |
| innodb_log_spin_cpu_abs_lwm | 80 |
| innodb_log_spin_cpu_pct_hwm | 50 |
| innodb_log_wait_for_flush_spin_hwm | 400 |
| innodb_log_write_ahead_size | 8192 |
| innodb_log_writer_threads | ON |
| innodb_lru_scan_depth | 4000 |
| innodb_max_dirty_pages_pct | 90.000000 |
| innodb_max_dirty_pages_pct_lwm | 10.000000 |
| innodb_max_purge_lag | 0 |
| innodb_max_purge_lag_delay | 0 |
| innodb_max_undo_log_size | 4294967296 |
| innodb_monitor_disable | |
| innodb_monitor_enable | |
| innodb_monitor_reset | |
| innodb_monitor_reset_all | |
| innodb_numa_interleave | OFF |
| innodb_old_blocks_pct | 37 |
| innodb_old_blocks_time | 1000 |
| innodb_online_alter_log_max_size | 4294967296 |
| innodb_open_files | 65534 |
| innodb_optimize_fulltext_only | OFF |
| innodb_page_cleaners | 1 |
| innodb_page_size | 16384 |
| innodb_parallel_dblwr_encrypt | OFF |
| innodb_parallel_doublewrite_path | xb_doublewrite |
| innodb_parallel_read_threads | 4 |
| innodb_print_all_deadlocks | ON |
| innodb_print_ddl_logs | OFF |
| innodb_print_lock_wait_timeout_info | OFF |
| innodb_purge_batch_size | 300 |
| innodb_purge_rseg_truncate_frequency | 128 |
| innodb_purge_threads | 4 |
| innodb_random_read_ahead | OFF |
| innodb_read_ahead_threshold | 56 |
| innodb_read_io_threads | 4 |
| innodb_read_only | OFF |
| innodb_records_in_range | 0 |
| innodb_redo_log_archive_dirs | |
| innodb_redo_log_capacity | 8388608 |
| innodb_redo_log_encrypt | OFF |
| innodb_replication_delay | 0 |
| innodb_rollback_on_timeout | ON |
| innodb_rollback_segments | 128 |
| innodb_segment_reserve_factor | 12.500000 |
| innodb_show_locks_held | 10 |
| innodb_sort_buffer_size | 67108864 |
| innodb_spin_wait_delay | 6 |
| innodb_spin_wait_pause_multiplier | 50 |
| innodb_stats_auto_recalc | ON |
| innodb_stats_include_delete_marked | OFF |
| innodb_stats_method | nulls_equal |
| innodb_stats_on_metadata | OFF |
| innodb_stats_persistent | ON |
| innodb_stats_persistent_sample_pages | 20 |
| innodb_stats_transient_sample_pages | 8 |
| innodb_status_output | OFF |
| innodb_status_output_locks | ON |
| innodb_strict_mode | ON |
| innodb_sync_array_size | 1 |
| innodb_sync_spin_loops | 30 |
| innodb_sys_tablespace_encrypt | OFF |
| innodb_table_locks | ON |
| innodb_temp_data_file_path | ibtmp1:12M:autoextend |
| innodb_temp_tablespace_encrypt | OFF |
| innodb_temp_tablespaces_dir | ./#innodb_temp/ |
| innodb_thread_concurrency | 0 |
| innodb_thread_sleep_delay | 10000 |
| innodb_tmpdir | |
| innodb_undo_directory | ./ |
| innodb_undo_log_encrypt | OFF |
| innodb_undo_log_truncate | ON |
| innodb_undo_tablespaces | 2 |
| innodb_use_fdatasync | OFF |
| innodb_use_native_aio | ON |
| innodb_validate_tablespace_paths | ON |
| innodb_version | 8.0.32-23 |
| innodb_write_io_threads | 4 |
| interactive_timeout | 600 |
| internal_tmp_mem_storage_engine | TempTable |
| jemalloc_detected | OFF |
| jemalloc_profiling | OFF |
| join_buffer_size | 4194304 |
| keep_files_on_create | OFF |
| key_buffer_size | 33554432 |
| key_cache_age_threshold | 300 |
| key_cache_block_size | 1024 |
| key_cache_division_limit | 100 |
| keyring_operations | ON |
| kill_idle_transaction | 0 |
| large_files_support | ON |
| large_page_size | 0 |
| large_pages | OFF |
| lc_messages | en_US |
| lc_messages_dir | /usr/share/greatsql/ |
| lc_time_names | en_US |
| license | GPL |
| local_infile | OFF |
| lock_ddl_polling_mode | OFF |
| lock_ddl_polling_runtime | 1000 |
| lock_wait_timeout | 3600 |
| locked_in_memory | OFF |
| log_bin | ON |
| log_bin_basename | /data/GreatSQL/binlog |
| log_bin_index | /data/GreatSQL/binlog.index |
| log_bin_trust_function_creators | OFF |
| log_bin_use_v1_row_events | OFF |
| log_error | /data/GreatSQL/error.log |
| log_error_services | log_filter_internal; log_sink_internal |
| log_error_suppression_list | |
| log_error_verbosity | 3 |
| log_output | FILE |
| log_queries_not_using_indexes | ON |
| log_query_errors | |
| log_raw | OFF |
| log_replica_updates | ON |
| log_slave_updates | ON |
| log_slow_admin_statements | ON |
| log_slow_extra | ON |
| log_slow_filter | |
| log_slow_rate_limit | 1 |
| log_slow_rate_type | session |
| log_slow_replica_statements | ON |
| log_slow_slave_statements | ON |
| log_slow_sp_statements | ON |
| log_slow_verbosity | |
| log_statements_unsafe_for_binlog | ON |
| log_throttle_queries_not_using_indexes | 60 |
| log_timestamps | SYSTEM |
| long_query_time | 0.100000 |
| low_priority_updates | OFF |
| lower_case_file_system | OFF |
| lower_case_table_names | 1 |
| mandatory_roles | |
| master_info_repository | TABLE |
| master_verify_checksum | OFF |
| max_allowed_packet | 67108864 |
| max_binlog_cache_size | 2147483648 |
| max_binlog_size | 1073741824 |
| max_binlog_stmt_cache_size | 18446744073709547520 |
| max_connect_errors | 1000000 |
| max_connections | 512 |
| max_dbmsotpt_count | 2048 |
| max_delayed_threads | 20 |
| max_digest_length | 1024 |
| max_error_count | 1024 |
| max_execution_time | 0 |
| max_heap_table_size | 33554432 |
| max_insert_delayed_threads | 20 |
| max_join_size | 18446744073709551615 |
| max_length_for_sort_data | 4096 |
| max_points_in_geometry | 65536 |
| max_prepared_stmt_count | 16382 |
| max_relay_log_size | 0 |
| max_seeks_for_key | 18446744073709551615 |
| max_slowlog_files | 0 |
| max_slowlog_size | 0 |
| max_sort_length | 1024 |
| max_sp_recursion_depth | 0 |
| max_user_connections | 0 |
| max_write_lock_count | 18446744073709551615 |
| min_examined_row_limit | 100 |
| myisam_data_pointer_size | 6 |
| myisam_max_sort_file_size | 9223372036853727232 |
| myisam_mmap_size | 18446744073709551615 |
| myisam_recover_options | OFF |
| myisam_sort_buffer_size | 134217728 |
| myisam_stats_method | nulls_unequal |
| myisam_use_mmap | OFF |
| mysql_native_password_proxy_users | OFF |
| mysqlx_bind_address | * |
| mysqlx_compression_algorithms | DEFLATE_STREAM,LZ4_MESSAGE,ZSTD_STREAM |
| mysqlx_connect_timeout | 30 |
| mysqlx_deflate_default_compression_level | 3 |
| mysqlx_deflate_max_client_compression_level | 5 |
| mysqlx_document_id_unique_prefix | 0 |
| mysqlx_enable_hello_notice | ON |
| mysqlx_idle_worker_thread_timeout | 60 |
| mysqlx_interactive_timeout | 28800 |
| mysqlx_lz4_default_compression_level | 2 |
| mysqlx_lz4_max_client_compression_level | 8 |
| mysqlx_max_allowed_packet | 67108864 |
| mysqlx_max_connections | 100 |
| mysqlx_min_worker_threads | 2 |
| mysqlx_port | 33060 |
| mysqlx_port_open_timeout | 0 |
| mysqlx_read_timeout | 30 |
| mysqlx_socket | /var/lib/mysql/mysqlx.sock |
| mysqlx_ssl_ca | |
| mysqlx_ssl_capath | |
| mysqlx_ssl_cert | |
| mysqlx_ssl_cipher | |
| mysqlx_ssl_crl | |
| mysqlx_ssl_crlpath | |
| mysqlx_ssl_key | |
| mysqlx_wait_timeout | 28800 |
| mysqlx_write_timeout | 60 |
| mysqlx_zstd_default_compression_level | 3 |
| mysqlx_zstd_max_client_compression_level | 11 |
| net_buffer_length | 16384 |
| net_buffer_shrink_interval | 0 |
| net_read_timeout | 30 |
| net_retry_count | 10 |
| net_write_timeout | 60 |
| new | OFF |
| ngram_token_size | 2 |
| offline_mode | OFF |
| old | OFF |
| old_alter_table | OFF |
| open_files_limit | 1048576 |
| optimizer_max_subgraph_pairs | 100000 |
| optimizer_prune_level | 1 |
| optimizer_search_depth | 62 |
| optimizer_switch | index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,mrr=on,mrr_cost_based=on,block_nested_loop=on,batched_key_access=off,materialization=on,semijoin=on,loosescan=on,firstmatch=on,duplicateweedout=on,subquery_materialization_cost_based=on,use_index_extensions=on,condition_fanout_filter=on,derived_merge=on,use_invisible_indexes=off,skip_scan=on,hash_join=on,subquery_to_derived=off,prefer_ordering_index=on,hypergraph_optimizer=off,derived_condition_pushdown=on,favor_range_scan=off,remove_useless_outerjoin=off |
| optimizer_trace | enabled=off,one_line=off |
| optimizer_trace_features | greedy_search=on,range_optimizer=on,dynamic_range=on,repeated_subselect=on |
| optimizer_trace_limit | 1 |
| optimizer_trace_max_mem_size | 1048576 |
| optimizer_trace_offset | -1 |
| parallel_cost_threshold | 1000 |
| parallel_default_dop | 4 |
| parallel_max_threads | 64 |
| parallel_memory_limit | 104857600 |
| parallel_queue_timeout | 0 |
| parser_max_mem_size | 18446744073709551615 |
| partial_revokes | OFF |
| password_history | 0 |
| password_require_current | OFF |
| password_reuse_interval | 0 |
| performance_schema | ON |
| performance_schema_accounts_size | -1 |
| performance_schema_digests_size | 10000 |
| performance_schema_error_size | 5428 |
| performance_schema_events_stages_history_long_size | 10000 |
| performance_schema_events_stages_history_size | 10 |
| performance_schema_events_statements_history_long_size | 10000 |
| performance_schema_events_statements_history_size | 10 |
| performance_schema_events_transactions_history_long_size | 10000 |
| performance_schema_events_transactions_history_size | 10 |
| performance_schema_events_waits_history_long_size | 10000 |
| performance_schema_events_waits_history_size | 10 |
| performance_schema_hosts_size | -1 |
| performance_schema_max_cond_classes | 150 |
| performance_schema_max_cond_instances | -1 |
| performance_schema_max_digest_length | 1024 |
| performance_schema_max_digest_sample_age | 60 |
| performance_schema_max_file_classes | 80 |
| performance_schema_max_file_handles | 32768 |
| performance_schema_max_file_instances | -1 |
| performance_schema_max_index_stat | -1 |
| performance_schema_max_memory_classes | 530 |
| performance_schema_max_metadata_locks | -1 |
| performance_schema_max_mutex_classes | 350 |
| performance_schema_max_mutex_instances | -1 |
| performance_schema_max_prepared_statements_instances | -1 |
| performance_schema_max_program_instances | -1 |
| performance_schema_max_rwlock_classes | 70 |
| performance_schema_max_rwlock_instances | -1 |
| performance_schema_max_socket_classes | 10 |
| performance_schema_max_socket_instances | -1 |
| performance_schema_max_sql_text_length | 1024 |
| performance_schema_max_stage_classes | 175 |
| performance_schema_max_statement_classes | 258 |
| performance_schema_max_statement_stack | 10 |
| performance_schema_max_table_handles | -1 |
| performance_schema_max_table_instances | -1 |
| performance_schema_max_table_lock_stat | -1 |
| performance_schema_max_thread_classes | 100 |
| performance_schema_max_thread_instances | -1 |
| performance_schema_session_connect_attrs_size | 512 |
| performance_schema_setup_actors_size | -1 |
| performance_schema_setup_objects_size | -1 |
| performance_schema_show_processlist | OFF |
| performance_schema_users_size | -1 |
| persist_only_admin_x509_subject | |
| persist_sensitive_variables_in_plaintext | ON |
| persisted_globals_load | ON |
| pid_file | mysql.pid |
| plugin_dir | /usr/lib64/mysql/plugin/ |
| port | 3306 |
| preload_buffer_size | 32768 |
| print_identified_with_as_hex | OFF |
| private_temp_table_prefix | ORA$PTT_ |
| profiling | OFF |
| profiling_history_size | 15 |
| protocol_compression_algorithms | zlib,zstd,uncompressed |
| protocol_version | 10 |
| proxy_protocol_networks | |
| query_alloc_block_size | 8192 |
| query_prealloc_size | 8192 |
| range_alloc_block_size | 4096 |
| range_optimizer_max_mem_size | 8388608 |
| rbr_exec_mode | STRICT |
| read_buffer_size | 8388608 |
| read_only | OFF |
| read_rnd_buffer_size | 4194304 |
| regexp_stack_limit | 8000000 |
| regexp_time_limit | 32 |
| relay_log | greatsql-0-relay-bin |
| relay_log_basename | /data/GreatSQL/greatsql-0-relay-bin |
| relay_log_index | /data/GreatSQL/greatsql-0-relay-bin.index |
| relay_log_info_file | relay-log.info |
| relay_log_info_repository | TABLE |
| relay_log_purge | ON |
| relay_log_recovery | ON |
| relay_log_space_limit | 0 |
| replica_allow_batching | ON |
| replica_checkpoint_group | 512 |
| replica_checkpoint_period | 2 |
| replica_compressed_protocol | OFF |
| replica_enable_event | |
| replica_exec_mode | STRICT |
| replica_load_tmpdir | /tmp |
| replica_max_allowed_packet | 1073741824 |
| replica_net_timeout | 60 |
| replica_parallel_type | LOGICAL_CLOCK |
| replica_parallel_workers | 8 |
| replica_pending_jobs_size_max | 134217728 |
| replica_preserve_commit_order | ON |
| replica_skip_errors | OFF |
| replica_sql_verify_checksum | ON |
| replica_transaction_retries | 10 |
| replica_type_conversions | |
| replicate_server_mode | OFF |
| replication_optimize_for_static_plugin_config | OFF |
| replication_sender_observe_commit_only | OFF |
| report_host | 192.168.10.130 |
| report_password | |
| report_port | 3306 |
| report_user | |
| require_secure_transport | OFF |
| rpl_read_size | 8192 |
| rpl_stop_replica_timeout | 31536000 |
| rpl_stop_slave_timeout | 31536000 |
| schema_definition_cache | 256 |
| secondary_engine_cost_threshold | 100000.000000 |
| secondary_engine_parallel_load_workers | 4 |
| secondary_engine_read_delay_gtid_threshold | 100 |
| secondary_engine_read_delay_level | TABLE_START_INC_TASK |
| secondary_engine_read_delay_time_threshold | 60 |
| secondary_engine_read_delay_wait_mode | WAIT_FOR_TRX |
| secondary_engine_read_delay_wait_timeout | 60 |
| secure_file_priv | /data/GreatSQL/ |
| secure_log_path | |
| select_bulk_into_batch | 10000 |
| select_into_buffer_size | 131072 |
| select_into_disk_sync | OFF |
| select_into_disk_sync_delay | 0 |
| server_id | 10000 |
| server_id_bits | 32 |
| server_uuid | dde013cd-ddf5-11ee-976d-5eeddfa676bc |
| serveroutput | OFF |
| session_track_gtids | OFF |
| session_track_schema | ON |
| session_track_state_change | OFF |
| session_track_system_variables | time_zone,autocommit,character_set_client,character_set_results,character_set_connection |
| session_track_transaction_info | OFF |
| sha256_password_auto_generate_rsa_keys | ON |
| sha256_password_private_key_path | private_key.pem |
| sha256_password_proxy_users | OFF |
| sha256_password_public_key_path | public_key.pem |
| show_create_table_verbosity | OFF |
| show_gipk_in_create_table_and_information_schema | ON |
| show_old_temporals | OFF |
| shrink_sql_mode | |
| skip_external_locking | ON |
| skip_name_resolve | ON |
| skip_networking | OFF |
| skip_replica_start | OFF |
| skip_show_database | OFF |
| skip_slave_start | OFF |
| slave_allow_batching | ON |
| slave_checkpoint_group | 512 |
| slave_checkpoint_period | 2 |
| slave_compressed_protocol | OFF |
| slave_exec_mode | STRICT |
| slave_load_tmpdir | /tmp |
| slave_max_allowed_packet | 1073741824 |
| slave_net_timeout | 60 |
| slave_parallel_type | LOGICAL_CLOCK |
| slave_parallel_workers | 8 |
| slave_pending_jobs_size_max | 134217728 |
| slave_preserve_commit_order | ON |
| slave_rows_search_algorithms | INDEX_SCAN,HASH_SCAN |
| slave_skip_errors | OFF |
| slave_sql_verify_checksum | ON |
| slave_transaction_retries | 10 |
| slave_type_conversions | |
| slow_launch_time | 2 |
| slow_query_log | ON |
| slow_query_log_always_write_time | 10.000000 |
| slow_query_log_file | /data/GreatSQL/slow.log |
| slow_query_log_use_global_control | |
| socket | /data/GreatSQL/mysql.sock |
| sort_buffer_size | 4194304 |
| source_verify_checksum | OFF |
| sql_auto_is_null | OFF |
| sql_big_selects | ON |
| sql_buffer_result | OFF |
| sql_generate_invisible_primary_key | OFF |
| sql_log_off | OFF |
| sql_mode | ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION |
| sql_notes | ON |
| sql_quote_show_create | ON |
| sql_replica_skip_counter | 0 |
| sql_require_primary_key | OFF |
| sql_safe_updates | OFF |
| sql_select_limit | 18446744073709551615 |
| sql_slave_skip_counter | 0 |
| sql_warnings | OFF |
| ssl_ca | ca.pem |
| ssl_capath | |
| ssl_cert | server-cert.pem |
| ssl_cipher | |
| ssl_crl | |
| ssl_crlpath | |
| ssl_fips_mode | OFF |
| ssl_key | server-key.pem |
| ssl_session_cache_mode | ON |
| ssl_session_cache_timeout | 300 |
| stored_program_cache | 256 |
| stored_program_definition_cache | 256 |
| super_read_only | OFF |
| sync_binlog | 1 |
| sync_master_info | 10000 |
| sync_relay_log | 10000 |
| sync_relay_log_info | 10000 |
| sync_source_info | 10000 |
| system_time_zone | UTC |
| table_definition_cache | 1024 |
| table_encryption_privilege_check | OFF |
| table_open_cache | 1024 |
| table_open_cache_instances | 16 |
| table_open_cache_triggers | 524288 |
| tablespace_definition_cache | 256 |
| temptable_max_mmap | 1073741824 |
| temptable_max_ram | 1073741824 |
| temptable_use_mmap | ON |
| terminology_use_previous | NONE |
| tf_sequence_table_max_upper_bound | 1048576 |
| tf_udt_table_max_rows | 1048576 |
| thread_cache_size | 768 |
| thread_handling | one-thread-per-connection |
| thread_pool_high_prio_mode | transactions |
| thread_pool_high_prio_tickets | 4294967295 |
| thread_pool_idle_timeout | 60 |
| thread_pool_max_threads | 100000 |
| thread_pool_oversubscribe | 3 |
| thread_pool_size | 4 |
| thread_pool_stall_limit | 500 |
| thread_stack | 524288 |
| thread_statistics | OFF |
| time_zone | +00:00 |
| tls_ciphersuites | |
| tls_version | TLSv1.2,TLSv1.3 |
| tmp_table_size | 33554432 |
| tmpdir | /tmp |
| transaction_alloc_block_size | 8192 |
| transaction_isolation | REPEATABLE-READ |
| transaction_prealloc_size | 4096 |
| transaction_read_only | OFF |
| transaction_write_set_extraction | XXHASH64 |
| unique_checks | ON |
| updatable_views_with_limit | YES |
| userstat | OFF |
| version | 8.0.32-25 |
| version_comment | GreatSQL (GPL), Release 25, Revision 79f57097e3f |
| version_compile_machine | x86_64 |
| version_compile_os | Linux |
| version_compile_zlib | 1.2.13 |
| version_suffix | |
| wait_timeout | 600 |
| windowing_use_high_precision | ON |
| xa_detach_on_prepare | ON |
+--------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
```
请尝试用默认参数方式启动对比看看,这是我的过程
宿主环境:
$ cat /etc/os-release
NAME="CentOS Linux"
VERSION="8"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="8"
PLATFORM_ID="platform:el8"
PRETTY_NAME="CentOS Linux 8"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:8"
HOME_URL="https://centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-8"
CENTOS_MANTISBT_PROJECT_VERSION="8"
$ uname -r
4.18.0-305.19.1.el8_4.x86_64
启动方式:
$ docker run -itd --name=t1 greatsql/greatsql:8.0.32-25
容器中top观察结果:
PID USER PRNI VIRT RES SHR S%CPU%MEM TIME+ COMMAND
1 mysql 20 0 2753176 43752443264 S 0.0 0.7 0:04.14 mysqld
如果是想测试在Docker环境中跑GreatSQL MGR,可以参考这个项目
https://gitee.com/GreatSQL/GreatSQL-Docker/tree/master/GreatSQL/docker-compose
如果想指定外部my.cnf文件,修改yaml文件,增加volumes属性,类似下面方式指定即可
image: greatsql/greatsql
volumes:
- ./my-02.cnf:/etc/my.cnf
container_name: mgr02 #设定容器名字
已解决。
在启动的时候,先把这个参数设置成OFF
loose-group_replication_start_on_boot = OFF
在mgr集群设置成功后,再改成ON
loose-group_replication_start_on_boot = ON passio 发表于 2024-3-11 09:14
已解决。
在启动的时候,先把这个参数设置成OFF
谢谢反馈,在还没完成MGR初始化前,是不能设置 group_replication_start_on_boot=ON 的,要不然会反复重试启动MGR yejr 发表于 2024-3-11 10:42
谢谢反馈,在还没完成MGR初始化前,是不能设置 group_replication_start_on_boot=ON 的,要不然会反复重 ...
参考了,docker镜像里面的配置文件,那里面是ON passio 发表于 2024-3-12 17:01
参考了,docker镜像里面的配置文件,那里面是ON
GreatSQL Docker参考的配置文件是这份 https://gitee.com/GreatSQL/GreatSQL-Docker/blob/master/GreatSQL/my.cnf
其中的 group_replication_start_on_boot 做成了可替换变量:
loose-group_replication_start_on_boot = START_MGR
只有当您在初始化时指定 -e MYSQL_INIT_MGR=1 才会设置为 ON,否则是 OFF,详见处理逻辑 https://gitee.com/GreatSQL/GreatSQL-Docker/blob/master/GreatSQL/greatsql-init.sh#L322
页:
[1]