setup ceph-mgr daemon for luminous rc and greater
ceph-mgr daemon is required as part of Ceph cluster from luminous release onwards. Change-Id: I0903b3cd9fa84041bcd7ed5034d8a60d14759e92 Closes-Bug: #1708169
This commit is contained in:
@@ -52,6 +52,8 @@ ${CEPH_LOOPBACK_DISK_SIZE:-$CEPH_LOOPBACK_DISK_SIZE_DEFAULT}
|
|||||||
# Common
|
# Common
|
||||||
CEPH_FSID=$(uuidgen)
|
CEPH_FSID=$(uuidgen)
|
||||||
CEPH_CONF_FILE=${CEPH_CONF_DIR}/ceph.conf
|
CEPH_CONF_FILE=${CEPH_CONF_DIR}/ceph.conf
|
||||||
|
MDS_ID=${MDS_ID:-a}
|
||||||
|
MGR_ID=${MGR_ID:-x}
|
||||||
|
|
||||||
# RBD configuration defaults
|
# RBD configuration defaults
|
||||||
CEPH_RBD_DEFAULT_FEATURES=${CEPH_RBD_DEFAULT_FEATURES:-1}
|
CEPH_RBD_DEFAULT_FEATURES=${CEPH_RBD_DEFAULT_FEATURES:-1}
|
||||||
@@ -90,7 +92,6 @@ CEPHFS_DATA_POOL=${CEPHFS_DATA_POOL:-cephfs_data}
|
|||||||
|
|
||||||
MANILA_CEPH_DRIVER=${MANILA_CEPH_DRIVER:-cephfsnative}
|
MANILA_CEPH_DRIVER=${MANILA_CEPH_DRIVER:-cephfsnative}
|
||||||
MANILA_CEPH_USER=${MANILA_CEPH_USER:-manila}
|
MANILA_CEPH_USER=${MANILA_CEPH_USER:-manila}
|
||||||
MDS_ID=${MDS_ID:-a}
|
|
||||||
|
|
||||||
# Set ``CEPH_REPLICAS`` to configure how many replicas are to be
|
# Set ``CEPH_REPLICAS`` to configure how many replicas are to be
|
||||||
# configured for your Ceph cluster. By default we are configuring
|
# configured for your Ceph cluster. By default we are configuring
|
||||||
@@ -425,6 +426,14 @@ EOF
|
|||||||
sleep 5
|
sleep 5
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if [[ $(echo $ceph_version '>=' 12.1 | bc -l) == 1 ]] ; then
|
||||||
|
sudo mkdir -p ${CEPH_DATA_DIR}/mgr/ceph-${MGR_ID}
|
||||||
|
sudo ceph -c ${CEPH_CONF_FILE} auth get-or-create mgr.${MGR_ID} \
|
||||||
|
mon 'allow profile mgr' mds 'allow *' osd 'allow *' \
|
||||||
|
-o ${CEPH_DATA_DIR}/mgr/ceph-${MGR_ID}/keyring
|
||||||
|
sudo chown -R ceph. ${CEPH_DATA_DIR}/mgr
|
||||||
|
fi
|
||||||
|
|
||||||
# create a simple rule to take OSDs instead of hosts with CRUSH
|
# create a simple rule to take OSDs instead of hosts with CRUSH
|
||||||
# then apply this rule to the default pool
|
# then apply this rule to the default pool
|
||||||
if [[ $CEPH_REPLICAS -ne 1 ]]; then
|
if [[ $CEPH_REPLICAS -ne 1 ]]; then
|
||||||
@@ -835,9 +844,9 @@ function install_ceph {
|
|||||||
if [ $os_CODENAME != 'xenial' ]; then
|
if [ $os_CODENAME != 'xenial' ]; then
|
||||||
die $LINENO "Need Ubuntu xenial to setup Manila with CephFS NFS-Ganesha driver"
|
die $LINENO "Need Ubuntu xenial to setup Manila with CephFS NFS-Ganesha driver"
|
||||||
fi
|
fi
|
||||||
curl -L https://shaman.ceph.com/api/repos/ceph/kraken/latest/ubuntu/$os_CODENAME/repo | \
|
curl -L https://shaman.ceph.com/api/repos/ceph/luminous/latest/ubuntu/$os_CODENAME/repo | \
|
||||||
sudo tee /etc/apt/sources.list.d/ceph.list
|
sudo tee /etc/apt/sources.list.d/ceph.list
|
||||||
curl -L https://shaman.ceph.com/api/repos/nfs-ganesha/next/latest/ubuntu/$os_CODENAME/flavors/ceph_kraken/repo | \
|
curl -L https://shaman.ceph.com/api/repos/nfs-ganesha/next/latest/ubuntu/$os_CODENAME/flavors/ceph_luminous/repo | \
|
||||||
sudo tee /etc/apt/sources.list.d/ext-nfs-ganesha.list
|
sudo tee /etc/apt/sources.list.d/ext-nfs-ganesha.list
|
||||||
CEPH_PACKAGES="${CEPH_PACKAGES} ceph-mds libcephfs2 nfs-ganesha nfs-ganesha-ceph"
|
CEPH_PACKAGES="${CEPH_PACKAGES} ceph-mds libcephfs2 nfs-ganesha nfs-ganesha-ceph"
|
||||||
else
|
else
|
||||||
@@ -889,9 +898,9 @@ function install_ceph {
|
|||||||
if is_ceph_enabled_for_service manila; then
|
if is_ceph_enabled_for_service manila; then
|
||||||
if [ $MANILA_CEPH_DRIVER == 'cephfsnfs' ]; then
|
if [ $MANILA_CEPH_DRIVER == 'cephfsnfs' ]; then
|
||||||
if [ $DISTRO_TYPE == 'centos' ] && [ $RELEASE == 7 ]; then
|
if [ $DISTRO_TYPE == 'centos' ] && [ $RELEASE == 7 ]; then
|
||||||
curl -L https://shaman.ceph.com/api/repos/ceph/kraken/latest/$DISTRO_TYPE/$RELEASE/repo | \
|
curl -L https://shaman.ceph.com/api/repos/ceph/luminous/latest/$DISTRO_TYPE/$RELEASE/repo | \
|
||||||
sudo tee /etc/yum.repos.d/ext-ceph.repo
|
sudo tee /etc/yum.repos.d/ext-ceph.repo
|
||||||
curl -L https://shaman.ceph.com/api/repos/nfs-ganesha/next/latest/$DISTRO_TYPE/$RELEASE/flavors/ceph_kraken/repo | \
|
curl -L https://shaman.ceph.com/api/repos/nfs-ganesha/next/latest/$DISTRO_TYPE/$RELEASE/flavors/ceph_luminous/repo | \
|
||||||
sudo tee /etc/yum.repos.d/ext-ganesha.repo
|
sudo tee /etc/yum.repos.d/ext-ganesha.repo
|
||||||
fi
|
fi
|
||||||
CEPH_PACKAGES="${CEPH_PACKAGES} nfs-ganesha nfs-ganesha-ceph"
|
CEPH_PACKAGES="${CEPH_PACKAGES} nfs-ganesha nfs-ganesha-ceph"
|
||||||
@@ -927,6 +936,16 @@ function start_ceph {
|
|||||||
fi
|
fi
|
||||||
elif [[ $INIT_SYSTEM == 'systemd' ]] ; then
|
elif [[ $INIT_SYSTEM == 'systemd' ]] ; then
|
||||||
sudo systemctl start ceph-mon@$(hostname)
|
sudo systemctl start ceph-mon@$(hostname)
|
||||||
|
local ceph_version
|
||||||
|
ceph_version=$(_get_ceph_version mon)
|
||||||
|
if [[ $(echo $ceph_version '>=' 12.1 | bc -l) == 1 ]] ; then
|
||||||
|
sudo systemctl start ceph-mgr@${MGR_ID}
|
||||||
|
# use `tell mgr` as the mgr might not have been activated
|
||||||
|
# yet to register the python module commands.
|
||||||
|
if ! sudo ceph -c ${CEPH_CONF_FILE} tell mgr restful create-self-signed-cert; then
|
||||||
|
echo MGR Restful is not working, perhaps the package is not installed?
|
||||||
|
fi
|
||||||
|
fi
|
||||||
for id in $(sudo ceph -c ${CEPH_CONF_FILE} osd ls); do
|
for id in $(sudo ceph -c ${CEPH_CONF_FILE} osd ls); do
|
||||||
sudo systemctl start ceph-osd@$id
|
sudo systemctl start ceph-osd@$id
|
||||||
done
|
done
|
||||||
@@ -965,6 +984,11 @@ function stop_ceph {
|
|||||||
for id in $ids; do
|
for id in $ids; do
|
||||||
sudo systemctl stop ceph-osd@$id
|
sudo systemctl stop ceph-osd@$id
|
||||||
done
|
done
|
||||||
|
local ceph_version
|
||||||
|
ceph_version=$(_get_ceph_version cli)
|
||||||
|
if [[ $(echo $ceph_version '>=' 12.1 | bc -l) == 1 ]] ; then
|
||||||
|
sudo systemctl stop ceph-mgr@${MGR_ID}
|
||||||
|
fi
|
||||||
sudo systemctl stop ceph-mon@$(hostname)
|
sudo systemctl stop ceph-mon@$(hostname)
|
||||||
else
|
else
|
||||||
sudo service ceph stop > /dev/null 2>&1
|
sudo service ceph stop > /dev/null 2>&1
|
||||||
|
|||||||
Reference in New Issue
Block a user