单节点ceph集群无法响应客户端

时间:2020-07-08 14:20:17

标签: ceph cephfs

我试图建立一个小的单节点ceph集群,以使用ceph fs进行概念验证。集群正在使用以下命令运行centos 7 OS:

# ceph --version
ceph version 13.2.10 (564bdc4ae87418a232fc901524470e1a0f76d641) mimic (stable)

集群看起来很健康:

# ceph -s
  cluster:
    id:     fa18d061-b6fd-4092-bbe3-31f4f8493360
    health: HEALTH_OK

  services:
    mon: 1 daemons, quorum se-ceph1-dev
    mgr: se-ceph1-dev(active)
    mds: cephfs-1/1/1 up  {0=se-ceph1-dev=up:active}
    osd: 1 osds: 1 up, 1 in

  data:
    pools:   2 pools, 64 pgs
    objects: 22  objects, 2.2 KiB
    usage:   1.0 GiB used, 39 GiB / 40 GiB avail
    pgs:     64 active+clean

所有ceph命令都可以在OSD节点(也是mon,mgr,mds)上正常工作。但是,从另一台计算机作为客户端(默认用户admin)访问群集的任何尝试都将被完全忽略。 例如:

cephcli$ ceph status
2020-07-08 08:12:58.358 7fa4c568e700  0 monclient(hunting): authenticate timed out after 300
2020-07-08 08:17:58.360 7fa4c568e700  0 monclient(hunting): authenticate timed out after 300
2020-07-08 08:22:58.362 7fa4c568e700  0 monclient(hunting): authenticate timed out after 300
2020-07-08 08:27:58.364 7fa4c568e700  0 monclient(hunting): authenticate timed out after 300
2020-07-08 08:32:58.363 7fa4c568e700  0 monclient(hunting): authenticate timed out after 300

客户端计算机正在运行OS 18.04.1-Ubuntu,并且已安装与osd节点相同版本的ceph:

cephcli$ ceph --version
ceph version 13.2.10 (564bdc4ae87418a232fc901524470e1a0f76d641) mimic (stable)

我已确认没有任何客户被列入黑名单:

# ceph osd blacklist ls
listed 0 entries

我已验证各种ceph代理正在OSD节点上的各自端口上侦听:

# netstat -tnlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:6800            0.0.0.0:*               LISTEN      32591/ceph-osd
tcp        0      0 0.0.0.0:6801            0.0.0.0:*               LISTEN      32591/ceph-osd
tcp        0      0 0.0.0.0:6802            0.0.0.0:*               LISTEN      32591/ceph-osd
tcp        0      0 0.0.0.0:6803            0.0.0.0:*               LISTEN      32591/ceph-osd
tcp        0      0 0.0.0.0:6804            0.0.0.0:*               LISTEN      33279/ceph-mds
tcp        0      0 0.0.0.0:6805            0.0.0.0:*               LISTEN      32579/ceph-mgr
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      13881/sshd
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      14038/master
tcp        0      0 10.19.4.159:6789        0.0.0.0:*               LISTEN      32580/ceph-mon
tcp6       0      0 :::22                   :::*                    LISTEN      13881/sshd

我已验证客户端确实使用端口6789上的tcpdump将请求发送到OSD节点:

# tcpdump -i ens192 port 6789 -x -n
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on ens192, link-type EN10MB (Ethernet), capture size 262144 bytes
08:42:05.183071 IP 10.19.4.84.37170 > 10.19.4.159.smc-https: Flags [S], seq 4146143942, win 64240, options [mss 1460,sackOK,TS val 1566694440 ecr 0,nop,wscale 7], length 0
        0x0000:  4500 003c c7d9 4000 4006 55ca 0a13 0454
        0x0010:  0a13 049f 9132 1a85 f721 22c6 0000 0000
        0x0020:  a002 faf0 30cd 0000 0204 05b4 0402 080a
        0x0030:  5d61 dc28 0000 0000 0103 0307
08:42:05.383784 IP 10.19.4.84.37172 > 10.19.4.159.smc

我已经在客户端上验证了/etc/ceph/ceph.client.admin.keyring文件包含与OSD节点上相同的密钥。

我检查了监视器日志,并在OSD节点上发出请求时看到了条目:

2020-07-08 10:17:12.414 7f06268a3700  0 log_channel(audit) log [DBG] : from='client.? 10.19.4.159:0/3709075926' entity='client.admin' cmd=[{"prefix": "status"}]: dispatch

但是,没有任何内容可以反映我从客户端节点发出的请求。

因此,请求正在发送到OSD节点,但没有得到任何响应。我在哪里弄错了?

1 个答案:

答案 0 :(得分:1)

万一有人偶然发现,我找到了答案!至少-我特定问题的答案。 我的OSD主机使用iptables规则设置为默认的“防御”模式,该规则拒绝ssh以外的所有传入数据包。通过删除此规则,客户端请求立即开始工作。要删除规则(以我为例):

sudo iptables -D INPUT  -j REJECT --reject-with icmp-host-prohibited

一旦我这样做,客户端就可以立即连接。 CEPH故障排除指南实际上在“时钟偏斜”部分中提到了这一点:

https://docs.ceph.com/docs/mimic/rados/troubleshooting/troubleshooting-mon/#clock-skews

相关问题