包含标签 ALL 的文章

Spinnaker_deployment_error

腾讯云coding平台部署错误

Check that the Docker image name above matches the name used in the image field of your manifest.Failing the stage as this is likely a configuration error.

是因为【启动所需制品】下【仓库】的镜像配置和自定义变量【dockerImage】的镜像名不一致。

……

阅读全文

Python处理json数据

一般的场景是这样:

标准的json(接口返回的) ==>(需要转换成) Python字典, 用json.loads

python字典格式  ==>(需要转换成) 标准的json, 用json.dumps

Python处理json的函数有四个:dumps、dump、loads、load

……

阅读全文

Mysql_global_variables(MySQL8.0)

版本: MySQL 8.0

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
/*
-- Query: show global variables
-- Date: 2021-06-09 17:32
-- 更新时间: 2021-06-10
*/
('back_log','151');
('basedir','D:\\mysql-8.0.25-winx64\\');
('big_tables','OFF');
('binlog_cache_size','32768');

('binlog_checksum','CRC32');
# 设置为CRC32后,binglog文件中每个 event 都会有CRC32 的值
# binlog_checksum支持NONE(disabled)和CRC32这两个值。默认值是CRC32。你不能在一个事务中改变binlog_checksum的值。
# 修改方式: set global binlog_checksum=NONE;

('binlog_direct_non_transactional_updates','OFF');
('binlog_encryption','OFF');
('binlog_error_action','ABORT_SERVER');
('binlog_expire_logs_seconds','2592000');

('innodb_flush_log_at_trx_commit','1');
# redo log 用于保证 crash-safe 能力。innodb_flush_log_at_trx_commit 这个参数设置成 1 的时候,表示每次事务
# 的 redo log都直接持久化到磁盘,这样可以保证 MySQL 异常重启之后数据不丢失。

('binlog_format','ROW');
# binlog_format有三种格式: statement,row, mixed
# statement: binlog里面会记录SQL语句的原文,如果SQL语句有limit,则可能会因为主、从的查询索引不一样导致主从数据不一致
# row: binlog里面记录了真实修改行的主键id,不会出现主从不一致的情况,但在某些场景下会耗费磁盘空间、I/O资源,适合数据恢复场景
# mixed: 意思是,MySQL自己会判断这条SQL语句是否可能引起主备不一致,如果有可能,就用row格式,否则就用statement格式。

('sync_binlog','1');
# 0:默认值。事务提交后,将二进制日志从缓冲写入磁盘,但是不进行刷新操作(fsync()),此时只是写入了操
#    作系统缓冲,若操作系统宕机则会丢失部分二进制日志。
# 1:事务提交后,将二进制文件写入磁盘并立即执行刷新操作,相当于是同步写入磁盘,不经过操作系统的缓存。
# N:每写N次操作系统缓冲就执行一次刷新操作

('slow_query_log','OFF');
# 慢查询开关,set global slow_query_log='ON'开启;

('sql_safe_updates','OFF');
# set global sql_safe_updates=1;  #开启命令
# SET SQL_SAFE_UPDATES = 0;       #关闭命令

('log_queries_not_using_indexes','OFF');
# 未使用索引的查询是否记录到慢查询日志中

('log_raw','OFF');

('log_slave_updates','ON');
# 表示备库执行 relay log 后生成 binlog

('log_slow_admin_statements','OFF');
('log_slow_extra','OFF');
('log_slow_slave_statements','OFF');
('log_statements_unsafe_for_binlog','ON');
('log_throttle_queries_not_using_indexes','0');

('long_query_time','10.000000');
# 慢查询时间,默认为10秒

('low_priority_updates','OFF');
('lower_case_file_system','ON');
('lower_case_table_names','1');
('master_info_repository','TABLE');
('master_verify_checksum','OFF');

('max_allowed_packet','67108864');
# ERROR 2006 (HY000): MySQL server has gone away No connection. Trying to reconnect...
# 将此值设置大些: set global max_allowed_packet=100M 

tx_isolation
#事务隔离级别

('innodb_io_capacity','200');
# 根据磁盘iops设置

('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中是否包含所有字段的值。如果把 binlog_row_image 设置为 MINIMAL,则只会记录必要的信息,

('binlog_row_metadata','MINIMAL');
('binlog_row_value_options','');
('binlog_rows_query_log_events','OFF');
('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','COMMIT_ORDER');
('block_encryption_mode','aes-128-ecb');
('bulk_insert_buffer_size','8388608');
('check_proxy_users','OFF');
('completion_type','NO_CHAIN');
('concurrent_insert','AUTO');
('connect_timeout','10');
('core_file','OFF');
('create_admin_listener_thread','OFF');
('cte_max_recursion_depth','1000');
('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');
('disconnect_on_expired_password','ON');
('div_precision_increment','4');
('end_markers_in_json','OFF');
('enforce_gtid_consistency','OFF');
('eq_range_index_dive_limit','200');
('event_scheduler','ON');
('expire_logs_days','0');
('explicit_defaults_for_timestamp','ON');
('flush','OFF');
('flush_time','0');
('foreign_key_checks','ON');
('ft_max_word_len','84');
('ft_min_word_len','4');
('ft_query_expansion_limit','20');
('ft_stopword_file','(built-in)');
('general_log','OFF');
('general_log_file','D:\\mysql-8.0.25-winx64\\data\\DESKTOP-D4DB1RU.log');
('generated_random_password_length','20');
('group_concat_max_len','1024');
('group_replication_consistency','EVENTUAL');
('gtid_executed','');
('gtid_executed_compression_period','0');
('gtid_mode','OFF');
('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_statement_timeout','YES');
('have_symlink','DISABLED');
('histogram_generation_max_mem_size','20000000');
('host_cache_size','279');
('hostname','DESKTOP-D4DB1RU');
('information_schema_stats_expiry','86400');
('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');
# 表示 change buffer 的大小最多只能占用 buffer pool 的 25%。
# 详细解释: https://time.geekbang.org/column/article/70848

('innodb_change_buffering','all');
('innodb_cmp_per_index_enabled','OFF');
('innodb_commit_concurrency','0');
('innodb_compression_failure_threshold_pct','5');
('innodb_compression_level','6');
('innodb_compression_pad_pct_max','50');
('innodb_concurrency_tickets','5000');
('innodb_data_file_path','ibdata1:12M:autoextend');

('innodb_deadlock_detect','ON');
# 发起死锁检测,发现死锁后,主动回滚死锁链条中的某一个事务,让其他事务得以继续执行

('innodb_dedicated_server','OFF');
('innodb_default_row_format','dynamic');
('innodb_disable_sort_file_cache','OFF');
('innodb_doublewrite','ON');
('innodb_doublewrite_batch_size','0');
('innodb_doublewrite_files','2');
('innodb_doublewrite_pages','4');
('innodb_extend_and_initialize','ON');
('innodb_fast_shutdown','1');

('innodb_file_per_table','ON');
# 参考地址: 
# https://time.geekbang.org/column/article/72388

('innodb_fill_factor','100');
('innodb_flush_log_at_timeout','1');
('innodb_flush_method','unbuffered');
('innodb_flush_neighbors','0');
('innodb_flush_sync','ON');
('innodb_flushing_avg_loops','30');
('innodb_force_load_corrupted','OFF');
('innodb_force_recovery','0');
('innodb_fsync_threshold','0');
('innodb_ft_cache_size','8000000');
('innodb_ft_enable_diag_print','OFF');
('innodb_ft_enable_stopword','ON');
('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_sort_pll_degree','2');
('innodb_ft_total_cache_size','640000000');
('innodb_idle_flush_pct','100');

('innodb_io_capacity_max','2000');
# 它会告诉 InnoDB 你的磁盘能力。这个值我建议你设置成磁盘的 IOPS
# https://time.geekbang.org/column/article/71806

('innodb_lock_wait_timeout','50');
# 锁等待超时时间,单位秒

('innodb_log_buffer_size','16777216');
('innodb_log_checksums','ON');
('innodb_log_compressed_pages','ON');
('innodb_log_file_size','50331648');
('innodb_log_files_in_group','2');
('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','1024');
('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','1073741824');
('innodb_old_blocks_pct','37');
('innodb_old_blocks_time','1000');
('innodb_online_alter_log_max_size','134217728');
('innodb_open_files','4000');
('innodb_optimize_fulltext_only','OFF');
('innodb_page_cleaners','1');
('innodb_page_size','16384');
('innodb_parallel_read_threads','4');
('innodb_print_all_deadlocks','OFF');
('innodb_print_ddl_logs','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_redo_log_encrypt','OFF');
('innodb_replication_delay','0');
('innodb_rollback_on_timeout','OFF');
('innodb_rollback_segments','128');
('innodb_sort_buffer_size','1048576');
('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','OFF');
('innodb_strict_mode','ON');
('innodb_sync_array_size','1');
('innodb_sync_spin_loops','30');
('innodb_table_locks','ON');
('innodb_temp_data_file_path','ibtmp1:12M:autoextend');
('innodb_thread_concurrency','0');
('innodb_thread_sleep_delay','10000');
('innodb_undo_log_encrypt','OFF');
('innodb_undo_log_truncate','ON');
('innodb_undo_tablespaces','2');
('innodb_use_native_aio','ON');
('innodb_validate_tablespace_paths','ON');
('innodb_write_io_threads','4');
('interactive_timeout','28800');
('internal_tmp_mem_storage_engine','TempTable');

('join_buffer_size','262144');
# join_buffer_size 越大,一次可以放入的行越多,分成的段数也就越少,对被驱动表的全表扫描次数就越少

('keep_files_on_create','OFF');
('large_files_support','ON');
('large_page_size','0');
('large_pages','OFF');
('lock_wait_timeout','31536000');
('log_bin','ON');
('log_bin_basename','D:\\mysql-8.0.25-winx64\\data\\binlog');
('log_bin_index','D:\\mysql-8.0.25-winx64\\data\\binlog.index');
('log_bin_trust_function_creators','OFF');
('log_bin_use_v1_row_events','OFF');
('log_error','D:\\mysql-8.0.25-winx64\\data\\DESKTOP-D4DB1RU.err');
('log_error_services','log_filter_internal; log_sink_internal');
('log_error_verbosity','2');
('log_output','FILE');

('max_binlog_cache_size','18446744073709547520');
# 用于控制单个线程内 binlog cache 所占内存的大小。如果超过了这个参数规定的大小,就要暂存到磁盘。

('max_binlog_size','1073741824');
('max_binlog_stmt_cache_size','18446744073709547520');
('max_connect_errors','100');
('max_connections','151');
('max_delayed_threads','20');
('max_digest_length','1024');
('max_error_count','1024');
('max_execution_time','0');
('max_heap_table_size','16777216');
('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','4294967295');
('max_sort_length','1024');
('max_sp_recursion_depth','0');
('max_user_connections','0');
('max_write_lock_count','4294967295');
('min_examined_row_limit','0');
('myisam_data_pointer_size','6');
('myisam_max_sort_file_size','2146435072');
('myisam_mmap_size','18446744073709551615');
('myisam_recover_options','OFF');
('myisam_repair_threads','1');
('myisam_sort_buffer_size','8388608');
('myisam_stats_method','nulls_unequal');
('myisam_use_mmap','OFF');
('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_open_timeout','0');
('mysqlx_read_timeout','30');
('mysqlx_wait_timeout','28800');
('mysqlx_write_timeout','60');
('mysqlx_zstd_default_compression_level','3');
('mysqlx_zstd_max_client_compression_level','11');
('named_pipe','OFF');
('net_buffer_length','16384');
('net_read_timeout','30');
('net_retry_count','10');
('net_write_timeout','60');
('ngram_token_size','2');
('offline_mode','OFF');
('old_alter_table','OFF');
('open_files_limit','10209');
('optimizer_prune_level','1');
('optimizer_search_depth','62');
('optimizer_trace','enabled=off,one_line=off');
('optimizer_trace_limit','1');
('optimizer_trace_max_mem_size','1048576');
('optimizer_trace_offset','-1');
('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','4890');
('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','100');
('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','450');
('performance_schema_max_metadata_locks','-1');
('performance_schema_max_mutex_classes','300');
('performance_schema_max_mutex_instances','-1');
('performance_schema_max_prepared_statements_instances','-1');
('performance_schema_max_program_instances','-1');
('performance_schema_max_rwlock_classes','60');
('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','218');
('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');
('persisted_globals_load','ON');
('pid_file','D:\\mysql-8.0.25-winx64\\data\\DESKTOP-D4DB1RU.pid');
('preload_buffer_size','32768');
('print_identified_with_as_hex','OFF');
('profiling','OFF');
('profiling_history_size','15');
('protocol_compression_algorithms','zlib,zstd,uncompressed');
('protocol_version','10');
('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','131072');
('read_only','OFF');

('read_rnd_buffer_size','262144');
# read_rnd_buffer 的大小,用于MRR 优化

('regexp_stack_limit','8000000');
('regexp_time_limit','32');
('relay_log','DESKTOP-D4DB1RU-relay-bin');
('relay_log_basename','D:\\mysql-8.0.25-winx64\\data\\DESKTOP-D4DB1RU-relay-bin');
('relay_log_index','D:\\mysql-8.0.25-winx64\\data\\DESKTOP-D4DB1RU-relay-bin.index');
('relay_log_info_file','relay-log.info');
('relay_log_info_repository','TABLE');
('relay_log_purge','ON');
('relay_log_recovery','OFF');
('relay_log_space_limit','0');
('replication_optimize_for_static_plugin_config','OFF');
('replication_sender_observe_commit_only','OFF');
('require_secure_transport','OFF');
('rpl_read_size','8192');
('rpl_stop_slave_timeout','31536000');
('schema_definition_cache','256');
('secondary_engine_cost_threshold','100000.000000');

('secure_file_priv','NULL');
# 如果设置为 empty,表示不限制文件生成的位置,这是不安全的设置;
# 如果设置为一个表示路径的字符串,就要求生成的文件只能放在这个指定的目录,或者它的子目录;
# 如果设置为 NULL,就表示禁止在这个 MySQL 实例上执行 select … into outfile 操作。

('select_into_buffer_size','131072');
('select_into_disk_sync','OFF');
('select_into_disk_sync_delay','0');
('server_id','1');
('server_id_bits','32');
('server_uuid','f9fbf9f9-bc38-11eb-8231-00ff44c1d31a');
('show_create_table_verbosity','OFF');
('show_old_temporals','OFF');
('skip_external_locking','ON');
('skip_name_resolve','OFF');
('skip_networking','OFF');
('skip_show_database','OFF');
('skip_slave_start','OFF');
('slave_allow_batching','OFF');
('slave_checkpoint_group','512');
('slave_checkpoint_period','300');
('slave_compressed_protocol','OFF');
('slave_exec_mode','STRICT');
('slave_load_tmpdir','C:\\WINDOWS\\TEMP');
('slave_max_allowed_packet','1073741824');
('slave_net_timeout','60');
('slave_parallel_type','DATABASE');
# 来控制并行复制策略:配置为 DATABASE,表示使用 MySQL 5.6 版本的按库并行策略;
# 配置为 LOGICAL_CLOCK,表示的就是类似 MariaDB 的策略。

('slave_parallel_workers','0');
# work 线程的个数,是slave用于更新relay log中的日志

('slave_pending_jobs_size_max','134217728');
('slave_preserve_commit_order','OFF');
('slave_rows_search_algorithms','INDEX_SCAN,HASH_SCAN');
('slave_skip_errors','OFF');
('slave_sql_verify_checksum','ON');
('slave_transaction_retries','10');
('slow_launch_time','2');
('slow_query_log_file','D:\\mysql-8.0.25-winx64\\data\\DESKTOP-D4DB1RU-slow.log');
('sort_buffer_size','262144');
('sql_auto_is_null','OFF');
('sql_big_selects','ON');
('sql_buffer_result','OFF');
('sql_log_off','OFF');
('sql_require_primary_key','OFF');
('sql_slave_skip_counter','0');
('sql_warnings','OFF');
('stored_program_cache','256');
('stored_program_definition_cache','256');
('super_read_only','OFF');
('sync_master_info','10000');
('sync_relay_log','10000');
('sync_relay_log_info','10000');
('table_definition_cache','2000');
('table_encryption_privilege_check','OFF');
('table_open_cache','4000');
('table_open_cache_instances','16');
('tablespace_definition_cache','256');
('temptable_max_mmap','1073741824');
('temptable_max_ram','1073741824');
('temptable_use_mmap','ON');
('thread_cache_size','9');
('thread_handling','one-thread-per-connection');
('thread_stack','286720');
('tmp_table_size','16777216');
('transaction_alloc_block_size','8192');

('transaction_isolation','REPEATABLE-READ');
# 事务隔离级别,默认是RR可重复读

('transaction_prealloc_size','4096');
('transaction_read_only','OFF');
('unique_checks','ON');
('updatable_views_with_limit','YES');

('wait_timeout','28800');
# 连接超时时间,单位秒,默认8小时
# 连接被断开之后,客户端再发送请求就会收到错误:Lost connection to MySQL server during query

('windowing_use_high_precision','ON');

autocommit, 'ON';
# 自动提交,
# 关闭自动提交: set autocommit=0;
……

阅读全文

MySQL用户权限汇总

一、 全局权限,作用于整个 MySQL 实例:mysql.user表

mysql> select Host,User,Select_priv,Insert_priv,Update_priv,Delete_priv,Create_priv , Drop_priv from mysql.user;
+-------------+------------------+-------------+-------------+-------------+-------------+-------------+-----------+
| Host        | User             | Select_priv | Insert_priv | Update_priv | Delete_priv | Create_priv | Drop_priv |
+-------------+------------------+-------------+-------------+-------------+-------------+-------------+-----------+
| %           | lang             | Y           | Y           | Y           | Y           | N           | N         |
| 192.168.2.% | lang             | Y           | Y           | Y           | Y           | N           | N         |
| localhost   | mysql.infoschema | Y           | N           | N           | N           | N           | N         |
| localhost   | mysql.session    | N           | N           | N           | N           | N           | N         |
| localhost   | mysql.sys        | N           | N           | N           | N           | N           | N         |
| localhost   | root             | Y           | Y           | Y           | Y           | Y           | Y         |
+-------------+------------------+-------------+-------------+-------------+-------------+-------------+-----------+
6 rows in set (0.00 sec)

二、 库级别的权限定义:mysql.db表

某个账号对某个库所拥有的权限,如下第一行结果表示用户’lang’对库’lang_test’所拥有的权限

……

阅读全文

Deployment yaml模板

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: ${APP_NAME}
    environment: ${RUN_ENV}
  name: ${APP_NAME}
  namespace: ${NAMESPACE}
spec:
  progressDeadlineSeconds: 600
  replicas: ${REPLICAS}
  selector:
    matchLabels:
      app: ${APP_NAME}
      environment: ${RUN_ENV}
  template:
    metadata:
      labels:
        app: ${APP_NAME}
        environment: ${RUN_ENV}
      annotations:
        prometheus.io/scrape: "${ENABLE_SCRAPE}"
        prometheus.io/port: "${RUN_PORT}"
        prometheus.io/path: "${METRICS_PATH}"
        kubesphere.io/collectSavedLog: 'true'
        logging.kubesphere.io/logsidecar-config: '{"containerLogConfigs":{"${APP_NAME}":{"${APP_NAME}-log-volume":["*.log"]}}}'
    spec:
      volumes:
        - name: ${APP_NAME}-log-volume
          emptyDir: {}
        - name: heap-dumps
          emptyDir: {}
      containers:
        - name: ${APP_NAME}
          env:
            - name: JAVA_OPTS
              value: -server -Dapp.id=${APP_NAME} -Denv=${RUN_ENV} -Dapollo.cacheDir=/services/apollo -Dspring.profiles.active=${RUN_ENV} -Xms${HEAP_XMS} -Xmx${HEAP_XMX} -Xss512k -XX:ParallelGCThreads=4 -XX:+UseG1GC -XX:MaxGCPauseMillis=200 -XX:InitiatingHeapOccupancyPercent=45 -Xlog:gc* -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/dumper -Dsun.net.inetaddr.ttl=60 -XX:+ScavengeBeforeFullGC -XX:+CMSScavengeBeforeRemark -Dcom.sun.management.jmxremote.port=19185 -Dtomcat.base=/services/tomcat -Dio.netty.tryReflectionSetAccessible=true --add-exports java.base/jdk.internal.misc=ALL-UNNAMED -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dlog.base=/services/logs/  -verbose:gc -Xdebug -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:19085
          image: $REGISTRY/$DOCKERHUB_NAMESPACE/$APP_NAME:${RUN_ENV}-${BRANCH_NAME}-${COMMIT_HASH}-$DATE-${BUILD_NUMBER}
          lifecycle:
            postStart:
              exec:
                command:
                  - "sh"
                  - "-c"
                  - >
                    wget -P /services/  http://192.168.0.169:12306/download/finch.jar;
                    nohup java -Dapp.id=finch -Denv=${RUN_ENV} -jar /services/finch.jar &
          volumeMounts:
            - mountPath: "/services/logs/"
              name: ${APP_NAME}-log-volume
            - mountPath: /dumper
              name: heap-dumps
          livenessProbe:
            httpGet:
              path: ${HEALTH_PATH}
              port: ${RUN_PORT}
            initialDelaySeconds: 60
            periodSeconds: 30
            timeoutSeconds: 3
            successThreshold: 1
            failureThreshold: 10
          readinessProbe:
            httpGet:
              path: ${HEALTH_PATH}
              port: ${RUN_PORT}
            initialDelaySeconds: 60
            periodSeconds: 30
            successThreshold: 1
            failureThreshold: 10
          imagePullPolicy: IfNotPresent
          ports:
            - containerPort: ${RUN_PORT}
              protocol: TCP
          resources:
            limits:
              cpu: ${LIMIT_CPU}
              memory: ${LIMIT_MEMORY}
            requests:
              cpu: ${REQUEST_CPU}
              memory: ${REQUEST_MEMORY}
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
          securityContext:
            runAsUser: 5000
            runAsGroup: 5000
            allowPrivilegeEscalation: false
        - name: dumper
          image: 'harbor.m.cn/library/dumper:1.96'
          env:
            - name: COS_BUCKETURL
              value: 'https://jvm-dump.cos.ap-guangzhou.myqcloud.com'
            - name: COS_DUMPER_ROOT
              value: /
            - name: APP_NAME
              value: ${APP_NAME}
            - name: DUMPER_ROOT
              value: /dumper/
            - name: RUN_ENV_NAME
              value: ${RUN_ENV}
          resources:
            limits:
              cpu: 4000m
              memory: 4000Mi
            requests:
              cpu: 1000m
              memory: 1000Mi
          volumeMounts:
            - name: heap-dumps
              mountPath: /dumper
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
          imagePullPolicy: IfNotPresent            
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      terminationGracePeriodSeconds: 30
      imagePullSecrets:
      - name: ${IMAGE_PULL_SECRETS}
      ```
……

阅读全文