ceph 16.2.15(Pacific)编译
以下流程在ubuntu22.04 和 openEuler20.03 都实际操作过
获取ceph源码
从https://docs.ceph.com/en/latest/releases/找到pacific版本对应的tag为16.2.15

git clone https://github.com/ceph/ceph.git
# 查看所有tag
git ls-remote --tags origin |grep 16.2.
618f440892089921c3e944a991122ddc44e60516 refs/tags/v16.2.15^{}
# 根据git log的commit找到pacifc的release tag为v16.2.15
commit 618f440892089921c3e944a991122ddc44e60516 (HEAD -> ceph-pacific-learning, tag: v16.2.15, tag: ls, origin/ceph-pacific-learning)
Author: Ceph Release Team <ceph-maintainers@ceph.io>
Date: Mon Feb 26 19:21:09 2024 +0000
16.2.15
Signed-off-by: Ceph Release Team <ceph-maintainers@ceph.io>
# 或者 git show v16.2.15,可以确认即可
# 切换到pacific的release tag
git checkout v16.2.15
# 这个tag是一个快照,不可修改,所以创建我们自己的分支
git checkout -b ceph-pacific-learning
编译
拉取submodule网络问题
执行命令git submodule update --init --recursive --progress更新子模块
如果子模块拉取失败:
- 方法一:这个地址会记录最新国内可用的github镜像地址,https://fcp7.com/github-mirror-daily-updates.html,修改ceph顶层目录下的.gitmodule,例如对于
[submodule "src/erasure-code/jerasure/gf-complete"],将url = https://github.com/ceph/gf-complete.git部分替换为镜像的地址如下:
[submodule "ceph-object-corpus"]
path = ceph-object-corpus
url = https://gitclone.com/ceph/ceph-object-corpus.git
[submodule "src/civetweb"]
path = src/civetweb
url = https://gitclone.com/ceph/civetweb
[submodule "src/erasure-code/jerasure/jerasure"]
path = src/erasure-code/jerasure/jerasure
url = https://gitclone.com/ceph/jerasure.git
branch = v2-ceph
[submodule "src/erasure-code/jerasure/gf-complete"]
path = src/erasure-code/jerasure/gf-complete
url = https://gitclone.com/ceph/gf-complete.git
branch = v3-ceph
[submodule "src/rocksdb"]
path = src/rocksdb
url = https://gitclone.com/ceph/rocksdb
ignore = dirty
[submodule "ceph-erasure-code-corpus"]
path = ceph-erasure-code-corpus
url = https://gitclone.com/ceph/ceph-erasure-code-corpus.git
执行git submodule sync --recursive更新git拉取的地址,再次执行git submodule update --init --recursive --progress
- 方法二:如果方法一中的镜像源没有地址,根据拉取失败的提示
fatal: clone of 'https://github.com/spdk/dpdk.git' into submodule path '/data/ceph-learning/src/spdk/dpdk' failed,手动多拉取几次git clone https://github.com/spdk/dpdk.git /data/ceph-learning/src/spdk/dpdk --progress,或者将https换成git执行git clone git://github.com/spdk/dpdk.git /data/ceph-learning/src/spdk/dpdk --progress - 方法三:那种方式上网,解决99%的编译问题
安装依赖
./install-deps.sh
如果是openEuler系统
index 7e137d687f1..b22d45f409d 100755
--- a/install-deps.sh
+++ b/install-deps.sh
@@ -410,7 +410,7 @@ else
$SUDO env DEBIAN_FRONTEND=noninteractive apt-get -y remove ceph-build-deps
if [ "$control" != "debian/control" ] ; then rm $control; fi
;;
- centos|fedora|rhel|ol|virtuozzo)
+ centos|fedora|rhel|ol|virtuozzo|openEuler) # 修改这里
builddepcmd="dnf -y builddep --allowerasing"
echo "Using dnf to install dependencies"
case "$ID" in
do_cmake.sh
cmake -LH可以看到cmake可用参数和描述信息,例如
// ceph-mgr is enabled
WITH_MGR:BOOL=ON
// Build the mgr/dashboard frontend using `npm`
WITH_MGR_DASHBOARD_FRONTEND:BOOL=ON
// build OCF-compliant cluster resource agent
WITH_OCF:BOOL=OFF
dashboard依赖node、ng的一堆包,系统版本不同依赖问题也不同,编译会很麻烦,如果用不到它可以关掉:
./do_cmake.sh -DWITH_MGR_DASHBOARD_FRONTEND=OFF
如果需要dashboard,直接执行./do_cmake.sh后,到build目录下,按照下面的编译dashboard配置后,再回来执行make
编译
执行./do_cmake.sh后会在ceph源码顶层目录下生成一个build目录
cd build
make -j16
Tips:make过程中也会下载一些软件包,没有那种方式上网可能会导致超时失败,失败后可以继续
make -j16增量编译
vstart启动
要使用vstart启动ceph,还需要编译相关环境,在build目录下
make vstart
MON=1 OSD=2 MGR=1 RGW=1 NFS=1 ../src/vstart.sh -d -n -x
问题
- 无法访问dashboard,
ceph -s输出Module 'dashboard' has failed: No module named 'routes',缺python包pip3 install routes即可 - 启动cephfs可能会失败缺包,手动安装
Requirements
------------
The following packages are required to enable CephFS and RGW exports with nfs-ganesha:
- ``nfs-ganesha``, ``nfs-ganesha-ceph``, ``nfs-ganesha-rados-grace`` and
``nfs-ganesha-rados-urls`` packages (version 3.3 and above)
Ganesha Configuration Hierarchy
编译dashboard
如果使用-DWITH_MGR_DASHBOARD_FRONTEND=OFF关了dashboard的话可以忽略这个
安装nodejs
方法一 下载编译好的源码包
wget https://nodejs.org/dist/v16.14.2/node-v16.14.2-linux-x64.tar.xz
xz -d node-v16.14.2-linux-x64.tar.xz
tar -xvf node-v16.14.2-linux-x64.tar
mkdir /usr/local/soft
mv node-v16.14.2-linux-x64 /usr/local/soft
ln -s /usr/local/soft/node-v16.14.2-linux-x64/bin/node /usr/local/bin/node
ln -s /usr/local/soft/node-v16.14.2-linux-x64/bin/npm /usr/local/bin/npm
npm config set registry https://registry.npmmirror.com
npm install -g @angular/cli@16.2.0
ln -s /usr/local/soft/node-v16.14.2-linux-x64/lib/node_modules/@angular/cli/bin/ng.js /usr/local/bin/ng
方法二 nvm安装node(推荐)
# 复制脚本到主机
https://github.com/nvm-sh/nvm/blob/master/install.sh
bash install.sh
# 重新打开终端
nvm ls-remote --lts
nvm install v16.14.2
npm -g install @angular/cli@16.2.10
编译nodeenv
旧版本的ceph编译dashboard会有nodejs和angular/cli版本冲突的问题
# /data/ceph-learning换成自己的ceph源码顶层目录
cd /data/ceph-learning/src/pybind/mgr/dashboard && vim CMakeLists.txt
# 修改 COMMAND ${mgr-dashboard-nodeenv-dir}/bin/nodeenv --verbose ${node_mirror_opt} -p --node=12.18.2
# 为 COMMAND ${mgr-dashboard-nodeenv-dir}/bin/nodeenv --verbose ${node_mirror_opt} -p --node=16.14.2
cd /data/ceph-learning/build
root@yielde:/data/ceph-learning/build# make mgr-dashboard-nodeenv
Installing collected packages: nodeenv
Successfully installed nodeenv-1.9.1
* Install prebuilt node (16.14.2) ..... done.
* Appending data to /data/ceph-learning/build/src/pybind/mgr/dashboard/node-env/bin/activate
* Appending data to /data/ceph-learning/build/src/pybind/mgr/dashboard/node-env/bin/activate.fish
Built target mgr-dashboard-nodeenv
其他
boost下载慢
生成build后,可以先下载好 https://download.ceph.com/qa/boost_1_73_0.tar.bz2,放到/data/ceph-learning/build/boost/src目录下
root@yielde:/data/ceph-learning/build/boost/src# ls -lh
total 105M
drwxr-xr-x 2 root root 4.0K Feb 9 14:38 Boost
-rw-r--r-- 1 root root 105M Feb 9 15:27 boost_1_73_0.tar.bz2
drwxr-xr-x 2 root root 4.0K Feb 9 14:55 Boost-stamp
总结
其实棘手的问题就两个,一是网络方面众所周知的问题访问git和其他一些仓库会超时失败,二是前端相关的nodejs组件等版本问题导致编译失败。要耐心查看报错,修改CmakeList.txt或Makefile、手动下载相关软件包到目录,一步一步解决。
附一个大佬写的vscode+clangd的调试环境配置,我还没尝试:
ceph 16.2.15(Pacific)编译的更多相关文章
- [Android 编译(一)] Ubuntu 16.04 LTS 成功编译 Android 6.0 源码教程
本文转载自:[Android 编译(一)] Ubuntu 16.04 LTS 成功编译 Android 6.0 源码教程 1 前言 经过3天奋战,终于在Ubuntu 16.04上把Android 6. ...
- 在Ubuntu 16.04 LTS下编译安装OpenCV 4.1.1
目录 一 安装前的准备 二 编译并安装OpenCV 4.1.1 注:原创不易,转载请务必注明原作者和出处,感谢支持! OpenCV目前(2019-8-1)的最新版本为4.1.1.本文将介绍如何在Ubu ...
- Deepin 15.4 编译安装 LNMP(PHP 5.6.31 + Nginx 1.12.1 + MySQL 5.6.36)
先查看先前的文章:Ubuntu 14 编译安装 PHP 5.4.45 + Nginx 1.4.7 + MySQL 5.6.26 笔记 编译 Nginx #安装依赖库 sudo apt-get -y i ...
- 16种C语言编译警告(Warning)类型的解决方法
当编译程序发现程序中某个地方有疑问,可能有问题时就会给出一个警告信息.警告信息可能意味着程序中隐含的大错误,也可能确实没有问题.对于警告的正确处理方式应该是:尽可能地消除之.对于编译程序给出的每个警告 ...
- ubuntu 16.04源码编译和配置caffe详细教程 | Install and Configure Caffe on ubuntu 16.04
本文首发于个人博客https://kezunlin.me/post/b90033a9/,欢迎阅读! Install and Configure Caffe on ubuntu 16.04 Series ...
- Deepin 15.3 编译同步SudaMod 2.0
1.设置hosts,方便访问国外站点 $ wget https://raw.githubusercontent.com/racaljk/hosts/master/hosts -qO /tmp/host ...
- 18.16 gcc-3.4.5编译错误及解决方法集锦
18.16.1 自写BootLoader错误 ERROR : boot.c:: warning: return type of 'main' is not `int' ANSWER : int mai ...
- 流媒体技术学习笔记之(十八)Ubuntu 16.04.3 如何编译 FFmpeg 记录
官方文档:https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu 一.最简单安装: apt-get install ffmpeg 二.安装最新版本 大 ...
- Ubuntu 16.04 源码编译安装PHP7+swoole
备注: Ubuntu 16.04 Server 版安装过程图文详解 Ubuntu16镜像地址: 链接:https://pan.baidu.com/s/1XTVS6BdwPPmSsF-cYF6B7Q 密 ...
- qgis3.16.6+vs2017再编译(debug+release)
参考 https://www.cnblogs.com/superbi/p/11188145.html 文章以及其它文章,对qggis3.16.6进行了重新编译 一.编译准备 1.Cygwin 1.1安 ...
随机推荐
- java公式解析器学习与开发(1)
public class Evaluate { public static void main(String[] args) { Stack<String> ops = new Stack ...
- Element-ui 表单嵌套验证
1.当表单的字段值是数组或者对象时的rules配置 对象:直接用obj.xx配置rules和prop 数组:用list.index.xx配置rules和prop <el-form :model= ...
- 2023 秋季学期 六周集训 Misc方向
by 高鹏鸿.密语 写在前面,记录和交流是一个很好的习惯,建议可以自己先搭建一个博客用于存储自己的做题记录以及方便交流.还有,对于Misc方向,灵活应对十分重要,一定要善用搜索引擎. 还有一点,给大家 ...
- winform窗体无边框拖动
1:引用命名空间 using System.Runtime.InteropServices; 2:想要拖动窗体的控件绑定MouseDown事件 点击查看代码 //窗体移动 [DllImport(&qu ...
- Java并发 —— 线程并发(一)
线程和进程 进程就是一个内存中运行的应用程序 线程是当前进程中的一个执行任务(控制单元),负责当前进程中程序的执行 区别与联系 根本区别:进程是操作系统资源分配的基本单位,线程是处理器任务调度和执行的 ...
- 微信开发者工具请求接口 Provisional headers are shown
前情 最近全权负责公司小程序项目的开发,使用的uniapp技术栈. 坑 在和服务端联调的时候发现,接口pending很久,而且时不时的报Provisional headers are shown,而且 ...
- echarts 图表设置默认选中
echarts:https://echarts.apache.org/zh/api.html#events.legendselected tfjy1997:https://blog.csdn.net/ ...
- 架构发展趋势以及 d2js 的未来
目前架构有几个热点方向:微服务, dubbo, Faas,还有 TiDB. 现在开发模式是前后端分离基本成为行规. 应该说以大部分企业业务量级.人员规模来说,要去和淘宝等大厂去对标是非常傻的.对大部分 ...
- 断言、drf之请求与响应
目录 一.断言 二.drf之请求 2.1 Request能够解析的前端传入的编码格式 2.2 Request类有哪些属性和方法(学过) 常用参数 Response类的实例化参数 三.drf之响应 3. ...
- hibernate错误org.hibernate.AnnotationException: No identifier specified for entity:
实体类继承BaseEntity时报错.解决方法:在属性或者get方法上加@Id@Id@GeneratedValue(strategy=GenerationType.AUTO)@Column(uniqu ...