在Ceph的osd节点上,启动osd进程失败,查看其日志/var/log/ceph/ceph-osd.{osd-index}.log日志,报错如下:
2017-02-14 16:26:13.558535 7fe3883f58c0 0 filestore(/var/lib/ceph/osd/ceph-1) mount: enabling WRITEAHEAD journal mode: checkpoint is not enabled
2017-02-14 16:26:13.558712 7fe3883f58c0 -1 journal FileJournal::_open: disabling aio for non-block journal. Use journal_force_aio to force use of aio anyway
2017-02-14 16:26:13.558714 7fe3883f58c0 1 journal _open /var/lib/ceph/osd/ceph-1/journal fd 18: 5368709120 bytes, block size 4096 bytes, directio = 1, aio = 0
2017-02-14 16:26:13.558866 7fe3883f58c0 1 journal _open /var/lib/ceph/osd/ceph-1/journal fd 18: 5368709120 bytes, block size 4096 bytes, directio = 1, aio = 0
2017-02-14 16:26:13.559190 7fe3883f58c0 1 filestore(/var/lib/ceph/osd/ceph-1) upgrade
2017-02-14 16:26:13.559342 7fe3883f58c0 -1 osd.1 0 backend (filestore) is unable to support max object name[space] len
2017-02-14 16:26:13.559348 7fe3883f58c0 -1 osd.1 0 osd max object name len = 2048
2017-02-14 16:26:13.559350 7fe3883f58c0 -1 osd.1 0 osd max object namespace len = 256
2017-02-14 16:26:13.559353 7fe3883f58c0 -1 osd.1 0 (36) File name too long
2017-02-14 16:26:13.559863 7fe3883f58c0 1 journal close /var/lib/ceph/osd/ceph-1/journal
2017-02-14 16:26:13.560411 7fe3883f58c0 -1 ^[[0;31m ** ERROR: osd init failed: (36) File name too long
这个错误的原因是Ceph官网建议使用XFS作为OSD存储数据的文件系统,但我的文件系统时ext4,而ext4存储xattrs的大小有限制,使得OSD信息不能安全的保存。因此就有两种方法来解决这个问题:
- 修改Ceph配置文件的osd选项。将下面的信息添加到Ceph配置文件中global的section中,Ceph集群中,如果osd存储数据的文件系统是ext4的,都需要修改这个配置文件。然后重启对应的osd服务。
osd max object name len = 256 osd max object namespace len = 64
- 将文件系统改为XFS。