2020年10月13日 星期二

mysql 備庫 同步停止 , Waiting for table metadata lock

 

主庫執行 truncate table 指令

這時備庫卻停止同步

show slave status\G;

出現

Seconds_Behind_Master: 1080

Slave_SQL_Running_State: Waiting for table metadata lock


表示備庫這邊有卡住  , 備庫的 show slave status 的 Seconds_Behind_Master 越來越多

查詢

select * from information_schema.innodb_trx

看到備庫是否還有未完成的session , kill session 就可以了


恢復完成,  變成

Seconds_Behind_Master: 0

Slave_SQL_Running_State: Slave has read all relay log; waiting for more updates


redhat 6 yum 無法安裝 解決方法

 


redhat 6 無法使用 yum 


出現錯誤

Loaded plugins: product-id, refresh-packagekit, search-disabled-repos, security, subscription-manager

This system is not registered with an entitlement server. You can use subscription-manager to register.




redhat 跟 centos 是一樣的

解決方法是替換成 centos 的來源


下載來源檔

cd /etc/yum.repos.d/

wget  http://mirrors.163.com/.help/CentOS6-Base-163.repo

vi CentOS6-Base-163.repo


把文件里面的$releasever全部替换為版本號:6

:%s/$releasever/6/g


清除暫存,且資料更新
yum clean all
yum makecache
yum update


就可以使用囉



出現 Resolving mirrors.163.com... failed: Temporary failure in name resolution.

vim /etc/resolv.conf
nameserver 8.8.8.8