-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
#157 Add OS tunning
- Loading branch information
Showing
11 changed files
with
151 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
--- | ||
|
||
- name: Solr | Install required packages | ||
apt: | ||
pkg: "{{ item }}" | ||
state: present | ||
with_items: "{{ solr_sysctl_required_packages }}" | ||
when: solr_sysctl_required_packages is defined | ||
|
||
- name: Solr | Apply sysctl settings | ||
sysctl: | ||
name: "{{ item.name }}" | ||
value: "{{ item.value }}" | ||
sysctl_set: true | ||
state: present | ||
with_items: "{{ solr_sysctl_properties }}" | ||
when: solr_sysctl_properties is defined | ||
|
||
- name: Solr | Set to {{ solr_nofile_soft_limit }} the nofile soft limit | ||
pam_limits: | ||
domain: '{{ solr_user }}' | ||
limit_type: soft | ||
limit_item: nofile | ||
value: "{{ solr_nofile_soft_limit }}" | ||
when: solr_nofile_soft_limit is defined | ||
|
||
- name: Solr | Set to {{ solr_nofile_hard_limit }} the nofile hard limit | ||
pam_limits: | ||
domain: '{{ solr_user }}' | ||
limit_type: hard | ||
limit_item: nofile | ||
value: "{{ solr_nofile_hard_limit }}" | ||
when: solr_nofile_hard_limit is defined | ||
|
||
- name: Solr | Set to {{ solr_nproc_soft_limit }} the nproc soft limit | ||
pam_limits: | ||
domain: '{{ solr_user }}' | ||
limit_type: soft | ||
limit_item: nproc | ||
value: "{{ solr_nproc_soft_limit }}" | ||
when: solr_nproc_soft_limit is defined | ||
|
||
- name: Solr | Set to {{ solr_nproc_hard_limit }} the nproc hard limit | ||
pam_limits: | ||
domain: '{{ solr_user }}' | ||
limit_type: hard | ||
limit_item: nproc | ||
value: "{{ solr_nproc_hard_limit }}" | ||
when: solr_nproc_hard_limit is defined | ||
|
||
- name: Solr | Disable SWAP (1/2) | ||
shell: | | ||
swapoff -a | ||
when: solr_disable_swap | ||
|
||
- name: Solr | Disable SWAP in fstab (2/2) | ||
replace: | ||
path: /etc/fstab | ||
regexp: '^([^#].*?\sswap\s+sw\s+.*)$' | ||
replace: '# \1' | ||
when: solr_disable_swap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
[Unit] | ||
Description=LSB: Controls Apache Solr as a Service | ||
Before=multi-user.target | ||
Before=multi-user.target | ||
Before=multi-user.target | ||
Before=graphical.target | ||
After=remote-fs.target | ||
|
||
[Service] | ||
Type=forking | ||
Restart=no | ||
TimeoutSec=5min | ||
IgnoreSIGPIPE=no | ||
KillMode=process | ||
GuessMainPID=no | ||
RemainAfterExit=yes | ||
SuccessExitStatus=5 6 | ||
ExecStart=/etc/init.d/solr start | ||
ExecStop=/etc/init.d/solr stop | ||
|
||
|
||
{% if solr_nofile_soft_limit and solr_nofile_hard_limit %} | ||
LimitNOFILE={{solr_nofile_soft_limit}}:{{solr_nofile_hard_limit}} | ||
{% elif solr_nofile_hard_limit %} | ||
LimitNOFILE={{solr_nofile_hard_limit}} | ||
{% elif solr_nofile_soft_limit %} | ||
LimitNOFILE={{solr_nofile_soft_limit}} | ||
{% endif %} | ||
|
||
{% if solr_nproc_soft_limit and solr_nproc_hard_limit %} | ||
LimitNPROC={{solr_nproc_soft_limit}}:{{solr_nproc_hard_limit}} | ||
{% elif solr_nproc_hard_limit %} | ||
LimitNPROC={{solr_nproc_hard_limit}} | ||
{% elif solr_nproc_soft_limit %} | ||
LimitNPROC={{solr_nproc_soft_limit}} | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
--- | ||
|
||
solr_external_libraries_required_packages: | ||
- python-lxml | ||
- python-lxml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
--- | ||
|
||
solr_external_libraries_required_packages: | ||
- python-lxml | ||
- python-lxml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
--- | ||
|
||
solr_external_libraries_required_packages: | ||
- python-lxml | ||
- python-lxml |