ceph 调试环境启动


转载请注明:https://blog.csdn.net/huigui65/article/details/81986092
修改ceph代码之后可以只编译一部分后进行调试。这时可以使用vstart.sh起一个虚拟的测试环境。vstart.sh启动一个测试环境在github有教程。如果要测试rbd mirror需要两个集群,这时可以使用ceph/src/mvstart.sh启动多个集群进行测试。再此记录这两种调试的方法。

环境要求

  1. 编译环境需要有swap分区,以免多线程编译时内存不够。

L版本ceph

编译ceph代码

cd ceph/
./install-deps.sh 安装依赖
./do_cmake.sh
cd build
make 编译
make help 查看有哪些target可以单独编译

vstart.sh启动一个调试环境

cd build
make vstart        # builds just enough to run vstart
../src/vstart.sh --debug --new -x --localhost --bluestore
./bin/ceph -s 

mstart.sh启动多个调试环境

配置环境变量

export PYTHONPATH=$PYTHONPATH:/home/clz/code/ceph/build/src/pybind/
export PATH=$PATH:/home/clz/code/ceph/build/bin/
export LD_LIBRARY_PATH=/home/clz/code/ceph/build/lib/

将脚本拷贝到build目录

cp ../src/vstart.sh ./
cp ../src/stop.sh ./
cp ../src/mstart.sh ./
cp ../src/mstop.sh ./

创建多个集群

./mstart.sh remote -n  -l --bluestore
./mstart.sh local -n  -l --bluestore

./bin/rados -c ./run/local/ceph.conf rmpool rbd rbd --yes-i-really-really-mean-it
./bin/rados -c ./run/remote/ceph.conf rmpool rbd rbd --yes-i-really-really-mean-it

./bin/rados -c ./run/local/ceph.conf mkpool rbd
./bin/rados -c ./run/remote/ceph.conf mkpool rbd

./bin/rbd -c ./run/local/ceph.conf mirror pool enable rbd image
./bin/rbd -c ./run/remote/ceph.conf mirror pool enable rbd image

./bin/rbd -c ./run/local/ceph.conf mirror pool peer add rbd client.admin@remote
./bin/rbd -c ./run/remote/ceph.conf mirror pool peer add rbd client.admin@local

./bin/rbd -c ./run/remote/ceph.conf mirror pool info rbd
./bin/rbd -c ./run/local/ceph.conf mirror pool info rbd

./bin/rbd -c ./run/local/ceph.conf create test --image-feature layering --image-feature exclusive-lock --image-feature journaling -s 100M
./bin/rbd -c ./run/local/ceph.conf mirror image enable test

启rbd mirror进程

拷贝两个集群的配置文件到build:
cp ./run/local/ceph.conf ./local.conf
cp ./run/remote/ceph.conf ./remote.conf
rbd-mirror -c remote.conf -d

J版本ceph

编译启动vstart

已经有人总结在博客中,这样直接给出链接(感谢分享)。
https://blog.csdn.net/weixin_37871174/article/details/71157030

N版本ceph

编译ceph代码

cd ceph/
./install-deps.sh 安装依赖
./do_cmake.sh
cd build
make 编译
make help 查看有哪些target可以单独编译

gcc 7版本的配置

由于14.2.0使用了c++17需要依赖于gcc 7

yum -y install centos-release-scl
yum -y install devtoolset-7-gcc devtoolset-7-gcc-c++ devtoolset-7-binutils
scl enable devtoolset-7 bash  临时生效
source /opt/rh/devtoolset-7/enable
echo "source /opt/rh/devtoolset-7/enable" >>/etc/profile  长期生效
gcc -v 查看环境gcc版本
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值