Created
March 16, 2022 15:50
-
-
Save ideepika/b69a5b647e5adcbcfb2505e3c00a6824 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
``` | |
#!/bin/bash | |
set -ex | |
echo "===setup clusters ===" | |
MON=1 OSD=1 MGR=1 MDS=0 RGW=0 ../src/mstart.sh primary --short -n -d -o " | |
mirroring_debug_snap_copy_delay = 9876 | |
debug rbd = 20 | |
debug rbd_mirror = 30 | |
rbd_default_features = 61" --without-dashboard | |
MON=1 OSD=1 MGR=1 MDS=0 RGW=0 ../src/mstart.sh secondary --short -n -d -o " | |
mirroring_debug_snap_copy_delay = 9876 | |
debug rbd = 20 | |
debug rbd_mirror = 30 | |
rbd_default_features = 61" --without-dashboard | |
echo "===rbd mirror setup for clusters ===" | |
key=$(../src/mrun primary ceph auth get client.admin --format=json | jq -r .[0].key) | |
mon_host_a=$(grep "mon host" run/primary/ceph.conf | awk '{print $4}') | |
bin/rbd-mirror --mon_host $mon_host_a --key $key --debug-rbd=20 --debug-rbd_mirror=30 -c run/primary/ceph.conf --log-file=$(pwd)/resync_logs/rbd_mirror_primary.log | |
mon_host_b=$(grep "mon host" run/secondary/ceph.conf | awk '{print $4}') | |
key=$(../src/mrun secondary ceph auth get client.admin --format=json | jq -r .[0].key) | |
bin/rbd-mirror --mon_host $mon_host_b --key $key --debug-rbd=20 --debug-rbd_mirror=30 -c run/secondary/ceph.conf --log-file=$(pwd)/resync_logs/rbd_mirror_secondary.log | |
echo "===create pools==" | |
../src/mrun primary ceph osd pool create data | |
../src/mrun secondary ceph osd pool create data | |
echo "make them rbd pool...\n" | |
../src/mrun primary rbd pool init data | |
../src/mrun secondary rbd pool init data | |
echo "===connect the 2 site clusters==" | |
../src/mrun primary rbd mirror pool enable --site-name primary data image | |
token=$(../src/mrun primary rbd mirror pool peer bootstrap create data) | |
../src/mrun secondary rbd mirror pool peer bootstrap import --site-name secondary data - <<< $token | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment