Skip to content

Commit 27b059f

Browse files
authored
Update running-a-cluster.md (#228)
* Update running-a-cluster.md * Update running-a-cluster.md
1 parent b8d7618 commit 27b059f

File tree

1 file changed

+75
-27
lines changed

1 file changed

+75
-27
lines changed

content/riak/kv/3.2.0/using/running-a-cluster.md

Lines changed: 75 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -283,54 +283,102 @@ To run multiple nodes, make copies of the `riak` directory.
283283
Presuming that you copied `./rel/riak` into `./rel/riak1`, `./rel/riak2`,
284284
`./rel/riak3`, and so on, you need to make two changes:
285285
286-
1. Set your handoff port and your Protocol Buffers or HTTP port
287-
(depending on which interface you are using) to different values on each
288-
node. For example:
286+
1. Change the ports used by each Riak node to be unique on your host.
287+
Specifically, you need to set to different values on each node:
288+
- the handoff port (in either `riak.conf`)
289+
- the Cluster Manager port (in `advanced.conf`)
290+
- either your Protocol Buffers listener port or your HTTP listener port or both (depending on which interface you are using) (in `riak.conf`)
291+
292+
For example, on node 1 one could use these ports:
289293
290294
```riakconf
291-
# For Protocol Buffers:
295+
# For Protocol Buffers change from:
296+
# listener.protobuf.internal = 127.0.0.1:8097
297+
# To something like this:
292298
listener.protobuf.internal = 127.0.0.1:8187
293299
294-
# For HTTP:
300+
# For HTTP change from:
301+
# listener.http.internal = 127.0.0.1:8098
302+
# To something like this:
295303
listener.http.internal = 127.0.0.1:8198
296304
297-
# For either interface:
305+
# For either interface set the handoff from:
306+
# handoff.port = 8099
307+
# To something like this:
298308
handoff.port = 8199
299309
```
300310
301-
```appconfig
302-
%% In the pb section of riak_core:
303-
{"127.0.0.1", 8187 }
311+
```advancedconf
312+
{riak_core,
313+
[
314+
{cluster_mgr, {"127.0.0.1", 9180 } },
315+
%% more riak_core configs
316+
]}
317+
```
318+
319+
And therefore on node 2, use slightly different ports:
304320
305-
%% In the http section of riak_core:
306-
{"127.0.0.1", 8198}
321+
```riakconf
322+
# For Protocol Buffers change from:
323+
# listener.protobuf.internal = 127.0.0.1:8097
324+
# To something like this:
325+
listener.protobuf.internal = 127.0.0.1:8287
326+
327+
# For HTTP change from:
328+
# listener.http.internal = 127.0.0.1:8098
329+
# To something like this:
330+
listener.http.internal = 127.0.0.1:8298
331+
332+
# For either interface set the handoff from:
333+
# handoff.port = 8099
334+
# To something like this:
335+
handoff.port = 8299
307336
```
308337
309-
2. Change the name of each node to a unique name. Now, start the nodes,
310-
changing path names and nodes as appropriate:
338+
```advancedconf
339+
{riak_core,
340+
[
341+
{cluster_mgr, {"127.0.0.1", 9280 } },
342+
%% more riak_core configs
343+
]}
344+
```
311345
312-
```bash
313-
./rel/riak1/bin/riak start
314-
./rel/riak2/bin/riak start
315-
./rel/riak3/bin/riak start
346+
Continue for all nodes on the host.
316347
317-
# etc
318-
```
348+
3. Change the name of each node to a unique name.
349+
350+
```riakconf
351+
# Change from this:
352+
# nodename = [email protected]
353+
# To something like this:
354+
nodename = [email protected]
355+
```
319356
320-
Next, join the nodes into a cluster:
357+
4. Now, start the nodes, changing path names and nodes as appropriate:
321358
322-
```bash
323-
./rel/riak2/bin/riak admin cluster join [email protected]
324-
./rel/riak3/bin/riak admin cluster join [email protected]
325-
./rel/riak2/bin/riak admin cluster plan
326-
./rel/riak2/bin/riak admin cluster commit
327-
```
359+
```bash
360+
./rel/riak1/bin/riak start
361+
./rel/riak2/bin/riak start
362+
./rel/riak3/bin/riak start
363+
364+
# etc
365+
```
366+
367+
5. Next, join the nodes into a cluster:
368+
369+
```bash
370+
./rel/riak2/bin/riak admin cluster join [email protected]
371+
./rel/riak3/bin/riak admin cluster join [email protected]
372+
./rel/riak2/bin/riak admin cluster plan
373+
./rel/riak2/bin/riak admin cluster commit
374+
```
328375
329376
## Multiple Clusters on One Host
330377
331378
Using the above technique, it is possible to run multiple clusters on
332379
one computer. If a node hasn’t joined an existing cluster, it will
333380
behave just as a cluster would. Running multiple clusters on one
334381
computer is simply a matter of having two or more distinct nodes or
335-
groups of clustered nodes.
382+
groups of clustered nodes. Please note that each cluster should have a
383+
different value for `distributed_cookie`.
336384

0 commit comments

Comments
 (0)