Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ceph daemons: Improve systemd services #242152

Open
spacekitteh opened this issue Jul 7, 2023 · 2 comments
Open

Ceph daemons: Improve systemd services #242152

spacekitteh opened this issue Jul 7, 2023 · 2 comments

Comments

@spacekitteh
Copy link
Contributor

A lot of Ceph issues I've been having with NixOS stem from the services generated by nixpkgs. Some things which I think will help massively are:

  1. Use template service files, particularly for the OSD daemons. It's rather annoying at the moment to manually modify each service of a given type when you have a large number of them in your cluster; I don't want to hardcode names, and this is a perfect use-case for templated services here.
  2. Create a service for activating ceph-volume OSDs. If you use ceph-volume to provision OSDs, then at each boot, you have to run ceph-volume lvm activate --all --no-systemd /after/ monitors become available, but /before/ any OSDs provisioned by ceph-volume are started. Currently, this is what I use:
systemd.services."ceph-volume-activate" = {
  requiredBy = ["ceph-osd.target"];
  requires = ["ceph-mon.target"];
  script = "ceph-volume lvm activate --all --no-systemd";
  path = [pkgs.ceph pkgs.util-linux pkgs.lvm2 pkgs.cryptsetup];
  serviceConfig = {
    Type = "oneshot";
    RemainAfterExit = "yes";
  };
};
systemd.targets."ceph-osd".requires = ["ceph-volume-activate.service" "ceph-mon.target"];

but I'm still tinkering.
3. Ensure the daemons have the proper paths. E.g. the mgr daemons should have pkgs.ceph and pkgs.smartmontools in their path (but smartctl still doesn't work on the dashboard; I'm still investigating).
4. Each daemon should have its state folder created automatically in /var/lib/ceph/, by user ceph. Currently, you have to manually create that folder.

If I think of more improvements that could be made, I'll add them here.

@deepfire
Copy link
Contributor

deepfire commented Jan 19, 2024

@spacekitteh, so I'm not alone -- I've also had to use a the ceph volume activation service.

Filed a PR: #281924

@deepfire
Copy link
Contributor

@spacekitteh, can't add you to reviewers, for some reason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants