ceph 除錯環境啟動

2021-08-25 14:34:33 字數 2690 閱讀 9857

啟rbd mirror程序

j版本ceph

n版本ceph

修改ceph**之後可以只編譯一部分後進行除錯。這時可以使用vstart.sh起乙個虛擬的測試環境。vstart.sh啟動乙個測試環境在github有教程。如果要測試rbd mirror需要兩個集群,這時可以使用ceph/src/mvstart.sh啟動多個集群進行測試。再此記錄這兩種除錯的方法。

編譯環境需要有swap分割槽,以免多執行緒編譯時記憶體不夠。

cd ceph/

./install-deps.sh 安裝依賴

./do_cmake.sh

cd build

make 編譯

make help 檢視有哪些target可以單獨編譯

cd build

make vstart # builds just enough to run vstart

../src/vstart.sh --debug --new -x --localhost --bluestore

./bin/ceph -s

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/

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

拷貝兩個集群的配置檔案到build:

cp ./run/local/ceph.conf ./local.conf

cp ./run/remote/ceph.conf ./remote.conf

rbd-mirror -c remote.conf -d
已經有人總結在部落格中,這樣直接給出鏈結(感謝分享)。

cd ceph/

./install-deps.sh 安裝依賴

./do_cmake.sh

cd build

make 編譯

make help 檢視有哪些target可以單獨編譯

由於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 一 (CEPH的環境準備)

實驗拓撲圖 配置ceph節點 二 為node1節點儲存各台主機的金鑰 三 為node1節點生成公鑰及金鑰 四 實現node1節點遠端各台主機免密登陸 包含node1自己 node1操作 五 為node6節點 客戶端 配置時間伺服器 node6操作 六 為node1 5配置為ntp伺服器 node6 ...

ceph預環境安裝

更新epel最新源 yum install epel release y 新加ceph jewel 版本源 更新系統軟體 sudo yum update 安裝ceph deploy sudo yum install ceph deploy 在所有的ceph node節點裡新增ceph deploy使...

docker 單機啟動ceph集群(macOS)

前提先安裝好docker 本次實驗環境為 作業系統macos docker版本 docker run itd name mymon network ceph network ip 172.20.0.10 e mon name mymon e mon ip 172.20.0.10 v etc ceph...