From 81b44fcfe2e3683997617f5c621d48d53ec0320b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Wed, 7 Jan 2015 11:41:35 +0100 Subject: [PATCH] Make OS tuning var configurable and file re-ordering MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Depending on the OS you are runnning on you should be able to configure these values. Re-ordering file for clarity as well. Signed-off-by: Sébastien Han --- roles/ceph-common/defaults/main.yml | 15 ++++- roles/ceph-common/tasks/main.yml | 71 +------------------- roles/ceph-common/tasks/os_check.yml | 12 ++++ roles/ceph-common/tasks/os_tuning.yml | 18 +++++ roles/ceph-common/tasks/prerequisite_ice.yml | 42 ++++++++++++ 5 files changed, 87 insertions(+), 71 deletions(-) create mode 100644 roles/ceph-common/tasks/os_check.yml create mode 100644 roles/ceph-common/tasks/os_tuning.yml create mode 100644 roles/ceph-common/tasks/prerequisite_ice.yml diff --git a/roles/ceph-common/defaults/main.yml b/roles/ceph-common/defaults/main.yml index 9f72b44d2..180b5c5e3 100644 --- a/roles/ceph-common/defaults/main.yml +++ b/roles/ceph-common/defaults/main.yml @@ -42,9 +42,10 @@ ceph_dev_branch: master # development branch you would like to use e.g: master, # For rhel, please pay attention to the versions: 'rhel6 3' or 'rhel 4', the fullname is _very_ important. ceph_dev_redhat_distro: centos7 -############### -# CONFIGURATION -############### + +#################### +# CEPH CONFIGURATION +#################### ## Ceph options # @@ -112,3 +113,11 @@ radosgw: false # referenced in monitor role too. # enable this mode _only_ when you have a single node # if you don't want it keep the option commented #common_single_host_mode: true + + +########### +# OS TUNING +########### + +os_tuning_pid_max: 4194303 +os_tuning_file_max: 26234859 diff --git a/roles/ceph-common/tasks/main.yml b/roles/ceph-common/tasks/main.yml index 400d6fd98..debd7aa4c 100644 --- a/roles/ceph-common/tasks/main.yml +++ b/roles/ceph-common/tasks/main.yml @@ -1,76 +1,11 @@ --- -- name: Fail on unsupported system - fail: "msg=System not supported {{ ansible_system }}" - when: "ansible_system not in ['Linux']" +- include: os_check.yml -- name: Fail on unsupported architecture - fail: "msg=Architecture not supported {{ ansible_architecture }}" - when: "ansible_architecture not in ['x86_64']" +- include: os_tuning.yml -- name: Fail on unsupported distribution - fail: "msg=Distribution not supported {{ ansible_os_family }}" - when: "ansible_os_family not in ['Debian', 'RedHat']" - -- name: Disable OSD directory parsing by updatedb - command: updatedb -e /var/lib/ceph - ignore_errors: true - -- name: Increase PID max value to a very large value - sysctl: > - name="kernel.pid_max" - value=4194303 - state=present - sysctl_file=/etc/sysctl.conf - -- name: Increase the maximum number of open files - sysctl: > - name="fs.file-max" - value=13211539 - state=present - sysctl_file=/etc/sysctl.conf - -- name: Create package directory - file: > - path={{ ceph_stable_ice_temp_path }} - state=directory - owner=root - group=root - mode=0644 +- include: prerequisite_ice.yml when: ceph_stable_ice -- name: Get ICE packages - get_url: > - url_username={{ ceph_stable_ice_user }} - url_password={{ ceph_stable_ice_password }} - url={{ ceph_stable_ice_url }}/{{ ceph_stable_ice_version }}/ICE-{{ ceph_stable_ice_version }}-{{ ceph_stable_ice_distro }}.tar.gz - dest={{ ceph_stable_ice_temp_path }}/ICE-{{ ceph_stable_ice_version }}-{{ ceph_stable_ice_distro }}.tar.gz - when: ceph_stable_ice - -- name: Get ICE Kernel Modules - get_url: > - url_username={{ ceph_stable_ice_user }} - url_password={{ ceph_stable_ice_password }} - url={{ ceph_stable_ice_url }}/{{ ceph_stable_ice_kmod_version }}/{{ item }} - dest={{ ceph_stable_ice_temp_path }} - with_items: - - kmod-libceph-{{ ceph_stable_ice_kmod }}.rpm - - kmod-rbd-{{ ceph_stable_ice_kmod }}.rpm - when: ceph_stable_ice and ansible_os_family == 'RedHat' - -- name: Stat extracted repo files - stat: > - path={{ ceph_stable_ice_temp_path }}/ice_setup.py - register: repo_exist - when: ceph_stable_ice - -- name: Extract packages - shell: "cd {{ ceph_stable_ice_temp_path }} && tar -xzf ICE-{{ ceph_stable_ice_version }}-{{ ceph_stable_ice_distro }}.tar.gz" - when: ceph_stable_ice and repo_exist.stat.exists == False - -- name: Move the extracted packages - shell: "mv {{ ceph_stable_ice_temp_path }}/ceph/*/* {{ ceph_stable_ice_temp_path }}" - when: ceph_stable_ice and repo_exist.stat.exists == False - - include: install_on_redhat.yml when: ansible_os_family == 'RedHat' diff --git a/roles/ceph-common/tasks/os_check.yml b/roles/ceph-common/tasks/os_check.yml new file mode 100644 index 000000000..3b716ef04 --- /dev/null +++ b/roles/ceph-common/tasks/os_check.yml @@ -0,0 +1,12 @@ +--- +- name: Fail on unsupported system + fail: "msg=System not supported {{ ansible_system }}" + when: "ansible_system not in ['Linux']" + +- name: Fail on unsupported architecture + fail: "msg=Architecture not supported {{ ansible_architecture }}" + when: "ansible_architecture not in ['x86_64']" + +- name: Fail on unsupported distribution + fail: "msg=Distribution not supported {{ ansible_os_family }}" + when: "ansible_os_family not in ['Debian', 'RedHat']" diff --git a/roles/ceph-common/tasks/os_tuning.yml b/roles/ceph-common/tasks/os_tuning.yml new file mode 100644 index 000000000..31581db91 --- /dev/null +++ b/roles/ceph-common/tasks/os_tuning.yml @@ -0,0 +1,18 @@ +--- +- name: Disable OSD directory parsing by updatedb + command: updatedb -e /var/lib/ceph + ignore_errors: true + +- name: Increase PID max value to a very large value + sysctl: > + name="kernel.pid_max" + value={{ os_tuning_pid_max }} + state=present + sysctl_file=/etc/sysctl.conf + +- name: Increase the maximum number of open files + sysctl: > + name="fs.file-max" + value={{ os_tuning_file_max }} + state=present + sysctl_file=/etc/sysctl.conf diff --git a/roles/ceph-common/tasks/prerequisite_ice.yml b/roles/ceph-common/tasks/prerequisite_ice.yml new file mode 100644 index 000000000..680665060 --- /dev/null +++ b/roles/ceph-common/tasks/prerequisite_ice.yml @@ -0,0 +1,42 @@ +--- +- name: Create ICE package directory + file: > + path={{ ceph_stable_ice_temp_path }} + state=directory + owner=root + group=root + mode=0644 + when: ceph_stable_ice + +- name: Get ICE packages + get_url: > + url_username={{ ceph_stable_ice_user }} + url_password={{ ceph_stable_ice_password }} + url={{ ceph_stable_ice_url }}/{{ ceph_stable_ice_version }}/ICE-{{ ceph_stable_ice_version }}-{{ ceph_stable_ice_distro }}.tar.gz + dest={{ ceph_stable_ice_temp_path }}/ICE-{{ ceph_stable_ice_version }}-{{ ceph_stable_ice_distro }}.tar.gz + when: ceph_stable_ice + +- name: Get ICE Kernel Modules + get_url: > + url_username={{ ceph_stable_ice_user }} + url_password={{ ceph_stable_ice_password }} + url={{ ceph_stable_ice_url }}/{{ ceph_stable_ice_kmod_version }}/{{ item }} + dest={{ ceph_stable_ice_temp_path }} + with_items: + - kmod-libceph-{{ ceph_stable_ice_kmod }}.rpm + - kmod-rbd-{{ ceph_stable_ice_kmod }}.rpm + when: ceph_stable_ice and ansible_os_family == 'RedHat' + +- name: Stat extracted ICE repo files + stat: > + path={{ ceph_stable_ice_temp_path }}/ice_setup.py + register: repo_exist + when: ceph_stable_ice + +- name: Extract ICE packages + shell: "cd {{ ceph_stable_ice_temp_path }} && tar -xzf ICE-{{ ceph_stable_ice_version }}-{{ ceph_stable_ice_distro }}.tar.gz" + when: ceph_stable_ice and repo_exist.stat.exists == False + +- name: Move ICE extracted packages + shell: "mv {{ ceph_stable_ice_temp_path }}/ceph/*/* {{ ceph_stable_ice_temp_path }}" + when: ceph_stable_ice and repo_exist.stat.exists == False