@@ -449,7 +449,135 @@ and inject the modified monitor map into each new monitor.
449449Migration to the new location is now complete. The monitors should operate
450450successfully.
451451
452+ Using cephadm to change the public network
453+ ==========================================
452454
455+ Overview
456+ --------
457+
458+ The procedure in this overview section provides only the broad outlines of
459+ using ``cephadm `` to change the public network.
460+
461+ #. Create backups of all keyrings, configuration files, and the current monmap.
462+
463+ #. Stop the cluster and disable ``ceph.target `` to prevent the daemons from
464+ starting.
465+
466+ #. Move the servers and power them on.
467+
468+ #. Change the network setup as desired.
469+
470+
471+ Example Procedure
472+ -----------------
473+
474+ .. note :: In this procedure, the "old network" has addresses of the form
475+ ``10.10.10.0/24 `` and the "new network" has addresses of the form
476+ ``192.168.160.0/24 ``.
477+
478+ #. Enter the shell of the first monitor:
479+
480+ .. prompt :: bash #
481+
482+ cephadm shell --name mon.reef1
483+
484+ #. Extract the current monmap from ``mon.reef1 ``:
485+
486+ .. prompt :: bash #
487+
488+ ceph-mon -i reef1 --extract-monmap monmap
489+
490+ #. Print the content of the monmap:
491+
492+ .. prompt :: bash #
493+
494+ monmaptool --print monmap
495+
496+ ::
497+
498+ monmaptool: monmap file monmap
499+ epoch 5
500+ fsid 2851404a-d09a-11ee-9aaa-fa163e2de51a
501+ last_changed 2024-02-21T09:32:18.292040+0000
502+ created 2024-02-21T09:18:27.136371+0000
503+ min_mon_release 18 (reef)
504+ election_strategy: 1
505+ 0: [v2:10.10.10.11:3300/0,v1:10.10.10.11:6789/0] mon.reef1
506+ 1: [v2:10.10.10.12:3300/0,v1:10.10.10.12:6789/0] mon.reef2
507+ 2: [v2:10.10.10.13:3300/0,v1:10.10.10.13:6789/0] mon.reef3
508+
509+ #. Remove monitors with old addresses:
510+
511+ .. prompt :: bash #
512+
513+ monmaptool --rm reef1 --rm reef2 --rm reef3 monmap
514+
515+ #. Add monitors with new addresses:
516+
517+ .. prompt :: bash #
518+
519+ monmaptool --addv reef1 [v2:192.168.160.11:3300/0,v1:192.168.160.11:6789/0] --addv reef2 [v2:192.168.160.12:3300/0,v1:192.168.160.12:6789/0] --addv reef3 [v2:192.168.160.13:3300/0,v1:192.168.160.13:6789/0] monmap
520+
521+ #. Verify that the changes to the monmap have been made successfully:
522+
523+ .. prompt :: bash #
524+
525+ monmaptool --print monmap
526+
527+ ::
528+
529+ monmaptool: monmap file monmap
530+ epoch 4
531+ fsid 2851404a-d09a-11ee-9aaa-fa163e2de51a
532+ last_changed 2024-02-21T09:32:18.292040+0000
533+ created 2024-02-21T09:18:27.136371+0000
534+ min_mon_release 18 (reef)
535+ election_strategy: 1
536+ 0: [v2:192.168.160.11:3300/0,v1:192.168.160.11:6789/0] mon.reef1
537+ 1: [v2:192.168.160.12:3300/0,v1:192.168.160.12:6789/0] mon.reef2
538+ 2: [v2:192.168.160.13:3300/0,v1:192.168.160.13:6789/0] mon.reef3
539+
540+ #. Inject the new monmap into the Ceph cluster:
541+
542+ .. prompt :: bash #
543+
544+ ceph-mon -i reef1 --inject-monmap monmap
545+
546+ #. Repeat the steps above for all other monitors in the cluster.
547+
548+ #. Update ``/var/lib/ceph/{FSID}/mon.{MON}/config ``.
549+
550+ #. Start the monitors.
551+
552+ #. Update the ceph ``public_network ``:
553+
554+ .. prompt :: bash #
555+
556+ ceph config set mon public_network 192.168.160.0/24
557+
558+ #. Update the configuration files of the managers
559+ (``/var/lib/ceph/{FSID}/mgr.{mgr}/config ``) and start them. Orchestrator
560+ will now be available, but it will attempt to connect to the old network
561+ because the host list contains the old addresses.
562+
563+ #. Update the host addresses by running commands of the following form:
564+
565+ .. prompt :: bash #
566+
567+ ceph orch host set-addr reef1 192.168.160.11
568+ ceph orch host set-addr reef2 192.168.160.12
569+ ceph orch host set-addr reef3 192.168.160.13
570+
571+ #. Wait a few minutes for the orchestrator to connect to each host.
572+
573+ #. Reconfigure the OSDs so that their config files are automatically updated:
574+
575+ .. prompt :: bash #
576+
577+ ceph orch reconfig osd
578+
579+ *The above procedure was developed by Eugen Block and was successfully tested
580+ in February 2024 on Ceph version 18.2.1 (Reef). *
453581
454582.. _Manual Deployment : ../../../install/manual-deployment
455583.. _Monitor Bootstrap : ../../../dev/mon-bootstrap
0 commit comments