This avoids parsing out the wrong value when a long device name makes
df wrap over two lines.
Fixes: #6699
Reported-by: Jan Harkes <jaharkes@cs.cmu.edu>
Reviewed-by: Noah Watkins <noah.watkins@inktank.com>
Signed-off-by: Sage Weil <sage@inktank.com>
Instead of hard-coding a check in ceph.conf and some reasonable
defaults, defer this work to ceph-crush-location, and allow users to
specify their own hook with alternative logic.
This can be helpful in a nubmer of cases, like:
- rack (or other) information included in hostname and easily parsed
out by a hook
- multiple types of devices in each host, resulting in 'parallel'
crush trees (e.g., one for hdd, one for ssd)
Signed-off-by: Sage Weil <sage@inktank.com>
If the monitor is not currently available, this crush update would block
forever, preventing the OSD and (potentially) the rest of the system
from starting up. Instead, make it time out after 10 seconds and then
abort startup. This prevents startup of an OSD if we failed to update
the CRUSH position for some reason.
In fact, do not start up the OSD if the CRUSH update fails for any
reason--not just a timeout!
Works-around: #5612
Signed-off-by: Sage Weil <sage@inktank.com>
We need to be able to condrestart all the ceph services on a
machine, so that we don't restart daemons that are supposed to be
stopped (e.g. broken disks).
Signed-off-by: Dan van der Ster <daniel.vanderster@cern.ch>
Also increase fd limit defaults to accomodate the larger number
of fds.
Fixes: #5692
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
Reviewed-by: Mark Nelson <mark.nelson@inktank.com>
On 'service ceph start' or 'service ceph start osd' or start ceph-osd-all
we should activate any osd GPT partitions.
Signed-off-by: Sage Weil <sage@inktank.com>
fixed bug in init script, the "df" should be run on remote host by do_cmd,
and use $host instead of "hostname -s"
Signed-off-by: Xiaoxi Chen <xiaoxi.chen@intel.com>
(cherry picked from commit 1dd99f0fc9)
Conflicts:
src/init-ceph.in
We need to do df on the remote host, not locally.
Simlarly, the ceph command uses the osd key, which exists remotely; run it there.
Signed-off-by: Sage Weil <sage@inktank.com>
We would need to do hostname -s on the remote node, not the local one.
But we already have $host; use it!
Reported-by: Xiaoxi Chen <xiaoxi.chen@intel.com>
Signed-off-by: Sage Weil <sage@inktank.com>
- prepend $local to the $allconf list at the top
- remove $local special case for all case
- fix the type prefix checks to explicitly check for prefixes
Fugly bash, but works!
Backport: cuttlefish, bobtail
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Dan Mick <dan.mick@inktank.com>
Do not assume default osd data location.
Fixes: #4951
Backport: cuttlefish, bobtail
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Gary Lowelll <gary.lowell@inktank.com>
This is what the upstart ceph-osd.conf does; we need to do the same so that
new OSDs (e.g., that ceph-deploy creates) get added to the crush map.
Signed-off-by: Sage Weil <sage@inktank.com>
If you use -a to start a remote daemon, assume the remote config is present
instead of pushing the local config. This makes more sense and simplifies
things.
Note that this means that -a in concert with -c foo means that foo must
also be present on the remote node in the same path. That, however, is a
use case that I don't particularly care about right now. :)
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Dan Mick <dan.mick@inktank.com>
The old code would only do the push once per remote node (due to the
list in $pushed_to) but would reset $unique on each attempt. This would
break if a remote host was processed twice.
Fix by just skipping the $pushed_to optimization entirely.
Fixes: #4794
Reported-by: Andreas Friedrich <andreas.friedrich@ts.fujitsu.com>
Signed-off-by: Sage Weil <sage@inktank.com>
When starting we often loop over many daemon instances. Currently we stop
on the first error and do not try to start other daemons.
Instead, try them all, but return a failure if anything did not start.
Fixes: #2545
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Gary Lowell <gary.lowell@inktank.com>
The predictable file name is a security problem.
CVE-2013-1882
Reported-by: Michael Scherer <misc@zarb.org>
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Dan Mick <dan.mick@inktank.com>
We don't have a particularly tidy way to kick off ceph-create-keys from
sysvinit. So, do something simple, ugly, and functional: if we are
starting a mon, and it looks like a 'new' type that is in /var/lib/ceph,
then start ceph-create-keys too.
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Gary Lowell <gary.lowell@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
Fix handling of admin socket. The current script already use
$RUN_DIR to define a default, which is /var/run. Replace the
explicit path from get_conf call and replace it with $RUN_DIR.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Create pid and log dir only on start and not e.g. also on
stop. These calls are useless in other situtations than startup
the cluster or process.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Search /var/lib/ceph/$type/ceph-$id and start/stop those daemons if
present and tagged with the sysvinit file.
Signed-off-by: Sage Weil <sage@inktank.com>
ulimit -n from 'max open files' was being set only on the machine
running /etc/init.d/ceph. It needs to be added to the commands to
start the daemons, and run both locally and remotely.
Verified by examining /proc/<pid>/limits on local and remote hosts
Fixes: #3900
Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Loïc Dachary <loic@dachary.org>
Reviewed-by: Gary Lowell <gary.lowell@inktank.com>
The local state isn't propagated into the backtick shell, resulting in
'unknown' for all remote daemons. Avoid backticks altogether.
Signed-off-by: Sage Weil <sage@inktank.com>
This handles the remainder of 3581; it's a lot like the problem in
mkcephfs, but it isn't mkcephfs.
Fixes: #3581
Signed-off-by: Dan Mick <dan.mick@inktank.com>
Remove btrfs specific keys and replace them by more generic
keys to be able to replace btrfs with e.g. xfs or ext4 easily.
Add new key to define the osd fs type: 'osd mkfs type', which can
get defined in the [osd] section for all OSDs.
Replaced config keys:
- 'btrfs devs' -> 'devs'
- 'btrfs path' -> 'fs path'
- 'btrfs options' -> 'osd mount options $fstype'
New config key:
- 'osd mkfs options $fstype': file system specific options for mkfs
- 'osd mkfs type': to define the filesystem for mkfs and also mount
Replaced in mkcephfs: --mkbtrfs with --mkfs
Replaced in init-ceph:
- --btrfs with --fsmount
- --nobtrfs with --nofsmount
- --btrfsumount with --fsumount
NOTE: old options from mkcephfs and init-ceph will still work, but
get may removed in the future from the scripts.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
When running "service ceph status -a", a version number was never
returned for remote hosts, only for the local. This was because
the command to query the version number didn't use the do_cmd
function, which is responsible for running the command over SSH
when needed.
Modify the ceph init.d script to use do_cmd for querying the
Ceph version.
Signed-off-by: Travis Rhoden <trhoden@gmail.com>
With upstart the daemon shouldn't manage the pid file itself. Move this
out of the default config and into the legacy sysvinit script.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
- explicitly defined subsystems, and ceph_subsys_FOO enums to go with them
- modular log system with Entry object
- separate gather level and log level
- drop lots of DoutStreambuf hackery
Signed-off-by: Sage Weil <sage@newdream.net>
A bug in my previous patch prevented any daemon with auto_start set to false from starting.
This patch allows:
* /etc/init.d/ceph start osd|mds|mon
* service ceph start osd|mds|mon
It however does not start daemons if auto_start is disabled when you invoke:
* /etc/init.d/ceph start
* service ceph start
Signed-off-by: Wido den Hollander <wido@widodh.nl>
/run isn't present on older systems. Stick with the old location until it
is more pervasive, or we add an autoconf option to control it.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>