• 监控集群

    监控集群

    • 连接到协调节点
    1. $ /opt/sequoiadb/bin/sdb
    2. > var db = new Sdb( "localhost", 11810 )
    • 得到集群状态
    1. > db.listReplicaGroups()
    2. {
    3. "Group": [
    4. {
    5. "dbpath": "/opt/sequoiadb/database/cata/11800",
    6. "HostName": "hostname1",
    7. "Service": [
    8. ...
    9. ],
    10. "NodeID": 1
    11. },
    12. {
    13. "HostName": "hostname2",
    14. "dbpath": "/opt/sequoiadb/database/cata/11800",
    15. "Service": [
    16. ...
    17. ],
    18. "NodeID": 2
    19. },
    20. {
    21. "HostName": "hostname3",
    22. "dbpath": "/opt/sequoiadb/database/cata/11800",
    23. "Service": [
    24. ...
    25. ],
    26. "NodeID": 3
    27. }
    28. ],
    29. "GroupID": 1,
    30. "GroupName": "SYSCatalogGroup",
    31. "PrimaryNode": 1,
    32. "Role": 2,
    33. "Status": 1,
    34. "Version": 3,
    35. "_id": {
    36. "$oid": "558b9264de349a1b87451a1d"
    37. }
    38. }
    39. {
    40. "Group": [
    41. {
    42. "HostName": "hostname1",
    43. "dbpath": "/opt/sequoiadb/database/data/21100",
    44. "Service": [
    45. ...
    46. ],
    47. "NodeID": 1000
    48. },
    49. {
    50. "HostName": "hostname2",
    51. "dbpath": "/opt/sequoiadb/database/data/21100",
    52. "Service": [
    53. ...
    54. ],
    55. "NodeID": 1001
    56. },
    57. {
    58. "HostName": "hostname3",
    59. "dbpath": "/opt/sequoiadb/database/data/21100",
    60. "Service": [
    61. ...
    62. ],
    63. "NodeID": 1002
    64. }
    65. ],
    66. "GroupID": 1000,
    67. "GroupName": "group1",
    68. "PrimaryNode": 1001,
    69. "Role": 0,
    70. "Status": 1,
    71. "Version": 4,
    72. "_id": {
    73. "$oid": "558b9295de349a1b87451a21"
    74. }
    75. }
    76. ...