- when there are no arguments, print a short invitation to stderr to
use -h or --help and exit with an error.
- if we get -h or --help, print usage to stdout, and exit with success.
- do the above *before* making any contact with the cluster. we should
not fail to explain usage because the mons are down.
- if there is some other error with the arguments, print an error message,
but do not spam the user with usage. Try to use cerr instead of derr.
Signed-off-by: Sage Weil <sage@redhat.com>
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>
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>
- pass an optional map<string,string> instead of an arg list
- remember default values in md_config_t
- some nicer helpers
Signed-off-by: Sage Weil <sage@redhat.com>
In the process of starting the osd process,if system just call the
logratote("killall -q -1 ceph-mon ceph-mgr ceph-mds ceph-osd ceph-fuse radosgw...")
it will cause osd'init failed to start,
in addition, osd init slower than before, will increase the chances of the error.
Other modules(mon\mds\mgr...) also have type problems, but the most serious osd problem,
I can then make other modules similar changes.
Fixes: http://tracker.ceph.com/issues/22746
Signed-off-by: huanwen ren <ren.huanwen@zte.com.cn>
This is a portion of Part 1 of the namespace project: using ADL
properly in encode and decode so we can use namespaces easily in Ceph.
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
ceph-osd: fix auto detect which objectstore is currently running
Reviewed-by: Kefu Chai <kchai@redhat.com>
Reviewed-by: Chunmei Liu <chunmei.liu@intel.com>
Store a random value up to the filestore_split_rand_factor for each
collection when it is created or apply-layout-settings is run. This
should help distribute the load of splitting directories across a
longer period of time.
Fixes: http://tracker.ceph.com/issues/15835
Signed-off-by: Josh Durgin <jdurgin@redhat.com>
This unifies the first line of usage text: angle brackets
to indicate a mandatory option, and uppercase ID to match
the output from generic_server_usage(). It also ensures
ceph-mon prints all of its usage information to stdout,
same as the other daemons.
Signed-off-by: Tim Serong <tserong@suse.com>
We need to modify ms_type in unittest. That use SAFE_OPTION to declare ms_type
is safer than pass `safe=false` to set_val.
Signed-off-by: liuchang0812 <liuchang0812@gmail.com>
Whatever we specify is OR'd onto CEPH_FEATURE_SUPPORTED_DEFAULT (which is
all features) in the Policy() ctor. This argument is pointless.
Signed-off-by: Sage Weil <sage@redhat.com>
FileStore holds a number of recources like op thread pool and work
queue, key/value DB threads, etc. These should be properly stopped
(released) before exiting to avoid segfaults on exit.
Note: more code paths (mkfs, dump_journal, etc) need similar fixes,
these will be submitted as separate patches.
Fixes: http://tracker.ceph.com/issues/18820
Signed-off-by: Alexey Sheplyakov <asheplyakov@mirantis.com>
RADOS classes can now be statically compiled and added to
the embedded cephd library.
The RADOS ClassHandler now has an option to skip calling dlclose
just like PluginRegistry.
All RADOS classes where changed to use a CLS_INIT macro that
will either use __cls_init or classname_cls_init. this enables
the static compiling of all RADOS classes in a single library. Also
global method definitions where moved to inside cls_init.
Also added a few aconfig defines including WITH_EMBEDDED, WITH_CEPHFS,
WITH_RBD, and WITH_KVS. Note that WITH_RBD was not defined before
and the ceph-dencoder was broken when it was turned on.
Signed-off-by: Bassam Tabbara <bassam.tabbara@quantum.com>
Added supported for running MON and OSD daemon code almost
untouched directly from libcephd.
Also added two API functions for generating an FSID and secret
key that can be used to bootstrap a new cluster.
Signed-off-by: Bassam Tabbara <bassam.tabbara@quantum.com>
Compression and erasure coding plugins are now statically compiled
into libcephd. A new method is added to load them into the
respective registry.
The static libraries are only built when WITH_EMBEDDED is enabled
and existing plugins are unaffected.
Signed-off-by: Bassam Tabbara <bassam.tabbara@quantum.com>
prior to this change, global_init() could create a new CephContext
and assign it to g_ceph_context. it's our responsibilty to release
the CephContext explicitly using cct->put() before the application
quits. but sometimes, we fail to do so.
in this change, global_init() will return an intrusive_ptr<CephContext>,
which calls `g_ceph_context->put()` in its dtor. this ensures that
the CephContext is always destroyed before main() returns. so the
log is flushed before _log_exp_length is destroyed.
there are two cases where global_pre_init() is called directly.
- ceph_conf.cc: g_ceph_context->put() will be called by an intrusive_ptr<>
deleter.
- rgw_main.cc: global_init() is called later on on the success code
path, so it will be taken care of.
Fixes: http://tracker.ceph.com/issues/17762
Signed-off-by: Kefu Chai <kchai@redhat.com>
In 626360aab0 we made the
OSD cluster loopback connection CEPH_FEATURES_ALL, but
all other loopback connections got features == 0. I
can't come up with any reason we wouldn't want those
connections to have accurate feature bits, so let's just
use CEPH_FEATURES_ALL for all of them.
While we're here, make the cflags argument required.
Signed-off-by: Sage Weil <sage@redhat.com>
Resurrected jerasure_generic, jerasure_sse3, jerasure_sse4, jerasure_neon,
shec_generic, shec_sse3, shec_sse4 and shec_neon. These all are exact
copies of the new jerasure and shec plugins that support SIMD detection.
Moved EC preload code in ceph-mon and ceph-osd to a central location, added
warning when preloading legacy plugins.
OSMonitor::get_erasure_code and OSDMonitor:normalize_profile will now check
if legacy EC plugins are used and log a warning.
Added tests to check that warnings make it to the log.
Signed-off-by: Bassam Tabbara <bassam.tabbara@quantum.com>
Widen Messenger::create and XioMessenger constructor to support
per-Messenger instance creation parameters.
This introduce a minimalist generic set of flags to describe
the type of Messenger and its associated resources.
We apply the usage of these flags to ceph-osd's "workhorse",
"heartbeat" and "light" Messenger instances, ceph-mon and
other ceph clients Messengers.
Signed-off-by: Vu Pham <vu@mellanox.com>
Otherwise, all you see is errors about the probes that failed (e.g., a
failure to decode a non-bluestore superblock as bluestore).
Signed-off-by: Sage Weil <sage@redhat.com>