先决环境

  1. hostnamectl set-hostname ceph01;bash
  2. hostnamectl set-hostname ceph02;bash
  3. hostnamectl set-hostname ceph03;bash
  4. cat <<EOF>>/etc/hosts
  5. 192.168.122.71 ceph01
  6. 192.168.122.72 ceph02
  7. 192.168.122.73 ceph03
  8. EOF
  9. ssh-keygen
  10. ssh-copy-id ceph01
  11. ssh-copy-id ceph02
  12. ssh-copy-id ceph02
  13. apt update
  14. sudo apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common lvm2
  15. curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
  16. echo \
  17. "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/ubuntu \
  18. $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
  19. apt update
  20. apt install -y docker-ce=5:20.10* docker-ce-cli=5:20.10*
  21. sudo mkdir -p /etc/docker
  22. sudo tee /etc/docker/daemon.json <<-'EOF'
  23. {
  24. "registry-mirrors": ["https://vbe25vg3.mirror.aliyuncs.com"]
  25. }
  26. EOF
  27. sudo systemctl daemon-reload
  28. sudo systemctl restart docker
  29. apt install ntpdate cron
  30. crontab -e
  31. */5 * * * * ntpdate cn.pool.ntp.org
  32. (crontab -l ; echo "*/5 * * * * ntpdate cn.pool.ntp.org") | crontab -
  33. cephadm add-repo --release quincy
  34. cephadm install
  35. curl --silent --remote-name --location https://github.com/ceph/ceph/raw/octopus/src/cephadm/cephadm
  36. sudo cephadm bootstrap --mon-ip 192.168.122.71
  37. cephadm install ceph-common
  38. ceph cephadm get-pub-key > ~/ceph.pub
  39. ssh-copy-id -f -i ~/ceph.pub root@ceph02
  40. ssh-copy-id -f -i ~/ceph.pub root@ceph03
  41. ceph orch host add ceph02 192.168.122.72
  42. ceph orch host add ceph03 192.168.122.73
  43. ceph orch host ls
  44. ceph orch apply mon --placement="3 ceph01 ceph02 ceph03"
  45. ceph orch apply mgr --placement="3 ceph01 ceph02 ceph03"
  46. sudo ceph orch apply osd --all-available-devices
  47. ceph orch daemon add osd ceph01:/dev/sdb
  48. ceph orch daemon add osd ceph01:/dev/sdc

文档更新时间: 2023-03-23 07:28   作者:admin