背景:需要对已部署好的Ceph集群切换网络,包含包含公共网络和集群网络
systemctl stop ceph-mon@storage01.service
sed -i "s/172.18.0.81/172.18.0.131/g" /etc/sysconfig/network-scripts/ifcfg-eth0
systemctl restart network
修改为新的IP
修改为新的IP
monmaptool --create --generate -c /etc/ceph/ceph.conf /etc/ceph/monmap
monmaptool --print monmap
noname-a ,noname-b,noname-c 是系统自动生成的
monmaptool --rm {noname-a} --rm {noname-b} --rm {noname-c} monmap
monmaptool --add storage01 172.28.52.81:6789 --add storage02 172.28.52.82:6789 --add storage03 172.28.52.83:6789 monmap
把monmap 拷贝到每一个mon节点
ceph-mon -i storage01 --inject-monmap monmap
注意,有时候ceph-mon 会自动起起来,这个时候重新加载monmap的时候会报错说mon服务被锁住,停止mon服务就可以了
systemctl start ceph-mon@storage01.service
启动mon后 osd数据同步服务还是在老的IP和端口上,也需要重启osd
systemctl restart ceph-osd.target
检查osd 进程启动的IP和端口
netstat -nlp|grep osd
注意事项:
1 一定要先关闭Mon
2 修改IP的时候一定要所有的mon都载入新的monmap 的时候再启动mon
原文:https://www.cnblogs.com/dengchj/p/12377802.html