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

Điểm Danh Các Nhà Cung Cấp VPS Miễn Phí Hàng Đầu Thế Giới: Đâu Là Sự Thật Và Lựa Chọn Tối Ưu Cho Doanh Nghiệp?
Điểm Danh Các Nhà Cung Cấp VPS Miễn Phí Hàng Đầu Thế ...

Điểm Danh Các Nhà Cung Cấp VPS Miễn Phí Hàng Đầu Thế Giới: Đâu Là Sự Thật Và ...

Oracle Cloud Miễn Phí VPS Vĩnh Viễn Có Thật Không? Giải Mã Và Đâu Là Lựa Chọn Tối Ưu Cho Doanh Nghiệp?
Oracle Cloud Miễn Phí VPS Vĩnh Viễn Có Thật Không? ...

Oracle Cloud Miễn Phí VPS Vĩnh Viễn Có Thật Không? Giải Mã Và Đâu Là Lựa Chọn ...

Chiến Lược Của Huawei Để Trở Thành "Nvidia Của Trung Quốc": Lối Đi Nào Cho Điện Toán AI?
Chiến Lược Của Huawei Để Trở Thành "Nvidia Của Trung ...

Chiến Lược Của Huawei Để Trở Thành "Nvidia Của Trung Quốc": Lối Đi Nào Cho Điện ...

Hướng dẫn nâng cấp CyberPanel 3.0.6 trên Ubuntu 22.04
Hướng dẫn nâng cấp CyberPanel 3.0.6 trên Ubuntu 22.04

Hướng dẫn nâng cấp CyberPanel 3.0.6 trên Ubuntu 22.04

Kết hợp Let’s Encrypt SSL với Cloudflare Proxy: Mô hình HTTPS an toàn cho website
Kết hợp Let’s Encrypt SSL với Cloudflare Proxy: Mô ...

Kết hợp Let’s Encrypt SSL với Cloudflare Proxy: Mô hình HTTPS an toàn cho ...

Hướng dẫn nâng cấp GitLab EE 19.2.4 lên 19.3.2 an toàn trên Ubuntu 24.04
Hướng dẫn nâng cấp GitLab EE 19.2.4 lên 19.3.2 an toàn ...

Hướng dẫn nâng cấp GitLab EE 19.2.4 lên 19.3.2 an toàn trên Ubuntu 24.04