osd建立指令碼
#$1 = hostname, $2 = diskname, $3 = osd number
ceph-deploy disk zap $1:$2
ceph-deploy osd prepare $1:/dev/$2
ssh $1 "chown ceph:ceph /dev/2"
ceph-deploy osd activate $1:/dev/1:/dev/2
ssh $1 "sudo /libexec/ceph/ceph-osd-prestart.sh --cluster=ceph --id=$3"
osd刪除指令碼
# $1=osd number
#!/bin/sh
ceph osd down osd.$1
ceph osd out osd.$1
ceph osd crush remove osd.$1
ceph osd rm $1
ceph auth del osd.$1
帶空格的scp
scp @:"~/***/remote\ cluster"
帶埠的scp
scp -p 11022 -r @:~/ceph-cluster .
刪除pool命令
ceph osd pool delete data data --yes-i-really-really-mean-it
ntp時間同步
sudo service ntp stop
sudo ntpdate time.nist.gov
pool刪除
ceph osd pool delete --yes-i-really-really-mean-it
刪除cephfs
ceph stop mds
ceph mds rm 0
ceph fs ls
ceph fs rm --yes-i-really-mean-it
ceph fs rm arm_fs --yes-i-really-mean-it
ceph osd pool delete data data --yes-i-really-really-mean-it
ceph osd pool delete metadata metadata --yes-i-really-really-mean-it
新增ceph更新源
wget -q -o- '' | sudo apt-key add -
echo deb $(lsb_release -sc) main | sudo tee /etc/apt/sources.list.d/ceph.list
sudo apt-get update && sudo apt-get install ceph-deploy
建立mds
ceph-deploy mds create
建立儲存池
ceph osd pool create cephfs_data
ceph osd pool create cephfs_metadata
ceph fs new
ceph osd pool create data 128
ceph osd pool create metadata 128
ceph fs new arm_fs metadata data
掛載cephfs
sudo mount -t ceph :6789:/ /mnt/mycephfs -o name=admin,secretfile=admin.secret
pg數量調整
1.調整pg
ceph osd pool set pg_num
2.等待集群狀態恢復到正常
3.調整pgp
ceph osd pool set pgp_num
fio測試
fio -filename=/dev/sda1 -direct=1 -iodepth 1 -thread -rw=write -ioengine=libaio -bs=4m -size=10g -numjobs=10 -runtime=100 -group_reporting -name=writetest
fio -filename=/mnt/mycephfs/test -direct=1 -iodepth 1 -thread -rw=randread -ioengine=libaio -bs=4k -size=10g -numjobs=10 -runtime=100 -group_reporting -name=randreadtest
fio -filename=/mnt/mycephfs/test -direct=1 -iodepth 1 -thread -rw=write -ioengine=libaio -bs=4m -size=10g -numjobs=10 -runtime=100 -group_reporting -name=writetest
fio -filename=/mnt/mycephfs/test -direct=1 -iodepth 1 -thread -rw=write -ioengine=libaio -bs=4m -size=10g -numjobs=48 -runtime=100 -group_reporting -name=writetest
開機修改硬碟分割槽許可權
sudo vi /etc/profile
for i in a b;do sudo chown ceph.ceph /dev/sd"$i"*;done
ssh修改硬碟許可權(參考:
for i in a b;do sudo chown ceph.ceph /dev/sd*;done
ssh mnc01 "sudo echo 'for i in a b;do sudo chown ceph.ceph /dev/sd'$i'*;done' | sudo tee -a /etc/profile"
ceph檢視配置
ceph daemon . config show | less
sudo ceph daemon osd.2 config show | less
ceph修改配置
ceph tell . injectargs -- [-- ]
ceph tell osd.0 injectargs --debug-osd 20 --debug-ms 1
硬碟解除安裝
sudo start ceph-osd-all
sudo stop ceph-osd-all
sudo umount /dev/sda1
sudo umount /dev/sdb1
parted分割槽(參考:
parted /dev/sda
mklabel gpt
mkpart
分割槽名稱? ? //設定分割槽名
檔案系統型別? [ext2]? //直接回車
起始點? 0 //分割槽開始
結束點? -1 //分割槽結束 -1為全部硬碟空間
(parted) p //檢視分割槽結果
mkfs.xfs -f /dev/sda1//格式化分割槽
ceph常用命令
1.刪除osd a 凍結需要刪除的osd root node01 ceph osd out osd.4 marked out osd.4.b 用ceph w 檢視被凍結的osd遷移動作,遷移結束後繼續 無讀寫 c 停止要刪除的osd的程序或者服務 root node05 etc init.d cep...
Ceph常用命令
一 ceph集群常用命令 1 ceph狀態查詢常用命令 1 檢視ceph集群狀態 ceph s 2 檢視mon狀態 ceph mon stat 狀態說明 集群內 in 集群外 out 或者且在執行 up 掛了且不再執行 down 3 檢視osd狀態 ceph osd stat 4 檢視osd目錄樹 ...
linux運維常用命令
1.刪除0位元組檔案 find type f size 0 exec rm rf 2.檢視程序 按記憶體從大到小排列 ps e o c p z a sort k5 nr 3.按cpu利用率從大到小排列 ps e o c p z a sort nr 4.列印說 cache 裡的url 5.檢視http...