监控集群

用户可以使用 listReplicaGroups() 监控集群状态。

  1. 连接到协调节点:

    1. $ /opt/sequoiadb/bin/sdb
    2. > var db = new Sdb( "localhost", 11810 )
  2. 集群状态:

    1. > db.listReplicaGroups()

    输出结果如下:

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