SequoiaDB監控與開發實踐分析
阿新 • • 發佈:2020-07-06
使用背景
SequoiaDB 儲存引擎的監控
2.1SequoiaDB 的快照說明
> db.snapshot(SDB_SNAP_COLLECTIONS) { "Name": "foo.bar", "UniqueID": 4294967297, "Details": [ { "GroupName": "group1", "Group": [ { "ID": 0, "LogicalID": 0, "Sequence": 1, "Indexes": 1, "Status": "Normal", "TotalRecords": 1, "TotalDataPages": 1, "TotalIndexPages": 2, "TotalLobPages": 0, "TotalDataFreeSpace": 65432, "TotalIndexFreeSpace": 65486, "TotalDataRead": 1, "TotalIndexRead": 0, "TotalDataWrite": 1, "TotalIndexWrite": 1, "TotalUpdate": 0, "TotalDelete": 0, "TotalInsert": 1, "TotalSelect": 1, "TotalRead": 1, "TotalWrite": 1, "TotalTbScan": 1, "TotalIxScan": 0, "ResetTimestamp": "2020-05-26-13.42.20.163109", "NodeName": "datanode:11820" } ] } ] }
2.2SequoiaDB SQL 快速處理
> db.exec("select trans.NodeName as node, session.LastOpType as lastOpType, session.LastOpInfo as lastOpInfo from $SNAPSHOT_TRANS as trans inner join $SNAPSHOT_SESSION as session on trans.RelatedID = session.RelatedID where trans.WaitLock.CSID is not null ") { "node": "datanode:11820", "lastOpType": "GETMORE", "lastOpInfo": "ContextID:297, NumToRead:-1" } { "node": "datanode:11820", "lastOpType": "UPDATE", "lastOpInfo": "" }
2.3開發語言選擇
引玉拋磚引玉的Demo程式
https://github.com/yuki0703/Demo
SequoiaDB Monitor optional arguments: -h, --help show this help message and exit --host HOST coord host -u USERNAME username -p PASSWORD password -t TABLE table name