@@ -4,6 +4,11 @@ Convert a Secondary to an Arbiter
4
4
5
5
.. default-domain:: mongodb
6
6
7
+ You can convert a secondary member to an arbiter either by shutting down
8
+ the secondary and restarting it as an arbiter, or by starting the
9
+ arbiter on a new port and then shutting down the instance of the
10
+ secondary. This document describes both procedures.
11
+
7
12
Synopsis
8
13
--------
9
14
@@ -41,11 +46,10 @@ Convert a Secondary to an Arbiter and Reuse the Port Number
41
46
42
47
.. code-block:: javascript
43
48
44
- rs.remove("* hostname: port number* ")
49
+ rs.remove("< hostname>:< port> ")
45
50
46
- #. Ensure that the secondary has been removed from the replica set by
47
- calling the :method:`rs.config()` method while connected to the current
48
- primary in the :program:`mongo` shell:
51
+ #. Verify that the replica set no longer includes the secondary by
52
+ calling the :method:`rs.config()` method in the :program:`mongo` shell:
49
53
50
54
.. code-block:: javascript
51
55
@@ -59,7 +63,7 @@ Convert a Secondary to an Arbiter and Reuse the Port Number
59
63
60
64
mv /data/db /data/db-old
61
65
62
- Optionally, you can remove the data entirely .
66
+ .. optional:: You may remove the data instead .
63
67
64
68
#. Modify your application so that MongoDB queries don't reach
65
69
the secondary.
@@ -81,23 +85,21 @@ Convert a Secondary to an Arbiter and Reuse the Port Number
81
85
82
86
mongod --port 27021 --dbpath /data/db --replSet rs
83
87
84
- #. In the :program:`mongo` shell connected to the current primary,
85
- convert the secondary to an arbiter using the :method:`rs.addArb()`
86
- method:
88
+ #. In the :program:`mongo` shell convert the secondary to an arbiter
89
+ using the :method:`rs.addArb()` method:
87
90
88
91
.. code-block:: javascript
89
92
90
- rs.addArb("* hostname: port number* ")
93
+ rs.addArb("< hostname>:< port> ")
91
94
92
- #. Verify the arbiter is added to the replica set by calling the
93
- :method:`rs.config()` method in the :program:`mongo` shell (connected
94
- to the current primary).
95
+ #. Verify the arbiter belongs to the replica set by calling the
96
+ :method:`rs.config()` method in the :program:`mongo` shell.
95
97
96
98
.. code-block:: javascript
97
99
98
100
rs.config()
99
101
100
- The arbiter member should include the following field and value :
102
+ The arbiter member should include the following:
101
103
102
104
.. code-block:: javascript
103
105
@@ -128,17 +130,16 @@ Convert a Secondary to an Arbiter Running on a New Port Number
128
130
129
131
.. code-block:: javascript
130
132
131
- rs.addArb("* hostname: port number* ")
133
+ rs.addArb("< hostname>:< port> ")
132
134
133
- #. Verify the arbiter is added to the replica set by calling the
134
- :method:`rs.config()` method in the :program:`mongo` shell (connected
135
- to the current primary).
135
+ #. Verify the arbiter belongs to the replica set by calling the
136
+ :method:`rs.config()` method in the :program:`mongo` shell.
136
137
137
138
.. code-block:: javascript
138
139
139
140
rs.config()
140
141
141
- The arbiter member should include the following field and value :
142
+ The arbiter member should include the following:
142
143
143
144
.. code-block:: javascript
144
145
@@ -150,16 +151,14 @@ Convert a Secondary to an Arbiter Running on a New Port Number
150
151
secondary, remove the reference.
151
152
152
153
#. Remove the :term:`secondary` from the :term:`replica set` by calling
153
- the :method:`rs.remove()` method while connected to the current
154
- :term:`primary` in the :program:`mongo` shell:
154
+ the :method:`rs.remove()` method in the :program:`mongo` shell:
155
155
156
156
.. code-block:: javascript
157
157
158
- rs.remove("* hostname: port number* ")
158
+ rs.remove("< hostname>:< port> ")
159
159
160
- #. Ensure that the secondary has been removed from the replica set by
161
- calling the :method:`rs.config()` method while connected to the current
162
- primary in the :program:`mongo` shell:
160
+ #. Verify that the replica set no longer includes the secondary by
161
+ calling the :method:`rs.config()` method in the :program:`mongo` shell:
163
162
164
163
.. code-block:: javascript
165
164
@@ -171,4 +170,4 @@ Convert a Secondary to an Arbiter Running on a New Port Number
171
170
172
171
mv /data/db /data/db-old
173
172
174
- Optionally, you can remove the data entirely .
173
+ .. optional:: You may remove the data instead .
0 commit comments