User does not have the ‘LOCK TABLES‘ privilege required to obtain a consistent snapshot by preventin
Debezium 源端數據庫是:MySQL
在一開始進行數據同步的時候,任務無法運行,拋出異常。
User does not have the 'LOCK TABLES' privilege required to obtain a consistent snapshot by preventing concurrent writes to tables.
<user_name>權限如下:
grant select, reload, show databases, replication slave, replication client on *.* to 'testuser'@'%'; grant create,select, insert, update, delete on testdb.* to testuser@'%'; grant select on mysql.db to testuser@'%'; flush privileges;所賦權限有RELOAD,包含了'LOCK TABLES' 的鎖表權限,還是報錯。
原因如下:
當啟動MySQL CDC源時,它將獲取一個全局讀取鎖(FLUSH TABLES WITH READ LOCK),該鎖將阻止其他數據庫的寫入,然后讀取當前binlog位置以及數據庫和表的schema,之后將釋放全局讀取鎖。然后它掃描數據庫表并從先前記錄的位置讀取binlog,debezium將定期執行checkpoints以記錄binlog位置。如果發生故障,作業將重新啟動并從checkpoint完成的binlog位置恢復,因此它保證了僅一次的語義。
所以,檢查權限沒有問題之后,出現的原因是:正在向表里寫入數據,無法鎖表導致的。
全局讀取鎖 在讀取binlog位置和schema期間保持。這可能需要幾秒鐘,具體取決于表的數量。全局讀取鎖定會阻止寫入,因此它仍然可能影響在線業務。如果要跳過讀取鎖,并且可以容忍至少一次語義,則可以添加'debezium.snapshot.locking.mode' = 'none'選項以跳過鎖。
總結
以上是生活随笔為你收集整理的User does not have the ‘LOCK TABLES‘ privilege required to obtain a consistent snapshot by preventin的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 文件服务器索引服务,ftp服务器文件索引
- 下一篇: 宽高变化动画代码,旋转动画代码(HTML