From 716e39f9478aaa2fb2b04a240849f976bc249639 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Mon, 29 Apr 2024 23:32:41 +0800 Subject: [PATCH] Update index.py --- plugins/mongodb/index.py | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/plugins/mongodb/index.py b/plugins/mongodb/index.py index aa92b6203..40f8efdb8 100755 --- a/plugins/mongodb/index.py +++ b/plugins/mongodb/index.py @@ -295,22 +295,22 @@ def test(): print(rsStatus) # 需要通过命令行操作 - rs.initiate({ - _id: 'test', - members: [ - { - _id: 1, - host: '154.21.203.138:27017', - priority: 2 // 这个priority不设置为1,值越高,当主库故障的时候会优先被选举成主库 - }, - { - _id: 2, - host: '154.12.53.216:27017', - priority: 1 //设置为0则不能成为主库 - } + # rs.initiate({ + # _id: 'test', + # members: [ + # { + # _id: 1, + # host: '154.21.203.138:27017', + # priority: 2 + # }, + # { + # _id: 2, + # host: '154.12.53.216:27017', + # priority: 1 + # } - ] - }); + # ] + # }); # > rs.status(); // 查询状态 # // "stateStr" : "PRIMARY", 主节点