@dyj2017
2017-10-30T10:39:18.000000Z
字数 1024
阅读 1047
ceph
ceph实验
pg
[root@node1 ~]# echo "this is test! " >>test.txt
[root@node1 ~]# rados -p testpool ls
[root@node1 ~]# rados -p testpool put test.txt test.txt
[root@node1 ~]# rados -p testpool ls
test.txt
[root@node1 ~]# ceph osd map testpool test.txt
osdmap e76 pool 'testpool' (2) object 'test.txt' -> pg 2.8b0b6108 (2.8) -> up ([1,2,0], p1) acting ([1,2,0], p1)
[root@node2 ~]# systemctl stop ceph-osd@1
[root@node2 ~]# ceph osd map testpool test.txt
osdmap e79 pool 'testpool' (2) object 'test.txt' -> pg 2.8b0b6108 (2.8) -> up ([2,0], p2) acting ([2,0], p2)
[root@node2 ~]# ceph pg dump_stuck |grep ^2.8
2.8 active+undersized+degraded [2,0] 2 [2,0] 2
[root@node2 ~]# rados -p testpool get test.txt test.txt
[root@node2 ~]# cat test.txt
this is test!
[root@node2 ~]# systemctl start ceph-osd@1
[root@node2 ~]# ceph pg dump_stuck |grep ^2.8
ok
[root@node2 ~]# ceph osd map testpool test.txt
osdmap e82 pool 'testpool' (2) object 'test.txt' -> pg 2.8b0b6108 (2.8) -> up ([1,2,0], p1) acting ([1,2,0], p1)
通过上面的实验可以看出,当承载同一个pg的osd中的主osd out,次osd会临时升任主osd。在一定的时间间隔内,如果主osd up,该osd继续其主osd功能。