Add a new `-R` option (no-register) that will skip the step of
registering the lock helper as a ceph service. Ceph will treat the lock
helper more like a typical rados client. The `ceph -s` output will not
have ctdb listed under the services section (previous output):
```
cluster:
id:
5b81295a-fdec-11ef-a18f-
525400220000
health: HEALTH_WARN
1 stray daemon(s) not managed by cephadm
services:
mon: 3 daemons, quorum ceph0,ceph1,ceph2 (age 6m)
mgr: ceph0.mkodry(active, since 85s)
mds: 1/1 daemons up
osd: 6 osds: 6 up (since 52m), 6 in (since 52m)
ctdb: 1 daemon active (1 hosts)
```
Most importantly, this will avoid triggering health warnings from ceph
when cephadm discovers services that it did not create (or directly
manage) listed in the cluster. Something we looked into hiding on the
cephadm side but proved quite tricky so it's better off not to try this
registration on cephadm managed clusters in the first place.
In addition, the `1 daemon active` bit is somewhat confusing when you
have a N (N>1) node ctdb cluster managed by cephadm. The fact that the
mutex helper only runs on one of those nodes at once is a low level
implementation detail that most users do not need and I assume could
confuse.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
int ret;
int opt;
struct ctdb_mutex_rados_state *cmr_state;
+ bool skip_registering = false;
progname = argv[0];
cmr_state->object = argv[4];
optind = 5;
- while ((opt = getopt(argc, argv, "n:")) != -1) {
+ while ((opt = getopt(argc, argv, "n:R")) != -1) {
switch(opt) {
case 'n':
cmr_state->namespace = optarg;
break;
+ case 'R':
+ skip_registering = true;
+ break;
default:
usage();
ret = -EINVAL;
goto err_ctx_cleanup;
}
- ret = ctdb_mutex_rados_mgr_reg(cmr_state->ceph_cluster);
- if (ret < 0) {
- fprintf(stderr, "Failed to register with ceph-mgr\n");
- /* ignore: ceph-mgr service registration is informational */
+ if (!skip_registering) {
+ ret = ctdb_mutex_rados_mgr_reg(cmr_state->ceph_cluster);
+ if (ret < 0) {
+ fprintf(stderr, "Failed to register with ceph-mgr\n");
+ /* ignore: ceph-mgr service registration is informational */
+ }
}
ret = ctdb_mutex_rados_lock(cmr_state->ioctx, cmr_state->object,