diff --git a/addons-cluster/apecloud-mysql/templates/cluster.yaml b/addons-cluster/apecloud-mysql/templates/cluster.yaml index 301f3fcfa..e873802b9 100644 --- a/addons-cluster/apecloud-mysql/templates/cluster.yaml +++ b/addons-cluster/apecloud-mysql/templates/cluster.yaml @@ -5,7 +5,6 @@ metadata: namespace: {{ .Release.Namespace }} labels: {{ include "kblib.clusterLabels" . | nindent 4 }} - auditLogEnabled: "{{ .Values.auditLogEnabled }}" {{- if and (eq .Values.mode "raftGroup") .Values.proxyEnabled }} annotations: kubeblocks.io/extra-env: '{"KB_PROXY_ENABLED":"on","ETCDCTL_API": "{{ .Values.etcd.etcdctlApi}}"}' diff --git a/addons-cluster/apecloud-mysql/values.yaml b/addons-cluster/apecloud-mysql/values.yaml index 5cca8c87c..d7589bbca 100644 --- a/addons-cluster/apecloud-mysql/values.yaml +++ b/addons-cluster/apecloud-mysql/values.yaml @@ -44,9 +44,6 @@ proxyEnabled: false ## if mode is raftGroup, localEtcdEnabled can be true localEtcdEnabled: false -## @param auditLogEnabled if true, enable audit log in apecloud mysql -auditLogEnabled: false - proxy: storageClassName: "" diff --git a/addons/apecloud-mysql/config/mysql8-config-constraint.cue b/addons/apecloud-mysql/config/mysql8-config-constraint.cue index 0ac0e6c7c..c84a2a30c 100644 --- a/addons/apecloud-mysql/config/mysql8-config-constraint.cue +++ b/addons/apecloud-mysql/config/mysql8-config-constraint.cue @@ -1533,7 +1533,70 @@ wait_timeout?: int & >=1 & <=31536000 // For SQL window functions, determines whether to enable inversion optimization for moving window frames also for floating values. - windowing_use_high_precision: string & "0" | "1" | "OFF" | "ON" | *"1" + windowing_use_high_precision?: string & "OFF" | "ON" | *"ON" + + loose_consensus_enabled?: string & "ON" | "OFF" + loose_consensus_io_thread_cnt?: int | *8 + loose_consensus_worker_thread_cnt?: int | *8 + loose_consensus_election_timeout?: int | *1000 + loose_consensus_auto_leader_transfer?: string & "OFF" | "ON" | *"OFF" + loose_consensus_prefetch_window_size?: int | *100 + loose_consensus_auto_reset_match_index?: string & "OFF" | "ON" | *"ON" + loose_cluster_mts_recover_use_index?: string & "ON" | "OFF" + loose_replicate_same_server_id?: string & "ON" | "OFF" + loose_consensus_large_trx?: string & "ON" | "OFF" + loose_consensuslog_revise?: string & "OFF" | "ON" + + authentication_policy?: string + plugin_load_add?: string + + loose_audit_log_handler?: string & "FILE" | "SYSLOG" | *"FILE" + loose_audit_log_file?: string | *"audit.log" + loose_audit_log_buffer_size?: string | *"1Mb" + loose_audit_log_policy?: string & "ALL" | "LOGINS" | "QUERIES" | "NONE" | *"ALL" + loose_audit_log_strategy?: string & "ASYNCHRONOUS" | "PERFORMANCE" | "SEMISYNCHRONOUS" | "SYNCHRONOUS" | *"ASYNCHRONOUS" + loose_audit_log_rotate_on_size?: int | *0 + loose_audit_log_rotations?: int | *0 + loose_audit_log_exclude_accounts?: string + + loose_smartengine_datadir?: string + loose_smartengine_wal_dir?: string + loose_smartengine_flush_log_at_trx_commit?: int + loose_smartengine_enable_2pc?: int + loose_smartengine_batch_group_slot_array_size?: int + loose_smartengine_batch_group_max_group_size?: int + loose_smartengine_batch_group_max_leader_wait_time_us?: int + loose_smartengine_block_size?: int + loose_smartengine_disable_auto_compactions?: int + loose_smartengine_dump_memtable_limit_size?: int + + loose_smartengine_min_write_buffer_number_to_merge?: int + loose_smartengine_level0_file_num_compaction_trigger?: int + loose_smartengine_level0_layer_num_compaction_trigger?: int + loose_smartengine_level1_extents_major_compaction_trigger?: int + loose_smartengine_level2_usage_percent?: int + loose_smartengine_flush_delete_percent?: int + loose_smartengine_compaction_delete_percent?: int + loose_smartengine_flush_delete_percent_trigger?: int + loose_smartengine_flush_delete_record_trigger?: int + loose_smartengine_scan_add_blocks_limit?: int + + loose_smartengine_compression_per_level?: string + loose_smartengine_write_buffer_size?: int + loose_smartengine_db_write_buffer_size?: int + loose_smartengine_db_total_write_buffer_size?: int + loose_smartengine_block_cache_size?: int + loose_smartengine_row_cache_size?: int + loose_smartengine_max_total_wal_size?: int + + loose_smartengine_max_background_flushes?: int + loose_smartengine_base_background_compactions?: int + loose_smartengine_max_background_compactions?: int + + innodb_redo_log_capacity?: int + binlog_purge_size?: string + log_replica_updates?: int + mysqlx?: int } // SectionName is section name diff --git a/addons/apecloud-mysql/config/mysql8-config.tpl b/addons/apecloud-mysql/config/mysql8-config.tpl index d247e7476..d057fa864 100644 --- a/addons/apecloud-mysql/config/mysql8-config.tpl +++ b/addons/apecloud-mysql/config/mysql8-config.tpl @@ -90,7 +90,7 @@ connect_timeout=10 # character-sets-dir=/usr/share/mysql-8.0/charsets port={{ $mysql_port }} -mysqlx-port=33060 +mysqlx_port=33060 mysqlx=0 datadir={{ $data_root }}/data @@ -105,9 +105,8 @@ slow_query_log_file=/data/mysql/log/mysqld-slowquery.log general_log=OFF general_log_file=/data/mysql/log/mysqld.log -{{- if eq $.cluster.metadata.labels.auditLogEnabled "true" }} # audit log -plugin-load-add=audit_log=audit_log.so +plugin_load_add=audit_log=audit_log.so loose_audit_log_handler=FILE # FILE, SYSLOG loose_audit_log_file={{ $data_root }}/auditlog/audit.log loose_audit_log_buffer_size=1Mb @@ -127,7 +126,6 @@ loose_audit_log_rotations=5 ## | localhost | root | ## +-----------+------------------+ loose_audit_log_exclude_accounts=root@%,root@localhost -{{ end }} #innodb innodb_doublewrite_batch_size=16 @@ -178,7 +176,7 @@ binlog_format=ROW binlog_row_image=FULL # Aliyun AWS binlog_order_commits=ON binlog_order_commits=ON -log-bin={{ $data_root }}/binlog/mysql-bin +log_bin={{ $data_root }}/binlog/mysql-bin log_bin_index={{ $data_root }}/binlog/mysql-bin.index binlog_expire_logs_seconds=604800 binlog_purge_size=102400M @@ -194,7 +192,7 @@ relay_log_recovery=ON relay_log=relay-bin relay_log_index=relay-bin.index -pid-file=/var/run/mysqld/mysqld.pid +pid_file=/var/run/mysqld/mysqld.pid socket=/var/run/mysqld/mysqld.sock {{- if $.component.tlsConfig }} diff --git a/addons/mysql/config/mysql8-config-constraint.cue b/addons/mysql/config/mysql8-config-constraint.cue index 05022995f..3307befea 100644 --- a/addons/mysql/config/mysql8-config-constraint.cue +++ b/addons/mysql/config/mysql8-config-constraint.cue @@ -1534,6 +1534,10 @@ // For SQL window functions, determines whether to enable inversion optimization for moving window frames also for floating values. windowing_use_high_precision: string & "OFF" | "ON" | *"ON" + + // other parameters + // reference mysql parameters + ... } // SectionName is section name diff --git a/examples/apecloud-mysql/cluster-proxy.yaml b/examples/apecloud-mysql/cluster-proxy.yaml index be0a8e0ff..56a4fa7bf 100644 --- a/examples/apecloud-mysql/cluster-proxy.yaml +++ b/examples/apecloud-mysql/cluster-proxy.yaml @@ -3,8 +3,6 @@ kind: Cluster metadata: name: acmysql-cluster namespace: default - labels: - auditLogEnabled: "false" annotations: kubeblocks.io/extra-env: '{"KB_PROXY_ENABLED":"on","ETCDCTL_API": "3"}' spec: diff --git a/examples/apecloud-mysql/cluster.yaml b/examples/apecloud-mysql/cluster.yaml index 4cf0c2ac0..4db87c91a 100644 --- a/examples/apecloud-mysql/cluster.yaml +++ b/examples/apecloud-mysql/cluster.yaml @@ -3,8 +3,6 @@ kind: Cluster metadata: name: acmysql-cluster namespace: default - labels: - auditLogEnabled: "false" # use this label as switch to set variables 'audit_log_xxx' spec: # Specifies the behavior when a Cluster is deleted. # Valid options are: [DoNotTerminate, Delete, WipeOut] (`Halt` is deprecated since KB 0.9) diff --git a/examples/apecloud-mysql/restore.yaml b/examples/apecloud-mysql/restore.yaml index 5f2dba6b1..e748d96ab 100644 --- a/examples/apecloud-mysql/restore.yaml +++ b/examples/apecloud-mysql/restore.yaml @@ -3,8 +3,6 @@ kind: Cluster metadata: name: acmysql-cluster-restore namespace: default - labels: - auditLogEnabled: "false" annotations: kubeblocks.io/restore-from-backup: '{"mysql":{"encryptedSystemAccounts":"","name":"acmysql-cluster-backup","namespace":"default","volumeRestorePolicy":"Parallel"}}' spec: