「SequoiaDB巨杉数据库」getMaster()

语法

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.

点击巨杉数据库文档中心了解更多信息

猜你喜欢

转载自blog.csdn.net/lshanhsnshan/article/details/113112470