下载ceph代码
git clone https://github.com/ceph/ceph.git
git checkout v18.2.4 -b v18.2.4
git submodule update --init --recursive
安装ceph所需要的依赖
sudo apt install curl
./install-deps.sh
apt install python3-routes
ninja编译
cd build
ninja
ninja -j 3
运行ceph
work@work:~/ceph/build$ cd ../src/pybind/mgr/ && pip3 install -r requirements.txt
work@work:~/ceph/build$ ../src/vstart.sh -n -d
ceph mgr module enable cephadm
ceph orch set backend cephadm
ceph cephadm generate-key
ceph常用命令
ceph -s
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
查看out/mgr.x.log的日志 有没有错误 一般是依赖问题
出现npm拉取包失败
echo 'registry = "https://registry.npmmirror.com/"' >> ./build/src/pybind/mgr/dashboard/frontend/node-env/.npmrc
ModuleNotFoundError: No module named ‘numpy.core._multiarray_umath’
pip3 install --upgrade numpy
ModuleNotFoundError: No module named ‘_cffi_backend’
sudo apt-get update
sudo apt-get install -y libffi-dev
pip3 install cffi
pip uninstall cffi
Cannot find source file: xxHash/xxhash.c
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.
echo "export PATH=$PATH:~/.local/bin" >> ~/.bashrc
source ~/.bashrc
g+±11: fatal error: 已杀死 signal terminated program cc1plus
重新执行即可,触发了oom
Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
sudo apt-get install doxygen
Could not find fmt, will build it
sudo apt-get install libfmt-dev