getMaster()

语法

rg.getMaster()

获取当前分区组的主节点。

返回值

返回当前分区组的主节点,类型为 SdbNode 对象。

错误

错误码

示例

获取 group1 分区组的主节点,可以通过该节点进行相关的节点级操作:

  1. > var rg = db.getRG("group1")
  2. > var node = rg.getMaster()
  3. > println(node)
  4. hostname1:11830
  5. > println(node.constructor.name)
  6. SdbNode
  7. > node.help()
  8. --Instance methods for class "SdbNode":
  9. connect() - Connect the database to the current node.
  10. getHostName() - Return the hostname of a node.
  11. getNodeDetail() - Return the information of the current node.
  12. getServiceName() - Return the server name of a node.
  13. start() - Start the current node.
  14. stop() - Stop the current node.