mon.sh 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #!/usr/bin/env bash
  2. # Copyright 2015 The Kubernetes Authors.
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. #
  16. # Configures and launches a new MON.
  17. #
  18. # monitor setup
  19. monmaptool --create --clobber --fsid "$(uuidgen)" --add a "${1}":6789 /etc/ceph/monmap
  20. mkdir /var/lib/ceph/mon/ceph-a
  21. ceph-mon -i a --mkfs --monmap /etc/ceph/monmap -k /var/lib/ceph/mon/keyring
  22. cp /var/lib/ceph/mon/keyring /var/lib/ceph/mon/ceph-a
  23. ceph-mon -i a --monmap /etc/ceph/monmap -k /var/lib/ceph/mon/ceph-a/keyring
  24. # client setup (handy)
  25. cp /var/lib/ceph/mon/keyring /etc/ceph
  26. # for this test we want to
  27. ceph osd getcrushmap -o /tmp/crushc
  28. crushtool -d /tmp/crushc -o /tmp/crushd
  29. sed -i 's/step chooseleaf firstn 0 type host/step chooseleaf firstn 0 type osd/' /tmp/crushd
  30. crushtool -c /tmp/crushd -o /tmp/crushc
  31. ceph osd setcrushmap -i /tmp/crushc