先决环境
hostnamectl set-hostname ceph01;bash
hostnamectl set-hostname ceph02;bash
hostnamectl set-hostname ceph03;bash
cat <<EOF>>/etc/hosts
192.168.122.71 ceph01
192.168.122.72 ceph02
192.168.122.73 ceph03
EOF
ssh-keygen
ssh-copy-id ceph01
ssh-copy-id ceph02
ssh-copy-id ceph02
apt update
sudo apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common lvm2
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
apt update
apt install -y docker-ce=5:20.10* docker-ce-cli=5:20.10*
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://vbe25vg3.mirror.aliyuncs.com"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker
apt install ntpdate cron
crontab -e
*/5 * * * * ntpdate cn.pool.ntp.org
(crontab -l ; echo "*/5 * * * * ntpdate cn.pool.ntp.org") | crontab -
cephadm add-repo --release quincy
cephadm install
curl --silent --remote-name --location https://github.com/ceph/ceph/raw/octopus/src/cephadm/cephadm
sudo cephadm bootstrap --mon-ip 192.168.122.71
cephadm install ceph-common
ceph cephadm get-pub-key > ~/ceph.pub
ssh-copy-id -f -i ~/ceph.pub root@ceph02
ssh-copy-id -f -i ~/ceph.pub root@ceph03
ceph orch host add ceph02 192.168.122.72
ceph orch host add ceph03 192.168.122.73
ceph orch host ls
ceph orch apply mon --placement="3 ceph01 ceph02 ceph03"
ceph orch apply mgr --placement="3 ceph01 ceph02 ceph03"
sudo ceph orch apply osd --all-available-devices
ceph orch daemon add osd ceph01:/dev/sdb
ceph orch daemon add osd ceph01:/dev/sdc
文档更新时间: 2023-03-23 07:28 作者:admin