簡體   English   中英

rdsadmin 用戶從 Aurora Server Less DB 集群登錄 CloudWatch

[英]rdsadmin user logs in CloudWatch from Aurora Server Less DB Cluster

我在 AWS 上創建了 Aurora Server Less DB Cluster (mysql5.10)。

然后我通過將參數集群組中的鍵設置為 - 僅啟用慢速查詢日志

slow_query_log : 1
long_query_time: 0.5
log_output: file

但是在 cluodWatch 中,當我在尋找日志時,我發現了日志-

  • 我的 mysql 用戶日志(這是預期的)
  • 但是rdsadmin日志那么多。 即使這些日志也不符合條件(long_query_time:0.5)。

請幫我看看,有沒有辦法從 cloudwatch 禁用 rdsadmin 的日志??

我無法在 AWS 站點上找到明確的答案來解釋 RDS Serverless v1 支持哪些參數。 經過一些快速測試后,我無法使long_query_time參數與 Serverless 一起使用。 也許集群需要重啟,或者我們需要重新創建一個參數組? https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-serverless.how-it-works.html#aurora-serverless.parameter-groups

我的解決方案是啟用 slow_query 日志(有效),並將stream 日志發送到 CloudWatch Logs

然后我使用以下查詢使用 CloudWatch Logs Insights 查詢日志(假設您選擇了 slow_query 日志流):

parse @message "Query_time: *  Lock_time: * Rows_sent: * Rows_examined: *\n*" as Query_time,Lock_time,Rows_sent,Rows_examined,q
| filter Query_time > 0.250

它將顯示所有慢於 250 毫秒的查詢。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM