ubantu 编译安装ceph 18.2.4

下载ceph代码

shell 复制代码
git clone https://github.com/ceph/ceph.git
#切换tag
git checkout v18.2.4 -b v18.2.4
#下载子模块 会有报错重新执行即可
git submodule update --init --recursive

安装ceph所需要的依赖

shell 复制代码
#curl命令安装
sudo apt install curl

#安装ceph依赖
./install-deps.sh
#
apt install python3-routes

ninja编译

bash 复制代码
cd build
ninja

#限制3个工作线程,每个线程大概需要2.5GB内存
ninja -j 3

运行ceph

shell 复制代码
#安装项目依赖
work@work:~/ceph/build$ cd ../src/pybind/mgr/ && pip3 install -r requirements.txt 

#运行ceph 
work@work:~/ceph/build$ ../src/vstart.sh -n -d

#启动cephadm模块
ceph mgr module enable cephadm
#将后端设置为cephadm
ceph orch set backend cephadm
#生成ceph密钥
ceph cephadm generate-key 

ceph常用命令

shell 复制代码
#查看集群的状态
ceph -s

#查看mgr模块列表
ceph mgr module ls


#启动某个模块
ceph mgr module enable xxx

#给已知主机加标签
ceph orch host add my_hostname --labels=my_label1

遇到的问题

出现waiting for mgr dashboard module to start

shell 复制代码
查看out/mgr.x.log的日志 有没有错误 一般是依赖问题

出现npm拉取包失败

shell 复制代码
#修改 build/src/pybind/mgr/dashboard/frontend/node-env/.npmrc 
#添加源地址 文件内容如下 二选一
#registry=https://registry.npm.taobao.org/
#registry=https://registry.npmmirror.com/

echo 'registry = "https://registry.npmmirror.com/"' >> ./build/src/pybind/mgr/dashboard/frontend/node-env/.npmrc

ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'

shell 复制代码
pip3 install --upgrade numpy

ModuleNotFoundError: No module named '_cffi_backend'

shell 复制代码
sudo apt-get update
sudo apt-get install -y libffi-dev


pip3 install cffi

#如果老版本的pip安装了cffi库,执行卸载后重装
pip uninstall cffi

Cannot find source file: xxHash/xxhash.c

shell 复制代码
#需要重新克隆一下,或者直接下载对应版本 放到src/xxHash目录下去

WARNING: The scripts pip, pip3 and pip3.9 are installed in '/home/work/.local/bin' which is not on PATH.Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.

shell 复制代码
#需要将'/home/work/.local/bin'加入PATH环境变量
echo "export PATH=$PATH:~/.local/bin" >> ~/.bashrc
source ~/.bashrc

g+±11: fatal error: 已杀死 signal terminated program cc1plus

shel 复制代码
重新执行即可,触发了oom

Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)

shell 复制代码
#安装libfmt-dev包
sudo apt-get install doxygen

Could not find fmt, will build it

shell 复制代码
#安装libfmt-dev包
sudo apt-get install libfmt-dev
相关推荐
likfishdn9 分钟前
Linux的文件与目录管理
linux·运维·服务器
chian-ocean29 分钟前
Linux 文件缓冲区:高效数据访问的幕后推手
linux·运维·服务器
加油=^_^=30 分钟前
【Linux】进程优先级 | 进程调度(三)
linux·运维·服务器
Forget the Dream34 分钟前
设计模式之责任链模式
java·c++·设计模式·责任链模式
停止重构35 分钟前
【开源】低代码 C++程序框架,Linux多线程程序
c++·低代码·多线程·开源框架·云计算引擎
Duramentee38 分钟前
C++ 设计模式 十二:责任链模式 (读书 现代c++设计模式)
c++·设计模式·责任链模式
_GR43 分钟前
Qt开发⑧Qt的窗口_下_浮动窗口+对话框
开发语言·css·c++·qt·microsoft
深度Linux1 小时前
深入探讨Ceph:分布式存储架构的未来
分布式·ceph·架构·c/c++
萌の鱼1 小时前
leetcode 3183. 达到总和的方法数量
数据结构·c++·算法·leetcode
斯普信专业组1 小时前
基于Rook的Ceph云原生存储部署与实践指南(下)
ceph