Commit Graph

83850 Commits

Author SHA1 Message Date
Sage Weil
6f052edd8d common/config: distinguish between cmdline and override (injectargs)
This makes for a more informative 'ceph config show ...'.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:49 -06:00
Sage Weil
846f1041db global/global_init: make --show-config and --show-config-val reflect mon configs
Pull down all configs, including both argv and mon, before we do the
--show-config[-val] step.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:49 -06:00
Sage Weil
a012d99e06 mon/ConfigMonitor: "ceph config assimilate-conf"
Inject as much of a ceph.conf file as we can; spit we can't take back out
to stdout.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
8d1d7ec87d common/options: mark many options NO_MON_UPDATE
- things that identify monitors during startup
- things that identify auth key(s)
- things that only happy during mon mkfs
- things that are very specific to daemon forking/chdir/daemonize behavior

Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
a95cf66dac mgr/DaemonServer: make 'config show' indicate duplicate overrides
If we override an option with the same value, show the OVERRIDES item
in parenthesis.  (I tried "=$src" and "(=$src)" but neither looked any
better.)

Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
a9a619748a mgr/DaemonServer: 'ceph config show-with-defaults'
Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
86cf85e0a2 mgr: get config defaults on session open
Leave them encoded until they are used, since usually we won't use them.
This is about 50k currently.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
ed77b096ec mgr/DaemonServer: fix daemon registration
We want to take in the initial config for non-service daemons, too!
Restructure this so it makes more sense.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
ebe8fdfa96 common/config: get_defaults_bl()
Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
5b603ec8e6 osd,mds: 'config unset' tell command
Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
0db8fd2418 common/ceph_context: implement 'config unset <var>'
Clear an override value (if any).  This works for 'ceph daemon ...'
asok commands.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
948e308c6d mon/ConfigMonitor: show fabricated options as level 'unknown'
Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
d9dfece0dc mon/ConfigMonitor: include LEVEL column in config dump|get
Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
2a55463461 mon/ConfigMap: const * to Option, so we don't have to copy it
These are biggish structs (lots of strings), so it's expensive to make
copies of Option when it is an immutable struct.  However, we need to
handle arbitrary strings that we don't recognize, too.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
cf68ce511f mgr: have MgrStandby send mgr reports to active mgr (even self!)
This allows the mgr daemons to register state with the active mgr just
like the rest of the cluster, including perfcounters and current config.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
a1ca906a63 mon/ConfigMonitor: 'config help'
Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
49a5e775aa common/options: fix dump()
By convention dump() does not include the containing object section.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
86a6cf778c common/options: operator<< for value_t
Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
ef447b39ec vstart.sh: move debug values over to mon config
Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
0b3cfbe644 ceph-osd: do not set/override osd_objectstore config option
We use the one on disk, and nobody consumes the option except ceph-volume/
ceph-disk during mkfs.  Do not pollute the config space with a value that
isn't consumed.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
6621b2b49d common/config: "conffile" -> "file"
Easier on the eyes

Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
06bf4334f5 common/config: exclude host, fsid from config reproted to mgr
Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
d75459351f mon/ConfigMonitor: load_config() a bit less often
We could get very clever and avoid reparsing the full config every time
too, but that is a bit more work.  Leave that as a TODO.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
db62d92427 mon/ConfigMonitor: implement 'config {rm,get,dump}'
Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
1ae4f0db95 mgr: remove old 'config set' command
This is a cli command to set a config option on the mgr.  It doesn't
really belong because it only sets it on the mgr that happens to be
active.  It was probably mixed up with the asok or tell command.

Added in 057b73d641

Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
fdde016301 mon/MonClient: one-shot mon connection on started to fetch config
This is not particularly efficient, but it works:

 - connect to the monitor to get the monmap and config
 - tear it all down
 - proceed with normal startup (which presumably involves reconnecting
   to the mon all over again).

This allows us to set config options that may affect the mon communication
itself, like ms_type.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
f999e8aa54 mon/ConfigMonitor: always send initial config, even if empty
Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
c9f1fb841c common/ceph_context: count crypto/shutdown cycles
We need to allow crypto to be set up and torn down before a fork.  Count
the init/shutdown cycles to make that safe.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
4c7e382a47 common/ceph_context: whitespace
Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
a524868161 mon: handle MGetConfig
Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
e76a189732 vstart.sh: use mon config for many things
We also trim out some obsolete options while we're at it.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
936de8b3db mon: 'config set <who> <name> <value>'
Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
2f9617d801 mon/ConfigMonitor: refresh mon configs too
Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
3b0fc9537e mon/ConfigMap: some improvements
Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
7ccd515f82 mon/ConfigMap: move option mask parsing into helper
Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
d3dac3d280 mgr/DaemonServer: 'config show <who>'
Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
d8450574cf mgr/MgrClient: report running config to mgr
Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
e82f925eb3 mon/ConfigKeyService: add 'prefix' arg to 'config-key dump ...'
Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
8bd1f8d338 vstart.sh: less config noise
Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
bb4151ea0d common/options: remove obsolete 'crushtool' option
Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
7940f66b64 mon/MonClient: subscribe to config, handle updates
Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
38db0a289f mon/ConfigMonitor: add monitor service for distributing configs
Add 'config' subscribe option to get MConfigs on auth and when config is
updated.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
43a9d164d6 mon/ConfigMap: parsed cluster-wide config
Breaks down options by global, type, daemon, and can filter options by
crush location.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:48 -06:00
Sage Weil
081e52c7bf messages/MConfig: send config map
Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:47 -06:00
Sage Weil
9647e50886 common/config: set_mon_vals()
Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:47 -06:00
Sage Weil
37fe36fbe5 common/config: some cleanup; rm_val
Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:47 -06:00
Sage Weil
d4cc161566 cleanup: src/.libs -> build/lib
Clean up remaining traces of automake's .libs.  This makes unittest_*
tests easier to run by hand (mostly).

Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:47 -06:00
Sage Weil
f8d4e5b5e9 common/config: rewrite (╯°□°)╯︵ ┻━┻
This is too complete a rewrite to reasonably break down into small steps,
and even if I could, it would be harder to review that way than to simply
review the new implementation.  The semantics of the old one were so weird
that it's harder to reason about the change in behavior than to simply
review the new behavior.

That's my story, at least, and I'm sticking to it!

So, here are the highlights:

 - $foo meta expansions are evaluated at get_val() time.  This means the
weird bool arguments to set_val specifying whether things were expanded
are removed (they didn't make any sense unless you were thinking about the
old implementation).
 - for every option, we track values from any inputs (config, mon,
   override).  At get_val() time, we pick the highest priority one.
 - diff() is rewritten to be simple and to show you all of the above.
 - internal interfaces are simplified, and in terms of Option::value_t
   whenever possible.
 - unit tests simplified somewhat based on the above.

Known issues:

 - legacy values get pushed out in select cases.  Notably if foo=$bar
   and bar is updated, we do not update $foo (there is no dependency
   tracking to do this efficiently).

Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:47 -06:00
Sage Weil
55f902f267 common/config: whitespace
Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:10 -06:00
Sage Weil
dfd07f3820 common/config: streamline get_val_generic
Lookup value first; avoid a schema lookup entirely.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-03-06 14:44:10 -06:00