From 7d60b02c8d386a558459d10954e91aedf863fd7c Mon Sep 17 00:00:00 2001 From: Ziye Yang Date: Tue, 22 Oct 2019 13:18:40 +0800 Subject: [PATCH] scripts/ceph: Always update the admin key config file. /etc/ceph/ceph.client.admin.keyring is used by the liborados client, if keyring is udpated, we should update this file. If we see: librados: client.admin authentication error (1) Operation not permitted Usually, we should set the read privilge for the file. Change-Id: I34967844a5d0578f740e601def4b0cbd297a95dc Signed-off-by: Ziye Yang Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/471947 Tested-by: SPDK CI Jenkins Reviewed-by: yidong0635 Reviewed-by: Changpeng Liu Reviewed-by: Shuhei Matsumoto Reviewed-by: Maciej Wawryk Reviewed-by: Jim Harris --- scripts/ceph/start.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/ceph/start.sh b/scripts/ceph/start.sh index 41a6a243d..a55601f37 100755 --- a/scripts/ceph/start.sh +++ b/scripts/ceph/start.sh @@ -66,6 +66,7 @@ echo -e "\tmon addr = ${mon_ip}:12046" >> "$ceph_conf" rm -rf ${mon_dir}/* mkdir -p ${mon_dir} mkdir -p ${pid_dir} +rm -f /etc/ceph/ceph.client.admin.keyring ceph-authtool --create-keyring --gen-key --name=mon. ${base_dir}/keyring --cap mon 'allow *' ceph-authtool --gen-key --name=client.admin --cap mon 'allow *' --cap osd 'allow *' --cap mds 'allow *' --cap mgr 'allow *' ${base_dir}/keyring @@ -79,6 +80,8 @@ cp ${base_dir}/keyring ${mon_dir}/keyring cp $ceph_conf /etc/ceph/ceph.conf cp ${base_dir}/keyring /etc/ceph/keyring +cp ${base_dir}/keyring /etc/ceph/ceph.client.admin.keyring +chmod a+r /etc/ceph/ceph.client.admin.keyring ceph-run sh -c "ulimit -n 16384 && ulimit -c unlimited && exec ceph-mon -c ${ceph_conf} -i a --keyring=${base_dir}/keyring --pid-file=${base_dir}/pid/root@$(hostname).pid --mon-data=${mon_dir}" || true