激活osd时(ceph-deploy osd activate node1:/dev/sdm1)报错

[node1][WARNIN] command: Running command: /usr/bin/ceph --cluster ceph --name client.bootstrap-osd --keyring /var/lib/ceph/bootstrap-osd/ceph.keyring osd create --concise cf831c2a-aa3d-477a-bdea-5925dbf5acf3
[node1][WARNIN] mount_activate: Failed to activate
[node1][WARNIN] unmount: Unmounting /var/lib/ceph/tmp/mnt.qH1Byn
[node1][WARNIN] command_check_call: Running command: /bin/umount -- /var/lib/ceph/tmp/mnt.qH1Byn
[node1][WARNIN] Traceback (most recent call last):
[node1][WARNIN]   File "/usr/sbin/ceph-disk", line 9, in <module>
[node1][WARNIN]     load_entry_point('ceph-disk==1.0.0', 'console_scripts', 'ceph-disk')()
[node1][WARNIN]   File "/usr/lib/python2.7/site-packages/ceph_disk/main.py", line 5361, in run
[node1][WARNIN]     main(sys.argv[1:])
[node1][WARNIN]   File "/usr/lib/python2.7/site-packages/ceph_disk/main.py", line 5312, in main
[node1][WARNIN]     args.func(args)
[node1][WARNIN]   File "/usr/lib/python2.7/site-packages/ceph_disk/main.py", line 3435, in main_activate
[node1][WARNIN]     reactivate=args.reactivate,
[node1][WARNIN]   File "/usr/lib/python2.7/site-packages/ceph_disk/main.py", line 3192, in mount_activate
[node1][WARNIN]     (osd_id, cluster) = activate(path, activate_key_template, init)
[node1][WARNIN]   File "/usr/lib/python2.7/site-packages/ceph_disk/main.py", line 3355, in activate
[node1][WARNIN]     keyring=keyring,
[node1][WARNIN]   File "/usr/lib/python2.7/site-packages/ceph_disk/main.py", line 1018, in allocate_osd_id
[node1][WARNIN]     raise Error('ceph osd create failed', e, e.output)
[node1][WARNIN] ceph_disk.main.Error: Error: ceph osd create failed: Command '/usr/bin/ceph' returned non-zero exit status 1: 2019-10-09 16:26:13.892829 7fe600bed700  0 librados: client.bootstrap-osd authentication error (1) Operation not permitted
[node1][WARNIN] Error connecting to cluster: PermissionError
[node1][WARNIN]
[node1][ERROR ] RuntimeError: command returned non-zero exit status: 1
[ceph_deploy][ERROR ] RuntimeError: Failed to execute command: /usr/sbin/ceph-disk -v activate --mark-init systemd --mount /dev/sdm1

》1.

[root@node2 ceph-cluster]# ceph auth get client.bootstrap-osd --name mon. --keyring /var/lib/ceph/mon/ceph-node2/keyring
exported keyring for client.bootstrap-osd
[client.bootstrap-osd]
        key = AQAnVp1dBC6mKhAAzw0817xQOHZhnz0jPzwxEQ==
        caps mds = "allow *"
        caps mon = "allow *"
        caps osd = "allow *"
[root@node2 ceph-cluster]# 

2、修改对应server上的/var/lib/ceph/bootstrap-osd/ceph.keyring文件为上面查到的内容

3、重新激活osd

01-19 23:04