Commit Graph

104 Commits

Author SHA1 Message Date
Sage Weil
6b8d4188db init-ceph: pass config file path when adjust crush position
Fixes: #6591
Reported-by: Sean Noonan <sean.noonan@twosigma.com>
Signed-off-by: Sage Weil <sage@inktank.com>
2014-01-02 16:52:14 -08:00
Sage Weil
fd175ab921 sysvinit, upstart: use df -P when weighting new OSDs
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>
2013-11-30 13:41:15 -08:00
Loic Dachary
3502d4f4b9 init: fix typo s/{$update_crush/${update_crush/
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Reviewed-by: Loic Dachary <loic@dachary.org>
2013-11-21 18:51:06 +01:00
Sage Weil
a3119bc2f3 upstart, sysvinit: use ceph-crush-location hook
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>
2013-10-29 14:00:03 -07:00
Sage Weil
177e2ab1ca init-ceph: make crush update on osd start time out
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>
2013-10-28 15:58:29 -07:00
Alfredo Deza
9d5b724a22 do not quote the variable to loop over
Signed-off-by: Alfredo Deza <alfredo.deza@inktank.com>
2013-09-26 13:10:26 -04:00
Alfredo Deza
5584b37163 reverse the order of the mons in the init script when stopping
Signed-off-by: Alfredo Deza <alfredo.deza@inktank.com>
2013-09-26 12:49:19 -04:00
Sage Weil
a0f3c643b6 init-ceph: behave if incompletely installed
e.g., Debian 'removed, config remains' state

Fixes: #5695
Signed-off-by: Sage Weil <sage@inktank.com>
2013-08-22 17:59:46 -07:00
Dan van der Ster
1e991edefe add condrestart to the sysvinit script
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>
2013-07-26 22:20:52 +02:00
Samuel Just
f653aa570e config_opts.h: increase xfs,btrfs wbthrottle defaults
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>
2013-07-25 11:10:45 -07:00
Sage Weil
4ed7942997 init-ceph: don't activate-all for vstart clusters
Signed-off-by: Sage Weil <sage@inktank.com>
2013-07-18 17:10:51 -07:00
Sage Weil
5e9a0a140a Merge branch 'next' 2013-06-17 19:55:55 -07:00
Sage Weil
13680976ef sysvinit, upstart: ceph-disk activate-all on start
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>
2013-06-17 09:49:54 -07:00
Sage Weil
1154b2ab75 init-ceph: look to ceph.conf instead of hard-coding /var/run/ceph
It could be elsewhere!

Signed-off-by: Sage Weil <sage@inktank.com>
2013-06-12 17:47:57 -07:00
Xiaoxi Chen
e09e94424b modified: src/init-ceph.in
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
2013-05-23 08:48:24 -07:00
Sage Weil
d81d0ea5c4 sysvinit: fix osd weight calculation on remote hosts
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>
2013-05-22 12:39:11 -07:00
Sage Weil
caa15a34cb sysvinit: use known hostname $host instead of (incorrectly) recalculating
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>
2013-05-22 12:39:10 -07:00
Sage Weil
c80c6a032c sysvinit: fix enumeration of local daemons when specifying type only
- 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>
2013-05-16 20:39:32 -07:00
Sage Weil
f2a54cc9c9 init-ceph: fix osd_data location when checking df utilization
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>
2013-05-08 14:35:54 -07:00
Sage Weil
c189d855e6 init-ceph: update osd crush map position on start
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>
2013-05-03 11:33:20 -07:00
Sage Weil
cd7e52cc76 init-ceph: use remote config when starting daemons on remote nodes (-a)
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>
2013-04-25 11:13:33 -07:00
Sage Weil
ccbc4dbc6e init-ceph: fix (and simplify) pushing ceph.conf to remote unique name
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>
2013-04-23 10:00:38 -07:00
Sage Weil
d395aa521e init-ceph: do not stop start on first failure
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>
2013-04-19 13:05:43 -07:00
Sage Weil
6a7ad2eac1 init-ceph: clean up temp ceph.conf filename on exit
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Dan Mick <dan.mick@inktank.com>
2013-03-22 13:25:43 -07:00
Sage Weil
051734522f init-ceph: push temp conf file to a unique location on remote host
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>
2013-03-22 13:25:33 -07:00
Sage Weil
a58eec90ca init-ceph: fix run dir
Signed-off-by: Sage Weil <sage@inktank.com>
2013-03-06 17:09:58 -08:00
Sage Weil
2a7e802d69 init-ceph: fix --restart option
Reported-by: Bryan K. Wright <bkw1a@ayesha.phys.virginia.edu>
Signed-off-by: Sage Weil <sage@inktank.com>
2013-03-04 12:34:58 -08:00
Sage Weil
ffc0ff68e0 init-ceph: kick off ceph-create-keys when starting mons
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>
2013-02-28 13:45:04 -08:00
Sage Weil
1e0b2d8952 init-ceph: fix default admin socket path used for status
Signed-off-by: Sage Weil <sage@inktank.com>
2013-02-28 13:44:52 -08:00
Danny Al-Gaaf
d029b936bb init-ceph.in: replace "/var/run/" by already used $RUN_DIR
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>
2013-02-14 18:12:30 +01:00
Danny Al-Gaaf
97c6ce0a2e init-ceph.in: create pid and log dir only on start
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>
2013-02-14 18:12:30 +01:00
Sage Weil
c8f528a407 init-ceph: iterate/locate local sysvinit-tagged directories
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>
2013-02-13 12:30:22 -08:00
Dan Mick
84a024b647 init-ceph: make ulimit -n be part of daemon command
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>
2013-01-29 16:48:17 -08:00
Sage Weil
942c71454b init-ceph: ok, 8K files
16K might be a bit many.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-12-28 17:12:06 -08:00
Sage Weil
672c56b18d init-ceph: default to 16K max_open_files
Signed-off-by: Sage Weil <sage@inktank.com>
2012-12-28 12:11:55 -08:00
Sage Weil
6c7b667bad init-ceph: fix status version check across machines
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>
2012-12-27 16:32:29 -08:00
Sage Weil
a09f5b1b46 init-ceph,mkcephfs: default inode64 for mounting xfs
According to hch this is now the default or new kernels.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-12-23 11:18:45 -08:00
Sage Weil
5f25f9f8cf init-ceph: default osd_data path
Signed-off-by: Sage Weil <sage@inktank.com>
2012-12-22 11:10:03 -08:00
Dan Mick
ac92e4d6bd /etc/init.d/ceph: fs_type assignment syntax error
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>
2012-12-12 19:40:16 -08:00
Sage Weil
f3029833c3 init-ceph: =, not ==
Reported-by: v@alan.lt
Signed-off-by: Sage Weil <sage@inktank.com>
2012-12-08 09:12:07 -08:00
Sage Weil
525f942edc init-ceph: do not make noise about missing devs
It is pretty normal not to include the devs line in the ceph.conf.  Do not
print/warn about it.

Signed-off-by: Sage Weil <sage@inktank.com>
2012-11-26 08:37:45 -08:00
Danny Al-Gaaf
df550c9cce make mkcephfs and init-ceph osd filesystem handling more flexible
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>
2012-11-23 19:14:52 -08:00
Travis Rhoden
60fdb6fda6 init-ceph: use SSH in "service ceph status -a" to get version
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>
2012-08-20 13:29:11 -07:00
Sage Weil
6e551f7341 init-ceph: make 'status' report running version
Try to report the running version with 'status'.

Backport: dho
Signed-off-by: Sage Weil <sage@inktank.com>
2012-06-12 13:58:22 -07:00
Sage Weil
1e76a8713f Merge remote branch 'gh/wip-defaults' 2012-04-12 22:36:48 -07:00
Sage Weil
292898a8f7 init-ceph: start at all runlevels
This fixes lintian error:

W: ceph: init.d-script-missing-start etc/init.d/ceph 4

Signed-off-by: Sage Weil <sage@newdream.net>
2012-04-11 10:40:04 -07:00
Sage Weil
8e1cc8ab09 init-ceph: manage pid_file from init script
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>
2012-04-06 14:07:45 -07:00
Sage Weil
f41887e38d log: new logging infrastructure
- 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>
2012-03-27 10:41:12 -07:00
Wido den Hollander
97926e1846 init: Actually do start the daemons when 'service ceph start <type>' is specified
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>
2012-02-28 09:10:52 -08:00
Sage Weil
402ece5e31 init-ceph: stick with /var/run for the time being
/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>
2012-02-26 20:56:05 -08:00