使用PowerShell調用MTools分析MongoDB效能並發送郵件

來源:互聯網
上載者:User

標籤:powershell   mongodb   mtools   

使用PowerShell調用MTools分析MongoDB效能並發送郵件


問題描述:

在MongoDB日常營運中,經常需要查看串連數的趨勢圖、慢查詢、Overflow語句、串連來源。


解決方案:

1. 將Windows備份機目錄掛載到MongoDB本地目錄下,將LogRotate切換後的最新一個日誌拷貝到備份目錄。

參考博文:《在Linux下掛載Windows系統共用目錄》


2. 在Windows伺服器上安裝Mtools。

參考博文:《在64位Windows Server 2008 R2上安裝mtools》


3. 編寫PowerShell指令碼,通過Mtools分析記錄檔,並發送郵件。

Github源碼地址:https://github.com/UltraSQL/MongoDBDailyReport.git

使用方法:

a) 將DBA模組放到相應的Modules\DBA目錄下。

b) 在設定檔中載入模組:Import-Module DBA -Force。

c) 建立任務計劃,定時執行該MTools.ps1指令碼。  
650) this.width=650;" title="clip_image002" style="border-top:0px;border-right:0px;background-image:none;border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;padding-right:0px;" alt="clip_image002" src="http://s3.51cto.com/wyfs02/M02/72/F7/wKioL1XxKcGQNDLtAACcTq4nMFM928.jpg" height="151" border="0" />


本文出自 “SQL Server Deep Dives” 部落格,請務必保留此出處http://ultrasql.blog.51cto.com/9591438/1693437

使用PowerShell調用MTools分析MongoDB效能並發送郵件

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.