go-ceph icon indicating copy to clipboard operation
go-ceph copied to clipboard

MonCommand How to send command : ceph tell osd.* injectargs '--osd-max-backfills 1

Open holidayun opened this issue 3 years ago • 2 comments

Find:

 "cmd483": {
       "sig": [
           "tell",
           {
               "name": "target",
               "type": "CephName"
           },
           {
               "n": "N",
               "name": "args",
               "type": "CephString"
           }
       ],
       "help": "send a command to a specific daemon",
       "module": "mon",
       "perm": "rw",
       "flags": 0
   },

my code map[string]interface{"prefix":"tell","target":"osd.*","args":"injectargs '--osd-max-backfills 1'"}) got error rados: ret=-22, Invalid argument

thank you for you answer~

holidayun avatar Sep 08 '22 03:09 holidayun

I have not tried this at all, but I think the "n": "N" flag indicates that there are multiple arguments - an array in json parlance. Try breaking your "args" into multiple arguments (in a slice) like "args": []string{"foo", "bar", "baz"}. Unfortunately, I am not sure where the breaks should be for injectargs, you may want to try a few different ways. If that doesn't work please let us know and I can look a little deeper into how the ceph command formats arguments when tell is used.

phlogistonjohn avatar Sep 08 '22 13:09 phlogistonjohn

thank you for your replay ~

map[string]interface{}{"prefix": "tell","target":"osd.*", "args": []string{"injectargs","--osd-max-backfills 1"}} map[string]interface{}{"prefix": "tell","target":"osd.*", "args": []string{"injectargs","--osd-max-backfills", "1"}}) map[string]interface{}{"prefix": "tell","target":"osd.*", "args": []string{"injectargs","osd-max-backfills", "1"}}) map[string]interface{}{"prefix": "tell","target":"osd.*", "args": []string{"injectargs","osd-max-backfills 1"}}) ........ They all failed, really need your help~~~

holidayun avatar Sep 09 '22 08:09 holidayun

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contribution.

github-actions[bot] avatar Oct 10 '22 00:10 github-actions[bot]

MonCommand How to send command : ceph tell osd.* injectargs '--osd-max-backfills 1

holidayun avatar Oct 12 '22 09:10 holidayun

Hi, I'd like to help more but unfortunately I'm not quite sure what the issue is. I have little direct experience with injectargs command. What I suggest is to try and instrument the python code of the ceph command such that you can see exactly what structure the ceph command is constructing when it issues the command to the ceph server.

In addition to the above, try looking at the mon logs to see if there are any hints about what the mon(s) expect for the formatting of the args property.

phlogistonjohn avatar Oct 12 '22 12:10 phlogistonjohn

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contribution.

github-actions[bot] avatar Nov 13 '22 00:11 github-actions[bot]