Commit 7d60b02c authored by Ziye Yang's avatar Ziye Yang Committed by Jim Harris
Browse files

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: default avatarZiye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/471947


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avataryidong0635 <dongx.yi@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarMaciej Wawryk <maciejx.wawryk@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 2176f081
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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