Commit Graph

145 Commits

Author SHA1 Message Date
Sage Weil
e67b70e7fa Merge pull request #7286 from ktdreyer/wip-10587-init-ceph-disk
init-ceph.in: skip ceph-disk if it is not present

Reviewed-by: Kefu Chai <kchai@redhat.com>
2016-02-24 10:42:37 -08:00
Sage Weil
03e01ae263 init-ceph: pass TCMALLOC_MAX_TOTAL_THREAD_CACHE_BYTES through
..when set in the sysconfig/default file.

Signed-off-by: Sage Weil <sage@redhat.com>
2016-01-20 18:36:08 -05:00
Ken Dreyer
7dd9af0a21 init-ceph.in: skip ceph-disk if it is not present
With the ceph-mon vs ceph-osd split packaging, users are expected to
have the ceph-mon package installed and not ceph-osd (and vice versa).
However, the init script (/etc/init.d/ceph) has a call to `ceph-disk`,
which may not be present on the machine.

Given that our packaging is not yet split upstream, this bug does not
manifest itself currently, because both ceph-mon and ceph-disk are
currently in the same "ceph" package. Once we split the packaging,
though, this will become an issue.

http://tracker.ceph.com/issues/10587 Refs: #10587

Signed-off-by: Ken Dreyer <kdreyer@redhat.com>
2016-01-19 10:01:59 -07:00
Loic Dachary
09d7a60ca8 Merge pull request #6866 from xiaoxichen/umount_before_mount
init-ceph: do umount when the path exists.

Reviewed-by: Loic Dachary <ldachary@redhat.com>
2015-12-13 13:47:30 +01:00
Xiaoxi Chen
09e21b495b init-ceph: do umount when the path exists.
If the specified mount point is in use, umount it instead
of skipping mounting the fs.

In previous code , if we forgot that we already mount something unrelated to
*this ceph osd * to the particular mount point, we will skip the mount and
finally get an error complaining superblock not matching OSD ID.

umount & remount is better because
1. If the wrong FS not in use, we can get the right FS we want and make ceph boot smoothly.
2. If the wrong FS is in use, we will get EBUSY on umount, which seems explain the situation
more clearly than superblock mismatch.

Signed-off-by: Xiaoxi Chen <xiaoxi.chen@intel.com>
2015-12-13 16:17:56 +08:00
Sage Weil
df56dc9e02 Merge pull request #6732 from aalba6675/patch-custom-cluster-name
sysvinit: allow custom cluster names

Reviewed-by: Sage Weil <sage@redhat.com>
2015-12-11 10:24:45 -05:00
Anthony Alba
13925c706d init-ceph.in: Allow custom cluster names during startup.
Signed-off-by: Richard Chan <richard@treeboxsolutions.com>
2015-12-02 07:48:23 +08:00
wangchaunhong
2f36909e1e init-ceph: fix systemd-run cant't start ceph daemon sometimes
Fixes: #13474
Signed-off-by: Chuanhong Wang <wang.chuanhong@zte.com.cn>
2015-12-01 10:29:09 -05:00
Nathan Cutler
a6d354c622 src/init-ceph.in: remove unused variables
Signed-off-by: Nathan Cutler <ncutler@suse.com>
2015-11-11 14:10:19 +01:00
Nathan Cutler
d4c0969714 src/init-ceph.in: improve usage message
Signed-off-by: Nathan Cutler <ncutler@suse.com>
2015-11-11 14:10:19 +01:00
Nathan Cutler
c994c0a9c4 src/init-ceph.in: process command-line options using getopt
http://tracker.ceph.com/issues/3015 Fixes: #3015

Signed-off-by: Nathan Cutler <ncutler@suse.com>
2015-11-11 14:10:14 +01:00
Sage Weil
3aa38bc07f make /var/run/ceph 770 ceph:ceph
This allows members of the ceph group to make librados clients (like the
ceph cli and qemu) create sockets in the default /var/run/ceph/* location.

Signed-off-by: Sage Weil <sage@redhat.com>
2015-09-11 11:26:59 -04:00
Yan, Zheng
bb1fa7f399 init-ceph: check if /lib/lsb/init-functions exists
On OSX/FreeBSD, /lib/lsb/init-functions does not exist

Signed-off-by: Yan, Zheng <zyan@redhat.com>
2015-08-31 16:00:24 +08:00
Yan, Zheng
4594adbc8f init-ceph: don't use procfs to check if daemon is running
use ps(1) instead, which is portable

Signed-off-by: Yan, Zheng <zyan@redhat.com>
2015-08-31 16:00:24 +08:00
Yan, Zheng
69e2060f17 init-ceph: replace 'echo -n' with printf
'echo -n' is no portable. On OSX, output of 'echo -n' can be '-n'

Signed-off-by: Yan, Zheng <zyan@redhat.com>
2015-08-31 16:00:24 +08:00
Sage Weil
743b15b412 debian: /var/run/ceph should be owned by ceph:ceph
Fix upstart and sysvinit scripts to create /var/run/ceph properly.

Chown existing dir on upgrade.

Signed-off-by: Sage Weil <sage@redhat.com>
2015-08-26 20:35:15 -04:00
Boris Ranto
25f68aee02 init-ceph.in: Set ceph user and group when running the daemons
Signed-off-by: Boris Ranto <branto@redhat.com>
2015-08-26 20:34:15 -04:00
John Spray
af31afa828 init-ceph.in: set executable bit
Scripts expect the generated init-ceph script
to be +x, and CMake does that if the file you
feed into it is +x.  This matches what we already
do with ceph.in.

Signed-off-by: John Spray <john.spray@redhat.com>
2015-08-10 14:05:53 +01:00
Sage Weil
e9e68655d7 init-ceph, ceph-osd-prestart: set osd weight with more precision
Our fixed point weights can go down to .0001 -- allow that.

Fixes: #11500
Signed-off-by: Sage Weil <sage@redhat.com>
2015-06-02 14:20:31 -07:00
huangjun
449ef48191 init-ceph.in: Create osd data dir before fs_type check.
One host in cluster crashed and rebuilded, but failed to start osds
  because the data dir not exist.

  Signed-off-by: huangjun <hjwsm1989@gmail.com>
2015-05-16 18:47:20 +08:00
Joao Eduardo Luis
189ef38074 init-ceph.in: add $PWD to PATH if running as ./init-ceph
ceph-mon needs crushtool in PATH and dev environments may not have
crushtool in the system's PATH.

Signed-off-by: Joao Eduardo Luis <joao@redhat.com>
2015-02-04 14:05:14 +00:00
Loic Dachary
487c22a8a4 init-ceph: stop returns before daemons are dead
The existence of the pidfile must be checked outside of the loop to send
a signal to the daemon. Otherwise the daemon will remove the pidfile and
stop can return before the process is dead because it only checks
/proc/$pid if the pidfile exists.

http://tracker.ceph.com/issues/10389 Fixes: #10389

Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-01-07 10:52:20 +01:00
Dongmao Zhang
24eb564768 Remove pidfile and asok after stopping ceph
Signed-off-by: Dongmao Zhang <deanraccoon@gmail.com>
2014-11-25 18:04:37 +08:00
Boris Ranto
2a61735621 Fedora 19 uses systemd but there is no systemd-run available in the release (rhbz#1157938), this patch makes sure that the init scripts check for availability of systemd-run before they use it (otherwise, they fall back to the default method)
Signed-off-by: Boris Ranto <branto@redhat.com>
2014-11-06 15:38:51 +01:00
Dan Mick
0778a4f243 Merge pull request #2811 from ceph/wip-vstart
init-ceph: make ./init-ceph behave from src dir on systemd
2014-10-30 11:19:01 -07:00
huangjun
59507101a0 Fix the match error when starting OSD daemons.
If we have osd.7 and osd.77 on the same host, osd.7 will not be mounted if
  osd.77 is mounted.
  Signed-off-by: huangjun <hjwsm1989@gmail.com>
2014-10-28 15:09:28 +08:00
Sage Weil
387d5d8275 init-ceph: make ./init-ceph behave from src dir on systemd
Signed-off-by: Sage Weil <sage@redhat.com>
2014-10-27 15:02:18 -07:00
Sage Weil
0d6d1aa7e0 init-ceph: don't use bashism
-z STRING
              the length of STRING is zero

Signed-off-by: Sage Weil <sage@redhat.com>
2014-08-15 16:41:43 -07:00
Alfredo Deza
44ed1885fb init-ceph: conditionally update after argparsing
Signed-off-by: Alfredo Deza <alfredo.deza@inktank.com>
2014-08-12 12:22:13 -07:00
Alfredo Deza
23b4915fa2 allow passing a --cluster flag to the init script
It will fallback to looking at /etc/ceph/$cluster.conf
otherwise.

Signed-off-by: Alfredo Deza <alfredo.deza@inktank.com>
2014-08-07 10:48:09 -04:00
Alfredo Deza
bdf5f30010 use cluster name when checking the host
Signed-off-by: Alfredo Deza <alfredo.deza@inktank.com>
2014-08-06 15:30:30 -04:00
Sage Weil
3e0d980076 init-ceph: wrap daemon startup with systemd-run when running under systemd
We want to make sure the daemon runs in its own systemd environment.  Check
for systemd as pid 1 and, when present, use systemd-run -r <cmd> to do
this.

Probably fixes #7627

Signed-off-by: Sage Weil <sage@redhat.com>
Reviewed-by: Dan Mick <dan.mick@inktank.com>
Tested-by: Dan Mick <dan.mick@inktank.com>
2014-07-15 18:11:41 -07:00
Sage Weil
6a7e20147c init-ceph: continue after failure doing osd data mount
If we are starting many daemons and hit an error, we normally note it and
move on.  Do the same when doing the pre-mount step.

Fixes: #8554
Signed-off-by: Sage Weil <sage@inktank.com>
2014-06-08 20:18:49 -07:00
Sage Weil
d04b386bdf init-ceph: if we fail to set an OSD's crush position, continue
If we fail to set the CRUSH position for one OSD, continue on to try
starting others, just as we do when we fail to start the daemon.

Fixes: #8342
Signed-off-by: Sage Weil <sage@inktank.com>
2014-05-20 16:29:23 -07:00
Sage Weil
46f1eb6865 init-ceph: continue loop immediately on daemon start failure
If we fail to start the daemon, skip the post_start and other steps.

Signed-off-by: Sage Weil <sage@inktank.com>
2014-05-20 16:28:31 -07:00
Sage Weil
084db49ed3 remove mkcephfs
Fixes: #7552
Signed-off-by: Sage Weil <sage@inktank.com>
2014-04-08 14:34:15 -07:00
Dmitry Smirnov
44afc2332e init: fix OSD startup issue
On machines with MON and OSDs (on boot) OSDs started shortly after MON startup
 but MON needs time to become oprational so OSDs fail to start due to short
 timeout because they don't have enough time to establish communication with
 cluster. This is even more likely to happen when there are other monitors down
 which is not unusual when servers are rebooting after power failure.
 Increasing timeout significantly improves chances for successful OSD start.

Signed-off-by: Dmitry Smirnov <onlyjob@member.fsf.org>
2014-03-29 12:06:37 +11:00
Sage Weil
fbbdbf0aae Merge pull request #1530 from onlyjob/fix-defaultweight
fix bug in 'defaultweight' calculation on OSD start.

Reviewed-by: Sage Weil <sage@inktank.com>
2014-03-25 21:44:19 -07:00
Dmitry Smirnov
4cf9a73bac fix bug in 'defaultweight' calculation on OSD start.
awk: cmd. line:1: { d=$2/1073741824 ; r = sprintf(\"%.2f\", d); print r }
  awk: cmd. line:1:                                 ^ backslash not last character on line
  awk: cmd. line:1: { d=$2/1073741824 ; r = sprintf(\"%.2f\", d); print r }
  awk: cmd. line:1:                                 ^ syntax error

Signed-off-by: Dmitry Smirnov <onlyjob@member.fsf.org>
2014-03-26 10:48:12 +11:00
Dmitry Smirnov
012bb5fb5b minor init.d scripts lintianisation:
* init.d-script-does-not-source-init-functions
 * init.d-script-does-not-implement-required-option
 * init.d-script-missing-lsb-description
2014-03-25 22:10:48 +11:00
Christopher O'Connell
d9bedb9ebe Added evaluation of cluster and fixed evaluation when setting initial weight on start in verbose mode
Signed-off-by: Christopher O'Connell <jwriteclub@gmail.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2014-02-21 17:32:47 -08:00
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