Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jj-ceph-balancer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
resplat-public
jj-ceph-balancer
Commits
b1be8360
Commit
b1be8360
authored
6 months ago
by
William Xiong
Browse files
Options
Downloads
Patches
Plain Diff
Pool to balance must now always be specified
parent
4641bf53
No related branches found
No related tags found
1 merge request
!3
Use --only-poolid instead of bugfix
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
ceph-jj-balancer.conf
+2
-7
2 additions, 7 deletions
ceph-jj-balancer.conf
ceph-jj-balancer.service
+1
-1
1 addition, 1 deletion
ceph-jj-balancer.service
placementoptimizer_service.sh
+4
-12
4 additions, 12 deletions
placementoptimizer_service.sh
with
7 additions
and
20 deletions
ceph-jj-balancer.conf
+
2
−
7
View file @
b1be8360
...
...
@@ -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
th
is
pool
. Use `ceph osd pool stats` to get the ID
(--only-poolid)
POOL
_ID
=
"1
"
#
Name of
th
e
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"
This diff is collapsed.
Click to expand it.
ceph-jj-balancer.service
+
1
−
1
View file @
b1be8360
...
...
@@ -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
This diff is collapsed.
Click to expand it.
placementoptimizer_service.sh
+
4
−
12
View file @
b1be8360
...
...
@@ -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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment