Skip to content
Snippets Groups Projects
Commit 4f4eabcf authored by Alberto Colla's avatar Alberto Colla
Browse files

Update restore-ceph-from-mon-disaster.rst

parent 1378554d
No related branches found
No related tags found
No related merge requests found
......@@ -35,6 +35,31 @@ On the juju client machine, rebuild old mon map using existing OSDs with the fol
.. doc:: ../../images/restore-osd.sh>
script::
ms=./mon-store
rm -rf $ms
mkdir $ms
hosts=`juju status ceph-osd | grep 'ceph-osd/' | awk '{print $1}' | cut -d'*' -f1`
# collect the cluster map from stopped OSDs
for host in $hosts; do
echo $host
juju ssh $host sudo rm -rf /tmp/$ms
juju scp -- -r $ms $host:/tmp
juju ssh $host sudo bash <<EOF
for osd in /var/lib/ceph/osd/ceph-*; do
ceph-objectstore-tool --data-path \$osd --no-mon-config --op update-mon-db --mon-store-path /tmp/$ms
done
chmod -R +r /tmp/$ms
EOF
rm -rf $ms
juju scp -- -r $host:/tmp/$ms .
done
keyring creation
-----------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment