Ceph OSD 在 Ubuntu 14.04.1 中始终处于“关闭”状态

Ceph OSD 在 Ubuntu 14.04.1 中始终处于“关闭”状态

我正在尝试安装和部署 ceph 集群。由于我没有足够的物理服务器,我使用官方 Ubuntu 14.04 映像在我的 OpenStack 上创建了 4 个虚拟机。我想部署一个带有 1 个监视器节点和 3 个 OSD 节点的集群,并使用 ceph 版本0.80.7-0ubuntu0.14.04.1。我遵循了以下步骤手动部署文档,并成功安装了监视节点。但是,在安装 OSD 节点后,似乎 OSD 守护进程正在运行,但无法正确向监视节点报告。down当我请求命令时, osd 树始终显示ceph --cluster cephcluster1 osd tree

以下是可能与我的问题相关的命令和相应的结果。

root@monitor:/home/ubuntu# ceph --cluster cephcluster1 osd tree
# id    weight  type name       up/down reweight
-1      3       root default
-2      1               host osd1
0       1                       osd.0   down    1
-3      1               host osd2
1       1                       osd.1   down    1
-4      1               host osd3
2       1                       osd.2   down    1

root@monitor:/home/ubuntu# ceph --cluster cephcluster1 -s
    cluster fd78cbf8-8c64-4b12-9cfa-0e75bc6c8d98
     health HEALTH_WARN 192 pgs stuck inactive; 192 pgs stuck unclean; 3/3 in osds are down
     monmap e1: 1 mons at {monitor=172.26.111.4:6789/0}, election epoch 1, quorum 0 monitor
     osdmap e21: 3 osds: 0 up, 3 in
      pgmap v22: 192 pgs, 3 pools, 0 bytes data, 0 objects
            0 kB used, 0 kB / 0 kB avail
                 192 creating

/etc/ceph/cephcluster1.conf所有节点上的配置文件:

[global]
fsid = fd78cbf8-8c64-4b12-9cfa-0e75bc6c8d98
mon initial members = monitor
mon host = 172.26.111.4
public network = 10.5.0.0/16
cluster network = 172.26.111.0/24
auth cluster required = cephx
auth service required = cephx
auth client required = cephx
osd journal size = 1024
filestore xattr use omap = true
osd pool default size = 2
osd pool default min size = 1
osd pool default pg num = 333
osd pool default pgp num = 333
osd crush chooseleaf type = 1

[osd]
osd journal size = 1024

[osd.0]
osd host = osd1

[osd.1]
osd host = osd2

[osd.2]
osd host = osd3

当我启动其中一个 osd 守护进程时,记录OSD ID 的start ceph-osd cluster=cephcluster1 id=x位置:x

OSD 节点 #1 上的 /var/log/ceph/cephcluster1-osd.0.log:

2015-02-11 09:59:56.626899 7f5409d74800  0 ceph version 0.80.7 (6c0127fcb58008793d3c8b62d925bc91963672a3), process ceph-osd, pid 11230
2015-02-11 09:59:56.646218 7f5409d74800  0 genericfilestorebackend(/var/lib/ceph/osd/cephcluster1-0) detect_features: FIEMAP ioctl is supported and appears to work
2015-02-11 09:59:56.646372 7f5409d74800  0 genericfilestorebackend(/var/lib/ceph/osd/cephcluster1-0) detect_features: FIEMAP ioctl is disabled via 'filestore fiemap' config option
2015-02-11 09:59:56.658227 7f5409d74800  0 genericfilestorebackend(/var/lib/ceph/osd/cephcluster1-0) detect_features: syncfs(2) syscall fully supported (by glibc and kernel)
2015-02-11 09:59:56.679515 7f5409d74800  0 filestore(/var/lib/ceph/osd/cephcluster1-0) limited size xattrs
2015-02-11 09:59:56.699721 7f5409d74800  0 filestore(/var/lib/ceph/osd/cephcluster1-0) mount: enabling WRITEAHEAD journal mode: checkpoint is not enabled
2015-02-11 09:59:56.700107 7f5409d74800 -1 journal FileJournal::_open: disabling aio for non-block journal.  Use journal_force_aio to force use of aio anyway
2015-02-11 09:59:56.700454 7f5409d74800  1 journal _open /var/lib/ceph/osd/cephcluster1-0/journal fd 20: 1073741824 bytes, block size 4096 bytes, directio = 1, aio = 0
2015-02-11 09:59:56.704025 7f5409d74800  1 journal _open /var/lib/ceph/osd/cephcluster1-0/journal fd 20: 1073741824 bytes, block size 4096 bytes, directio = 1, aio = 0
2015-02-11 09:59:56.704884 7f5409d74800  1 journal close /var/lib/ceph/osd/cephcluster1-0/journal
2015-02-11 09:59:56.725281 7f5409d74800  0 genericfilestorebackend(/var/lib/ceph/osd/cephcluster1-0) detect_features: FIEMAP ioctl is supported and appears to work
2015-02-11 09:59:56.725397 7f5409d74800  0 genericfilestorebackend(/var/lib/ceph/osd/cephcluster1-0) detect_features: FIEMAP ioctl is disabled via 'filestore fiemap' config option
2015-02-11 09:59:56.736445 7f5409d74800  0 genericfilestorebackend(/var/lib/ceph/osd/cephcluster1-0) detect_features: syncfs(2) syscall fully supported (by glibc and kernel)
2015-02-11 09:59:56.756912 7f5409d74800  0 filestore(/var/lib/ceph/osd/cephcluster1-0) limited size xattrs
2015-02-11 09:59:56.776471 7f5409d74800  0 filestore(/var/lib/ceph/osd/cephcluster1-0) mount: WRITEAHEAD journal mode explicitly enabled in conf
2015-02-11 09:59:56.776748 7f5409d74800 -1 journal FileJournal::_open: disabling aio for non-block journal.  Use journal_force_aio to force use of aio anyway
2015-02-11 09:59:56.776848 7f5409d74800  1 journal _open /var/lib/ceph/osd/cephcluster1-0/journal fd 21: 1073741824 bytes, block size 4096 bytes, directio = 1, aio = 0
2015-02-11 09:59:56.777069 7f5409d74800  1 journal _open /var/lib/ceph/osd/cephcluster1-0/journal fd 21: 1073741824 bytes, block size 4096 bytes, directio = 1, aio = 0
2015-02-11 09:59:56.783019 7f5409d74800  0 <cls> cls/hello/cls_hello.cc:271: loading cls_hello
2015-02-11 09:59:56.783584 7f5409d74800  0 osd.0 11 crush map has features 1107558400, adjusting msgr requires for clients
2015-02-11 09:59:56.783645 7f5409d74800  0 osd.0 11 crush map has features 1107558400 was 8705, adjusting msgr requires for mons
2015-02-11 09:59:56.783687 7f5409d74800  0 osd.0 11 crush map has features 1107558400, adjusting msgr requires for osds
2015-02-11 09:59:56.783750 7f5409d74800  0 osd.0 11 load_pgs
2015-02-11 09:59:56.783831 7f5409d74800  0 osd.0 11 load_pgs opened 0 pgs
2015-02-11 09:59:56.792167 7f53f9b57700  0 osd.0 11 ignoring osdmap until we have initialized
2015-02-11 09:59:56.792334 7f53f9b57700  0 osd.0 11 ignoring osdmap until we have initialized
2015-02-11 09:59:56.792838 7f5409d74800  0 osd.0 11 done with init, starting boot process

监视节点上的 /var/log/ceph/ceph-mon.monitor.log:

2015-02-11 09:59:56.593494 7f24cc41d700  0 mon.monitor@0(leader) e1 handle_command mon_command({"prefix": "osd crush create-or-move", "args": ["host=osd1", "root=default"], "id": 0, "weight": 0.05} v 0) v1
2015-02-11 09:59:56.593955 7f24cc41d700  0 mon.monitor@0(leader).osd e21 create-or-move crush item name 'osd.0' initial_weight 0.05 at location {host=osd1,root=default}

up虽然按照同样的安装步骤将环境从 Ubuntu 14.04 更换为 CentOS 6.6 时,ceph OSD 显示正常,但是由于我对 Ubuntu 比 CentOS 更熟悉,我还是希望解决这个问题。

任何建议都值得赞赏。非常感谢!

答案1

我在非常相似的环境中遇到了同样的问题。我最后问题被追溯到混乱的 OSD UUID。MON 日志(不是 OSD 日志!)中的以下行暴露了问题:

... mon.minion-001@0(leader).osd e75 preprocess_boot from osd.0 10.208.66.2:6800/3427 clashes with existing osd: different fsid (ours: 71b33e7f-b464-4ba9-96b3-8c814921fea2 ; theirs: 5401be6f-b4ff-42ef-8531-78ee73772d5b)

我通过首先手动删除 OSD、破坏其文件系统并手动从头开始重新创建它来解决了这个问题。我随后必须找出问题是如何产生的。

鉴于我使用 puppet 设置 OSD,而它出错的原因可能与我的环境的特定内容有关,这意味着您遇到的问题可能不同,但也许您可以检查您的 MON 日志。不过,您必须在 MON 上启用调试,方法是在 ceph.conf 中声明以下内容:

[mon]
        debug mon = 9

有问题的消息记录在第 7 级,因此这会为您提供更多详细信息,而不会使所有内容变得非常冗长。

@LoicDachary:将此错误/警告消息记录在级别 0 不是更有意义吗?如果立即记录,我肯定会更早发现此问题。

相关内容