Phần 4 Monitoring trên MongoDB

Phần 4 Monitoring trên MongoDB

1./ Free Monitoring trên MongoDB

db.enableFreeMonitoring()

#

rs0:PRIMARY> db.enableFreeMonitoring()

{

 ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "state" : "enabled",

 ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "message" : "To see your monitoring data, navigate to the unique URL below. Anyone you share the URL with will also be able to view this page. You can disable monitoring at any time by running db.disableFreeMonitoring().",

 ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "url" : "https://cloud.mongodb.com/freemonitoring/cluster/SWD5QSOP3SSJBHBQQ72JTF3EM6CXGYBE",

 ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "userReminder" : "",

 ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "ok" : 1,

 ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "$clusterTime" : {

 ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "clusterTime" : Timestamp(1645613943, 1),

 ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "signature" : {

 ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),

 ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "keyId" : NumberLong(0)

 ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ }

 ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ },

 ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "operationTime" : Timestamp(1645613943, 1)

}

 

db.enableFreeMonitoring()

rs0:PRIMARY> db.enableFreeMonitoring()

{

 ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "state" : "enabled",

 ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "message" : "To see your monitoring data, navigate to the unique URL below. Anyone you share the URL with will also be able to view this page. You can disable monitoring at any time by running db.disableFreeMonitoring().",

 ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "url" : "https://cloud.mongodb.com/freemonitoring/cluster/SWD5QSOP3SSJBHBQQ72JTF3EM6CXGYBE",

 ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "userReminder" : "",

 ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "ok" : 1,

 ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "$clusterTime" : {

 ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "clusterTime" : Timestamp(1645614111, 1),

 ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "signature" : {

 ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),

 ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "keyId" : NumberLong(0)

 ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ }

 ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ },

 ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "operationTime" : Timestamp(1645614111, 1)

}

Để kiểm tra

rs0:PRIMARY> db.getFreeMonitoringStatus()​​ 

{

 ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "state" : "enabled",

 ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "message" : "To see your monitoring data, navigate to the unique URL below. Anyone you share the URL with will also be able to view this page. You can disable monitoring at any time by running db.disableFreeMonitoring().",

 ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "url" : "https://cloud.mongodb.com/freemonitoring/cluster/SWD5QSOP3SSJBHBQQ72JTF3EM6CXGYBE",

 ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "userReminder" : "Free Monitoring URL:\nhttps://cloud.mongodb.com/freemonitoring/cluster/SWD5QSOP3SSJBHBQQ72JTF3EM6CXGYBE",

 ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "ok" : 1,

 ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "$clusterTime" : {

 ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "clusterTime" : Timestamp(1645614185, 1),

 ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "signature" : {

 ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),

 ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "keyId" : NumberLong(0)

 ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ }

 ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ },

 ​​ ​​ ​​ ​​ ​​ ​​ ​​​​ "operationTime" : Timestamp(1645614185, 1)

}

Truy cập

https://cloud.mongodb.com/freemonitoring/cluster/SWD5QSOP3SSJBHBQQ72JTF3EM6CXGYBE

https://docs.mongodb.com/manual/reference/method/db.enableFreeMonitoring/#mongodb-method-db.enableFreeMonitoring

 

#

2./ Tool Monitor MongoDB Performance

2.1/ Mongostat

mongostat -u "root" -p '=@!#@%$admin1' --authenticationDatabase "admin"

 

#​​ mongostat -u "mgadmin" -p 'mgpass1234321'​​ --authenticationDatabase "admin"

2.2/ Mongotop

#​​ mongotop​​ -u "mgadmin" -p 'mgpass1234321'​​ --authenticationDatabase "admin"

 

 

 

 

 

Tham khảo

https://www.tecmint.com/monitor-mongodb-performance/

BÀI VIẾT CÙNG CHUYÊN MỤC

Hướng Dẫn Sửa Lỗi Không Extend Được Ổ C Trên Windows Server 2025 Do Vướng Phân Vùng Recovery
Hướng Dẫn Sửa Lỗi Không Extend Được Ổ C Trên Windows ...

Hướng Dẫn Sửa Lỗi Không Extend Được Ổ C Trên Windows Server 2025 Do Vướng Phân ...

Cảnh Báo Đỏ: Chiến Dịch FortiBleed Rò Rỉ Hàng Chục Nghìn Thông Tin Quản Trị Tường Lửa Fortinet
Cảnh Báo Đỏ: Chiến Dịch FortiBleed Rò Rỉ Hàng Chục ...

Cảnh Báo Đỏ: Chiến Dịch FortiBleed Rò Rỉ Hàng Chục Nghìn Thông Tin Quản Trị ...

Không copy được giữa máy Windows và máy ảo qua mRemoteNG/RDP: Nguyên nhân và cách sửa
Không copy được giữa máy Windows và máy ảo qua ...

mRemoteNG Remote Desktop RDP Clipboard Redirection rdpclip.exe VPS Windows ...

Hướng dẫn bật Nested Virtualization trên ESXi để chạy Android Studio Emulator trong máy ảo Windows
Hướng dẫn bật Nested Virtualization trên ESXi để chạy ...

Nested Virtualization ESXi VMware Android Studio Android Emulator WHPX Hyper-V ...

PITR (Point In Time Recovery) là gì? Khôi phục Database về đúng thời điểm cần thiết
PITR (Point In Time Recovery) là gì? Khôi phục ...

PITR, Point In Time Recovery, PITR là gì, Database Recovery, PostgreSQL PITR, ...