概述
文章目录
- 环境要求
- L版本ceph
- 编译ceph代码
- vstart.sh启动一个调试环境
- mstart.sh启动多个调试环境
- 配置环境变量
- 将脚本拷贝到build目录
- 创建多个集群
- 启rbd mirror进程
- J版本ceph
- 编译启动vstart
- N版本ceph
- 编译ceph代码
- gcc 7版本的配置
转载请注明:https://blog.csdn.net/huigui65/article/details/81986092
修改ceph代码之后可以只编译一部分后进行调试。这时可以使用vstart.sh起一个虚拟的测试环境。vstart.sh启动一个测试环境在github有教程。如果要测试rbd mirror需要两个集群,这时可以使用ceph/src/mvstart.sh启动多个集群进行测试。再此记录这两种调试的方法。
环境要求
- 编译环境需要有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版本
最后
以上就是谨慎羽毛为你收集整理的ceph 调试环境启动环境要求L版本cephJ版本cephN版本ceph的全部内容,希望文章能够帮你解决ceph 调试环境启动环境要求L版本cephJ版本cephN版本ceph所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复