Skip to content
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

mon: centralized config #20172

Merged
merged 144 commits into from Mar 6, 2018
Merged

mon: centralized config #20172

merged 144 commits into from Mar 6, 2018

Conversation

liewegas
Copy link
Member

@liewegas liewegas commented Jan 29, 2018

FUTURE TODO (later PR)

  • clean up tell|daemon config set output (gross json that makes no sense)
  • converge with mgr module config options
  • convert ConfigKeyService to a PaxosService (and unify with ConfigMonitor?)

TODO

  • use normal monclient auth for initial config
  • incorporate into global_init/common_init infrastructure
  • --no-mon-config argument
  • ceph config set WHO KEY VALUE
  • ceph config get WHO
  • ceph config get WHO KEY (includes default value)
  • ceph config dump
  • ceph config show WHO
  • ceph config show-with-defaults WHO
  • ceph config show WHO KEY
  • ceph config help
  • report mgr running config to mgr
  • annotate conf-only options (paxos_* maybe?)
  • make ConfigMonitor refresh more efficient than reparsing all config
  • show config option level in dump, get output
  • ceph config assimilate-conf -i old-ceph.conf -o new-ceph.conf
  • sort out ceph-conf behavior
  • 'option can be changed' in get and/or show (json?) output
  • docs
  • tests

@liewegas
Copy link
Member Author

jenkins render docs

@liewegas
Copy link
Member Author

jenkins render docs

@@ -327,6 +329,9 @@ void MgrClient::send_report()
}

report->osd_health_metrics = std::move(osd_health_metrics);

cct->_conf->get_config_bl(&report->config_bl);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It feels a bit much to send this on every report from every service: the value_bl part in md_config_t is already sorta-stateful and explicitly reset when changes are made, so get_config_bl could return a bool to indicate whether anything changed (i.e. whether value_bl was rewritten), and then this function would only include the config in the report in that situation.

" name=who,type=CephString" \
" name=name,type=CephString" \
" name=value,type=CephString", \
"Cet a configuration option for one or more entities",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/Cet/Set/

@liewegas liewegas force-pushed the wip-config branch 6 times, most recently from ab95d08 to bbe1e8a Compare February 13, 2018 03:57
@liewegas liewegas force-pushed the wip-config branch 3 times, most recently from 54a683c to a74f765 Compare February 17, 2018 15:56
@liewegas
Copy link
Member Author

retest this please

@liewegas
Copy link
Member Author

@tchaikov @ktdreyer I may need some help here. The make check build is failing with a compilation error that I can't reproduce locally (on multiple xenial boxes). And the error doesn't make any sense to me--the code is identical to that in several other mon/*.cc files that build just fine. Any ideas?

@liewegas
Copy link
Member Author

Nevermind, I fixed it! Used cmdmap_t instead of the raw type and it seemed to resolve it (somehow one variant added a std::less<void> template arg).

@liewegas
Copy link
Member Author

jenkins render docs

@liewegas
Copy link
Member Author

@jcsp @jdurgin this is ready for a final look!

Pass --no-mon-config so we don't get

 failed to fetch mon config (--no-mon-config to skip)

instead.

Signed-off-by: Sage Weil <sage@redhat.com>
Some of these cases make sense to fetch mon configs, but we are deprecating
ceph-disk anyway, and the tests currently make use of ceph-disk in places
that do not have a mon_host defined via a ceph.conf or other environment.
This avoids breaking those test cases without any real impact on users
(which will either use ceph-volume or presumably remain in a legacy config
environment).

Signed-off-by: Sage Weil <sage@redhat.com>
Return success if the mons are pre-mimic (and thus have no config).

Signed-off-by: Sage Weil <sage@redhat.com>
The normal timeouts automatically apply during the authenticate() stage,
but not to the explicit wait for a config.  If we don't get that quickly
we shoudl retry another monitor because it is possible we will connect to
an out-of-quorum (or otherwise unresponsive) mon.

Signed-off-by: Sage Weil <sage@redhat.com>
Signed-off-by: Sage Weil <sage@redhat.com>
Seems to resolve a build error on some compilers!  Meh.

Signed-off-by: Sage Weil <sage@redhat.com>
…option

If we are looking at a new value from the mon and comparing it to what we
already have active, compare the non-meta-substituted form.  This way a
value from the mon that can't update at runtime but we have already set to
the same value will not be falsely flagged as ignored.

Signed-off-by: Sage Weil <sage@redhat.com>
Common_init_finish does start_service_thread and does
set_safe_to_start_threads() on the cct, which switches us to 'runtime'
mode where we can't accept many config options. Do that *after* we fetch
our config from the mon so that we can accept+set runtime options (and
not complain to stderr about it).

Signed-off-by: Sage Weil <sage@redhat.com>
The keyfile arg might be - (stdin), which we can only read once.  Ensure
that we consume it once by intercepting the CLI value early and inserting
the value into the 'key' option.

This robs future code of the knowledge that the key came from --keyfile
and not --key, but avoids the issue of multiple users (notably, KeyRing.cc
and the OSD mkfs code).

Remove the - special case from OSD at the same time, since it can no
longer be reached (unless something other than the CLI specified '-', but
neither ceph.conf nor the mon config make sense here).

Signed-off-by: Sage Weil <sage@redhat.com>
…mons

These qualify as 'daemon', but their path is usually not unique.

Signed-off-by: Sage Weil <sage@redhat.com>
Signed-off-by: Sage Weil <sage@redhat.com>
It's possible that we successfully set active_con *and* time out the
cond WaitUntil.  Only set the error if we don't have a connection; if we
set it *and* time out then let's call it success.

Signed-off-by: Sage Weil <sage@redhat.com>
This is what OSDMonitor and MDSMonitor do.

Signed-off-by: Sage Weil <sage@redhat.com>
Signed-off-by: Sage Weil <sage@redhat.com>
Signed-off-by: Sage Weil <sage@redhat.com>
@liewegas liewegas merged commit d7692a2 into ceph:master Mar 6, 2018
@liewegas liewegas deleted the wip-config branch March 6, 2018 21:24
@@ -906,6 +842,67 @@ fi

if [ $CEPH_NUM_MON -gt 0 ]; then
start_mon

echo Populating config ...
cat <<EOF | $CEPH_BIN/ceph -c ceph.conf config assimilate-conf -i -
Copy link

@dillaman dillaman Mar 9, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: this breaks clusters started w/ mstart.sh since you assume the cluster config is located at ceph.conf instead of $conf_fn, which in turn breaks qa/workunits/rbd/rbd_mirror.sh on a dev box.

OSD_SECRET=$($CEPH_BIN/ceph-authtool --gen-print-key)
echo "{\"cephx_secret\": \"$OSD_SECRET\"}" > dev/osd$osd/new.json
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... also broken here w/ the hard-coded dev instead of $CEPH_DEV_DIR

epuertat added a commit to rhcs-dashboard/ceph that referenced this pull request Sep 10, 2018
Signed-off-by: John Spray <john.spray@redhat.com>
(cherry picked from commit bd80cf9)
Signed-off-by: Ernesto Puerta <epuertat@redhat.com>

As Centralized Config feature (PR ceph#20172) has not been backported to Luminous,
   `set_store` and `get_store` methods are just wrappers around
   `set_config` and `get_config`, respectively.
epuertat added a commit to rhcs-dashboard/ceph that referenced this pull request Sep 18, 2018
Signed-off-by: John Spray <john.spray@redhat.com>
(cherry picked from commit bd80cf9)
Signed-off-by: Ernesto Puerta <epuertat@redhat.com>

As Centralized Config feature (PR ceph#20172) has not been backported to Luminous,
   `set_store` and `get_store` methods are just wrappers around
   `set_config` and `get_config`, respectively.
epuertat added a commit to rhcs-dashboard/ceph that referenced this pull request Sep 26, 2018
Signed-off-by: John Spray <john.spray@redhat.com>
(cherry picked from commit bd80cf9)
Signed-off-by: Ernesto Puerta <epuertat@redhat.com>

As Centralized Config feature (PR ceph#20172) has not been backported to Luminous,
   `set_store` and `get_store` methods are just wrappers around
   `set_config` and `get_config`, respectively.

Signed-off-by: Ernesto Puerta <epuertat@redhat.com>
epuertat added a commit to rhcs-dashboard/ceph that referenced this pull request Sep 26, 2018
Signed-off-by: John Spray <john.spray@redhat.com>
(cherry picked from commit bd80cf9)
Signed-off-by: Ernesto Puerta <epuertat@redhat.com>

As Centralized Config feature (PR ceph#20172) has not been backported to Luminous,
   `set_store` and `get_store` methods are just wrappers around
   `set_config` and `get_config`, respectively.

Signed-off-by: Ernesto Puerta <epuertat@redhat.com>
epuertat added a commit to rhcs-dashboard/ceph that referenced this pull request Oct 1, 2018
Signed-off-by: John Spray <john.spray@redhat.com>
(cherry picked from commit bd80cf9)
Signed-off-by: Ernesto Puerta <epuertat@redhat.com>

As Centralized Config feature (PR ceph#20172) has not been backported to Luminous,
   `set_store` and `get_store` methods are just wrappers around
   `set_config` and `get_config`, respectively.

Signed-off-by: Ernesto Puerta <epuertat@redhat.com>
epuertat added a commit to rhcs-dashboard/ceph that referenced this pull request Oct 17, 2018
Signed-off-by: John Spray <john.spray@redhat.com>
(cherry picked from commit bd80cf9)
Signed-off-by: Ernesto Puerta <epuertat@redhat.com>

As Centralized Config feature (PR ceph#20172) has not been backported to Luminous,
   `set_store` and `get_store` methods are just wrappers around
   `set_config` and `get_config`, respectively.

Signed-off-by: Ernesto Puerta <epuertat@redhat.com>
epuertat added a commit to rhcs-dashboard/ceph that referenced this pull request Oct 26, 2018
Signed-off-by: John Spray <john.spray@redhat.com>
(cherry picked from commit bd80cf9)
Signed-off-by: Ernesto Puerta <epuertat@redhat.com>

As Centralized Config feature (PR ceph#20172) has not been backported to Luminous,
   `set_store` and `get_store` methods are just wrappers around
   `set_config` and `get_config`, respectively.

Signed-off-by: Ernesto Puerta <epuertat@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants