Set the noout flag: ceph osd set noout
.
You have to shutdown all clients accessing the storage cluster. This includes mounted CephFS shares and then the MDS daemons.
After that you can shutdown all other daemons (OSDs, MGRs, MONs).
Restarting is the other way around. After everything works unset the noout flag: ceph osd unset noout
.