Skip to content
Snippets Groups Projects
Commit b1be8360 authored by William Xiong's avatar William Xiong
Browse files

Pool to balance must now always be specified

parent 4641bf53
No related branches found
No related tags found
1 merge request!3Use --only-poolid instead of bugfix
......@@ -17,8 +17,8 @@ MAX_REMAPS="20"
#Maximum number of pg movement attempts per osd. (--max-move-attempts)
MAX_MOVE_ATTEMPTS="50"
#Only balance osds within this pool. Use `ceph osd pool stats` to get the ID (--only-poolid)
POOL_ID="1"
#Name of the pool that JJ should balance. The ID of this pool will be fed into (--only-poolid)
POOL="cephfs_data"
################################
#### Shell Script arguments ####
......@@ -26,8 +26,3 @@ POOL_ID="1"
#Don't run placementoptimizer.py if the number of remapped pgs exceed this threshold
PG_THRESHOLD="1"
#The name of the pool used to search for remapped pgs.
#If left undefined, remapped pgs in the whole cluster will be considered.
#POOL="mf1fs_data"
......@@ -6,7 +6,7 @@ Wants=ceph-mon.target
EnvironmentFile=/opt/jj-ceph-balancer/ceph-jj-balancer.conf
WorkingDirectory=/opt/jj-ceph-balancer/
Type=simple
ExecStart=/opt/jj-ceph-balancer/placementoptimizer_service.sh ${DEV_CLASS} ${PG_THRESHOLD} ${MAX_REMAPS} ${MAX_MOVE_ATTEMPTS} ${POOL} ${POOL_ID}
ExecStart=/opt/jj-ceph-balancer/placementoptimizer_service.sh ${DEV_CLASS} ${PG_THRESHOLD} ${MAX_REMAPS} ${MAX_MOVE_ATTEMPTS} ${POOL}
[Install]
WantedBy=multi-user.target
......@@ -48,13 +48,9 @@ if [ -n "$5" ]
POOL=$5
POOL_ID=$(ceph df --format json | jq --arg poolname $POOL '.pools[] | select(.name == $poolname) | .id')
echo "Using Pool: $POOL with pool_id: $POOL_ID"
fi
if [ -n "$6" ]
then
#Only balance osds within this pool. Use `ceph osd pool stats` to get the ID (--only-poolid)
POOL_ID_CONF=$6
echo "Running placementoptimizer.py with --only-poolid $POOL_ID_CONF"
else
echo "Must Specify which pool to balance. Exiting"
exit 1
fi
......@@ -90,10 +86,6 @@ wait_remapped() {
while [ 1 ]; do
wait_remapped
if [[ -z "$POOL_ID_CONF" ]]; then
timeout 600 ./placementoptimizer.py -v balance --max-pg-moves $MAX_REMAPS --only-crushclass $DEV_CLASS --max-move-attempts $MAX_MOVE_ATTEMPTS | tee /tmp/balance-upmaps
else
timeout 600 ./placementoptimizer.py -v balance --max-pg-moves $MAX_REMAPS --only-crushclass $DEV_CLASS --max-move-attempts $MAX_MOVE_ATTEMPTS --only-poolid $POOL_ID_CONF| tee /tmp/balance-upmaps
fi
timeout 600 ./placementoptimizer.py -v balance --max-pg-moves $MAX_REMAPS --only-crushclass $DEV_CLASS --max-move-attempts $MAX_MOVE_ATTEMPTS --only-poolid $POOL_ID| tee /tmp/balance-upmaps
cat /tmp/balance-upmaps | /bin/bash
done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment