rg.getMaster()
获取当前复制组的主节点。
返回当前复制组的主节点,类型为 SdbNode 对象。
获取 group1 复制组的主节点,可以通过该节点进行相关的节点级操作:
> var rg = db.getRG("group1") > var node = rg.getMaster() > println(node) hostname1:11830 > println(node.constructor.name) SdbNode > node.help() --Instance methods for class "SdbNode": connect() - Connect the database to the current node. getHostName() - Return the hostname of a node. getNodeDetail() - Return the information of the current node. getServiceName() - Return the server name of a node. start() - Start the current node. stop() - Stop the current node.