-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Need a "ceph-whatami" kind of utility that returns the type of ceph node {mon|mgr|mds|rgw|osd} #32
Comments
Stupid question: wouldn‘t a simple ps aux | grep osd be enough?
Mit freundlichen Grüßen
- Boris Behrens
… Am 22.09.2021 um 09:11 schrieb nikhil kshirsagar ***@***.***>:
It would be nice to have a utility that can run on any node and return what node it is (mon/mgr/mds/osd/rgw)
For a script, it's difficult to be sure what node it is running on. For example, if someone is writing a script that needs to do different things depending on whether it's run on a mon or osd node, for eg., there's no easy way to be sure unless you do a combination of things like check running services, examine /var/lib/ceph/XXX for non empty folders, etc.
So for example the expected behavior would be, when run on a OSD node,
$ceph-whatami
OSD
When run on a mon+mgr node
$ceph-whatami
MON
MGR
When run on a RGW node,
$ceph-whatami
RGW
This would come in handy for any scripts that need to behave differently depending on whether they're running on mon/osd/mgr/rgw/mds ceph nodes.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
|
Well the service may be down or crashed or manually stopped.
…On Wed, 22 Sep, 2021, 12:53 pm Boris Behrens, ***@***.***> wrote:
Stupid question: wouldn‘t a simple ps aux | grep osd be enough?
Mit freundlichen Grüßen
- Boris Behrens
> Am 22.09.2021 um 09:11 schrieb nikhil kshirsagar ***@***.***>:
>
>
> It would be nice to have a utility that can run on any node and return
what node it is (mon/mgr/mds/osd/rgw)
>
> For a script, it's difficult to be sure what node it is running on. For
example, if someone is writing a script that needs to do different things
depending on whether it's run on a mon or osd node, for eg., there's no
easy way to be sure unless you do a combination of things like check
running services, examine /var/lib/ceph/XXX for non empty folders, etc.
>
> So for example the expected behavior would be, when run on a OSD node,
> $ceph-whatami
> OSD
>
> When run on a mon+mgr node
> $ceph-whatami
> MON
> MGR
>
> When run on a RGW node,
> $ceph-whatami
> RGW
>
> This would come in handy for any scripts that need to behave differently
depending on whether they're running on mon/osd/mgr/rgw/mds ceph nodes.
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub, or unsubscribe.
> Triage notifications on the go with GitHub Mobile for iOS or Android.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#32 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADNFUF5BADMFH4D3U5GSIKDUDF76VANCNFSM5EQS4QMQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
a script I have to show CEPH services and the related hosts, is: #!/bin/env bash
clear
echo "# MONs #"
ceph mon metadata | jq -c '.[].name' | sort -u | sed 's/"//g'
echo "# MGRs #"
ceph mgr metadata | jq -c '.[].name' | sort -u | sed 's/"//g'
echo "# OSDs #"
ceph osd metadata | jq -c '.[].hostname' | sort -u | sed 's/"//g'
echo "# RGWs #"
ceph service dump | awk -F: ' /hostname/ {print $2}' | sed -e 's/"//g' -e 's/,//g' -e "s/ //g" | sort |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It would be nice to have a utility that can run on any node and return what node it is (mon/mgr/mds/osd/rgw)
For a script, it's difficult to be sure what node it is running on. For example, if someone is writing a script that needs to do different things depending on whether it's run on a mon or osd node, for eg., there's no easy way to be sure unless you do a combination of things like check running services, examine /var/lib/ceph/XXX for non empty folders, etc.
So for example the expected behavior would be, when run on a OSD node,
$ceph-whatami
OSD
When run on a mon+mgr node
$ceph-whatami
MON
MGR
When run on a RGW node,
$ceph-whatami
RGW
This would come in handy for any scripts that need to behave differently depending on whether they're running on mon/osd/mgr/rgw/mds ceph nodes.
The text was updated successfully, but these errors were encountered: