Added NUMA detection and configure mongodb to work correctly using NUMA#294
Added NUMA detection and configure mongodb to work correctly using NUMA#294Madias2222 wants to merge 3 commits intoitential:devfrom
Conversation
| - name: Configure mongod to run with numactl interleave | ||
| ansible.builtin.copy: | ||
| dest: /etc/systemd/system/mongod.service.d/numa.conf | ||
| mode: "0644" | ||
| content: | | ||
| [Service] | ||
| ExecStart= | ||
| ExecStart={{ mongodb_numactl_path }} --interleave=all {{ mongodb_mongod_path }} --config {{ mongodb_conf_file }} | ||
| register: mongodb_numa_dropin | ||
| when: | ||
| - mongodb_numa_enabled | ||
| - mongodb_numactl_present | ||
| become: true |
There was a problem hiding this comment.
Can we use a template here?
There was a problem hiding this comment.
When we talk about systemd template is never a good choice, if Mongo Team update the systemd file our template is obsolete. Learning about systemd this is te correct way to override parameters in systemd.
This will guarantee that if the vendor make any update in the systemd file we are being updated with the latest vendor recommendation and not break our stuff
There was a problem hiding this comment.
You are using the copy module. So you are creating the file with the content, not updating an exiting file.
There was a problem hiding this comment.
Yes, I need to create a file with the content that I want to override, because that I'm using copy
| ansible.builtin.package: | ||
| name: numactl | ||
| state: present | ||
| when: mongodb_numa_enabled |
There was a problem hiding this comment.
You should use a block since when: mongodb_num_enabled is used for multiple tasks.
There was a problem hiding this comment.
I didn't understand this :-)
Removed unnecessary 'become: true' directives from various tasks in the configure-mongodb-numa.yml file.
Added NUMA detection and configure mongodb to work correctly using NUMA