From cec24f99ab5e368d2dae7d53628fee09515bd873 Mon Sep 17 00:00:00 2001 From: chenliuzhong Date: Tue, 24 Oct 2017 10:54:33 +0800 Subject: [PATCH] ceph.spec.in,debian/rules: change aio-max-nr to 1048576 when osd is more than 14 in one host,it report error that aio is not enough. As the default aio-max-nr is 65536, one OSD needs 4096 aios and other programs may use aios. This patch change aio-max-nr to 1048576 when install ceph-osd rpm package and debian package Signed-off-by: chenliuzhong (cherry picked from commit 36326dc7104fc2f20f19d51b6f618a029ba072d7) --- ceph.spec.in | 7 +++++++ debian/ceph-osd.install | 1 + debian/ceph-osd.postinst | 1 + debian/rules | 1 + src/90-ceph-osd.conf | 1 + 5 files changed, 11 insertions(+) create mode 100644 src/90-ceph-osd.conf diff --git a/ceph.spec.in b/ceph.spec.in index 8f3a0051bb381..4ff8ccd74f965 100644 --- a/ceph.spec.in +++ b/ceph.spec.in @@ -884,6 +884,7 @@ mkdir -p %{buildroot}%{_sbindir} install -m 0644 -D src/logrotate.conf %{buildroot}%{_sysconfdir}/logrotate.d/ceph chmod 0644 %{buildroot}%{_docdir}/ceph/sample.ceph.conf install -m 0644 -D COPYING %{buildroot}%{_docdir}/ceph/COPYING +install -m 0644 -D src/90-ceph-osd.conf %{buildroot}%{_sysctldir}/90-ceph-osd.conf # firewall templates and /sbin/mount.ceph symlink %if 0%{?suse_version} @@ -1420,6 +1421,7 @@ fi %{_unitdir}/ceph-osd@.service %{_unitdir}/ceph-osd.target %attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/osd +%config(noreplace) %{_sysctldir}/90-ceph-osd.conf %post osd %if 0%{?suse_version} @@ -1433,6 +1435,11 @@ fi if [ $1 -eq 1 ] ; then /usr/bin/systemctl start ceph-osd.target >/dev/null 2>&1 || : fi +%if 0%{?sysctl_apply} + %sysctl_apply 90-ceph-osd.conf +%else + /usr/lib/systemd/systemd-sysctl %{_sysctldir}/90-ceph-osd.conf > /dev/null 2>&1 || : +%endif %preun osd %if 0%{?suse_version} diff --git a/debian/ceph-osd.install b/debian/ceph-osd.install index 0a386269f919a..87cd5011c1ec4 100644 --- a/debian/ceph-osd.install +++ b/debian/ceph-osd.install @@ -20,3 +20,4 @@ usr/share/man/man8/ceph-volume.8 usr/share/man/man8/ceph-volume-systemd.8 usr/share/man/man8/ceph-osd.8 usr/share/man/man8/ceph-bluestore-tool.8 +etc/sysctl.d/30-ceph-osd.conf diff --git a/debian/ceph-osd.postinst b/debian/ceph-osd.postinst index b642dfe346455..5e44548fe8261 100644 --- a/debian/ceph-osd.postinst +++ b/debian/ceph-osd.postinst @@ -23,6 +23,7 @@ set -e case "$1" in configure) + [ -x /etc/init.d/procps ] && invoke-rc.d procps restart || : [ -x /sbin/start ] && start ceph-osd-all || : ;; abort-upgrade|abort-remove|abort-deconfigure) diff --git a/debian/rules b/debian/rules index 92bc0b5877660..857888f84e764 100755 --- a/debian/rules +++ b/debian/rules @@ -50,6 +50,7 @@ override_dh_auto_install: install -D -m 644 udev/95-ceph-osd.rules $(DESTDIR)/lib/udev/rules.d/95-ceph-osd.rules install -D -m 644 udev/60-ceph-by-parttypeuuid.rules $(DESTDIR)/lib/udev/rules.d/60-ceph-by-parttypeuuid.rules install -D -m 644 src/etc-rbdmap $(DESTDIR)/etc/ceph/rbdmap + install -D -m 644 src/90-ceph-osd.conf $(DESTDIR)/etc/sysctl.d/30-ceph-osd.conf # doc/changelog is a directory, which confuses dh_installchangelogs override_dh_installchangelogs: diff --git a/src/90-ceph-osd.conf b/src/90-ceph-osd.conf new file mode 100644 index 0000000000000..c5c64bb705279 --- /dev/null +++ b/src/90-ceph-osd.conf @@ -0,0 +1 @@ +fs.aio-max-nr = 1048576 -- 2.39.5