Have no time to write on business trip ...
Create 150 OSD Today, find manual write ceph.conf a bit big, researched the increment function of vim.
Very simple is a command:
: Let I=0|g/reg/s//\=i/|let i=i+1
It can match the Reg in your text and then follow your i+n, increasing +n per pass
The function of the above command is to find the Reg character in the text, then replace it with 0 from the first, then +1
So in the ceph.conf, we can first copy out 150 [OSD.GGGG], and then in the use of the above command to increment, while Vim also supports CTRL + a digital +1,ctrl+x to the number 1, the feeling is quite convenient.
Forced Amway a wave of vim operation.
Of course, slowed is best with a for loop.
For i in ' seq 10 '; Do Echo [osd.${i}]>>/tmp/osd.conf; echo "host = Compute${b}" >>/tmp/osd.conf; b=$ ((b+1)); Done
Additionally add:
1, when the Ceph hangs the disk when using the partition disk character mount, may encounter the drive character drift problem, SDA becomes the SDB this, notice the use UUID mount.
Mount-u uuid/var/lib/ceph/osd/ceph-$i
2, in the maintenance of ceph, sometimes you put the OSD disk manually out, and then also down, and even deleted the OSD ID, but if you continue to delete the Crushmap information, ceph OSD Crush Remove OSD. $i, This can cause crushmap changes, and then a second PG migration occurs.
This article is from the "Danielqu" blog, make sure to keep this source http://qujunorz.blog.51cto.com/6378776/1891193
Ceph OSD Batch Creation