璋佽褰曚簡mysql error log涓殑瓒呴暱淇℃伅
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了璋佽褰曚簡mysql error log涓殑瓒呴暱淇℃伅相关的知识,希望对你有一定的参考价值。
鏍囩锛?a href='http://www.mamicode.com/so/1/cas' title='cas'>cas
requests pid return memory MTA error_log 绋嬪簭 void銆愰棶棰樸€?/strong>
鏈€杩戞煡鐪婱ySQL鐨別rror log鏂囦欢鏃讹紝鍙戠幇鏈夊緢澶氭湇鍔″櫒鐨勬枃浠朵腑鏈夊ぇ閲忕殑濡備笅鏃ュ織锛屽唴瀹瑰緢闀匡紙澶у皬鍦?00K宸﹀彸锛夛紝浠庤褰曠殑鍐呭鐪嬶紝骞舵病鏈夋槑鏄剧殑寮傚父淇℃伅銆?/p>
鏈変竴鍙版祴璇曟湇鍔″櫒涔熸湁绫讳技鐨勯棶棰橈紝涓轰粈涔堜細璁板綍杩欎簺淇℃伅锛屾槸璋佽褰曠殑杩欎簺淇℃伅锛屽垎鏋愮殑杩囩▼姣旇緝鍛ㄦ姌銆?/p>
Status information:
Current dir:
Running threads: 2452 Stack size: 262144
Current locks:
lock: 0x7f783f5233f0:
Key caches:
default
Buffer_size: 8388608
Block_size: 1024
Division_limit: 100
Age_limit: 300
blocks used: 10
not flushed: 0
w_requests: 6619
writes: 1
r_requests: 275574
reads: 1235
handler status:
read_key: 32241480828
read_next: 451035381896
read_rnd 149361175
read_first: 1090473
write: 4838429521
delete 12155820
update: 3331297842
銆愬垎鏋愯繃绋嬨€?/strong>
1銆侀鍏堝湪瀹樻柟鏂囨。涓煡鍒帮紝褰搈ysqld杩涚▼鏀跺埌SIGHUP淇″彿閲忔椂锛屽氨浼氳緭鍑虹被浼肩殑淇℃伅锛?/p>
On Unix, signals can be sent to processes. mysqld responds to signals sent to it as follows:
SIGHUP
causes the server to reload the grant tables and to flush tables, logs, the thread cache, and the host cache. These actions are like various forms of the FLUSH
statement. The server also writes a status report to the error log that has this format:
https://dev.mysql.com/doc/refman/5.6/en/server-signal-response.html
2銆佹湁鍒殑绋嬪簭鍦╧ill mysqld杩涚▼鍚楋紝鐢╯ystemtap鑴氭湰鐩戞帶kill鍛戒护
probe nd_syscall.kill
{
target[tid()] = uint_arg(1);
signal[tid()] = uint_arg(2);
}
probe nd_syscall.kill.return
{
if (target[tid()] != 0) {
printf("%-6d %-12s %-5d %-6d %6d ", pid(), execname(),
signal[tid()], target[tid()], int_arg(1));
delete target[tid()];
delete signal[tid()];
}
}
鐢ㄤ笅闈㈠懡浠ゆ祴璇曪紝纭疄浼氬湪error log涓褰曟棩蹇?/p>
kill -SIGHUP 12455
浠巗ystemtap鐨勮緭鍑虹湅鍒?2455灏辨槸mysqld杩涚▼锛岃kill鎺変簡锛屼俊鍙烽噺鏄?锛屽搴旂殑灏辨槸SIGHUP
涓嶈繃鍦ㄦ祴璇曠幆澧冨悗闈㈤棶棰橀噸鐜版椂锛屽嵈娌℃湁鎶撳埌SIGHUP鐨勪俊鍙烽噺銆?/p>
FROM COMMAND SIG TO RESULT
17010 who 0 12153 1340429600
36681 bash 1 12455 642
3銆佺湅鏉ュ苟涓嶆槸kill瀵艰嚧鐨勶紝鍚庨潰鐢╣db attach鍒癿ysqld杩涚▼涓婏紝鍦╡rror log鐨勪笁涓叆鍙e嚱鏁皊ql_print_error锛宻ql_print_warning锛宻ql_print_information鍔犱笂鏂偣
浣嗘槸鍦ㄩ棶棰橀噸鐜版椂锛岀▼搴忓苟娌℃湁鍋滃湪鏂偣澶?/p>
4銆佸啓error log杩樻湁鍒殑鍒嗘敮鍚楋紝缈绘簮鐮佹壘鍒颁簡绛旀锛屽師鏉ユ槸閫氳繃mysql_print_status鍑芥暟鐩存帴鍐欏埌error log涓?/p>
void mysql_print_status()
{
char current_dir[FN_REFLEN];
STATUS_VAR current_global_status_var;
printf(" Status information: ");
(void) my_getwd(current_dir, sizeof(current_dir),MYF(0));
printf("Current dir: %s ", current_dir);
printf("Running threads: %u Stack size: %ld ",
Global_THD_manager::get_instance()->get_thd_count(),
(long) my_thread_stack_size);
鈥?/p>
puts("");
fflush(stdout);
}
5銆佸啀娆$敤gdb attach鍒癿ysqld杩涚▼涓婏紝鍦╩ysql_print_status鍑芥暟涓婂姞鏂偣锛屽湪闂閲嶇幇鏃讹紝绾跨▼鍋滃湪鏂偣澶勶紝閫氳繃ps鐨勭粨鏋滃娆″姣旓紝鍒ゆ柇鏄痯t-stalk宸ュ叿杩愯鏃惰皟鐢ㄤ簡mysql_print_status
6銆佷粠鍫嗘爤涓湅鍒癲ispatch_command璋冪敤浜唌ysql_print_status锛屼笅闈㈡槸鍏蜂綋鐨勯€昏緫锛屽綋command=COM_DEBUG鏃跺氨浼氭墽琛屽埌mysql_print_status
case COM_DEBUG:
thd->status_var.com_other++;
if (check_global_access(thd, SUPER_ACL))
break; /* purecov: inspected */
mysql_print_status();
query_logger.general_log_print(thd, command, NullS);
my_eof(thd);
break;
7銆佹煡鐪媝t-stalk鐨勪唬鐮?/p>
if [ "$mysql_error_log" -a ! "$OPT_MYSQL_ONLY" ]; then
log "The MySQL error log seems to be $mysql_error_log"
tail -f "$mysql_error_log" >"$d/$p-log_error" &
tail_error_log_pid=$!
$CMD_MYSQLADMIN $EXT_ARGV debug
else
log "Could not find the MySQL error log"
鍦ㄨ皟鐢╩ysqladmin鏃朵娇鐢ㄤ簡debug妯″紡
debug Instruct server to write debug information to log
8銆佸湪percona瀹樼綉涓婃悳鍒颁簡鐩稿叧鐨刡ug鎻忚堪锛岀洰鍓峛ug杩樻湭淇锛屼細鍦ㄤ笅涓増鏈腑3.0.13涓慨澶嶃€?/p>
https://jira.percona.com/browse/PT-1340
銆愯В鍐虫柟妗堛€?/strong>
瀹氫綅鍒伴棶棰樺悗锛屽疄闄呬慨澶嶄篃姣旇緝绠€鍗曪紝灏唒t-stalk鑴氭湰涓?CMD_MYSQLADMIN $EXT_ARGV debug涓殑debug鍘绘帀灏卞彲浠ヤ簡锛屾祴璇曠敓鏁堛€?/p>
鎬荤粨锛?/p>
(1) 閫氳繃mysql_print_status鍑芥暟鐩存帴鍐欏埌error log涓?nbsp;
(2) 鎵цmysqladmin debug
(3) 璧勬簮绱у紶锛宬ill session绛?/span>
Status information:
Current dir: /data/mysql/mysql3306/data/
Running threads: 7 Stack size: 262144
Current locks:
lock: 0x7fdcb0a44780:
lock: 0x7fdcaf0ea980:
lock: 0x1edb5a0:
..........
..........
Key caches:
default
Buffer_size: 8388608
Block_size: 1024
Division_limit: 100
Age_limit: 300
blocks used: 9
not flushed: 0
w_requests: 0
writes: 0
r_requests: 82
reads: 13
handler status:
read_key: 16981474
read_next: 33963080
read_rnd 6
read_first: 192
write: 21270
delete 0
update: 16981221
Table status:
Opened tables: 956
Open tables: 206
Open files: 13
Open streams: 0
Memory status:
<malloc version="1">
<heap nr="0">
<sizes>
<unsorted from="140586808432240" to="140585778669336" total="0" count="140585778669312"/>
</sizes>
<total type="fast" count="0" size="0"/>
<total type="rest" count="0" size="0"/>
<system type="current" size="0"/>
<system type="max" size="0"/>
<aspace type="total" size="0"/>
<aspace type="mprotect" size="0"/>
</heap>
<total type="fast" count="0" size="0"/>
<total type="rest" count="0" size="0"/>
<total type="mmap" count="0" size="0"/>
<system type="current" size="0"/>
<system type="max" size="0"/>
<aspace type="total" size="0"/>
<aspace type="mprotect" size="0"/>
</malloc>
Events status:
LLA = Last Locked At LUA = Last Unlocked At
WOC = Waiting On Condition DL = Data Locked
Event scheduler status:
State : INITIALIZED
Thread id : 0
LLA : n/a:0
LUA : n/a:0
WOC : NO
Workers : 0
Executed : 0
Data locked: NO
Event queue status:
Element count : 0
Data locked : NO
Attempting lock : NO
LLA : init_queue:96
LUA : init_queue:104
WOC : NO
Next activation : never
以上是关于璋佽褰曚簡mysql error log涓殑瓒呴暱淇℃伅的主要内容,如果未能解决你的问题,请参考以下文章
銆愮1913鏈熴€慚ath.sign锛氬湪Javascript涓浣曟鏌ヤ竴涓暟瀛楁槸姝f暟杩樻槸璐熸暟
启动mysql报错mysqld_safe error: log-error set to '/var/log/mariadb/mariadb.log'
启动mysql报错mysqld_safe error: log-error set to '/var/log/mariadb/mariadb.log'