目次

24 Ceph OSD 追加

1.LVM prepare

ceph-volume lvm prepare --bluestore --data /dev/ceph/osd --block.db cas/rocksdb --block.wal cas/waldb

2.起動

systemctl start ceph-osd@4

LVM prepare Error

前のOSDデータが残っている場合は、エラーになる。

# ceph-volume lvm prepare --bluestore --data /dev/ceph/osd --block.db cas/rocksdb --block.wal cas/waldb
-->  RuntimeError: skipping ceph/osd, it is already prepared

対応

OSDデータを消してあげる

# ceph-volume lvm zap /dev/ceph/osd
--> Zapping: /dev/ceph/osd
Running command: /usr/bin/dd if=/dev/zero of=/dev/ceph/osd bs=1M count=10 conv=fsync
 stderr: 10+0 records in
10+0 records out
10485760 bytes (10 MB) copied
 stderr: , 0.0488377 s, 215 MB/s
--> Zapping successful for: <LV: /dev/ceph/osd>

Unable to create a new OSD id

# ceph-volume lvm prepare --bluestore --data /dev/ceph/osd --block.db cas/rocksdb --block.wal cas/waldb
Running command: /usr/bin/ceph-authtool --gen-print-key
Running command: /usr/bin/ceph --cluster ceph --name client.bootstrap-osd --keyring /var/lib/ceph/bootstrap-osd/ceph.keyring -i - osd new 7e50d522-b31d-42a6-9b3a-49f92cae2d25
 stderr: [errno 2] error connecting to the cluster
-->  RuntimeError: Unable to create a new OSD id

対応

cephのキーが無いので、authキーをおいてあげればOK

# ceph auth get client.bootstrap-osd
exported keyring for client.bootstrap-osd
[client.bootstrap-osd]
	key = AQAwT4de6ScSGBAAVohPwCT6irmyVH0PrnUT/A==
	caps mon = "allow profile bootstrap-osd"

# ceph auth get client.bootstrap-osd > /var/lib/ceph/bootstrap-osd/ceph.keyring