From 8093798210929fc9d15197b76b41e19bed40e356 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 18 Oct 2017 17:20:20 -0400 Subject: [PATCH 1/8] rm /var/lib/mongodb/journal/prealloc.* --- roles/mongodb/tasks/main.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/roles/mongodb/tasks/main.yml b/roles/mongodb/tasks/main.yml index 25844896a..55ff95615 100644 --- a/roles/mongodb/tasks/main.yml +++ b/roles/mongodb/tasks/main.yml @@ -8,6 +8,11 @@ tags: - download +# See https://github.com/iiab/iiab/issues/254 for other attempts to eliminate these 256MB files +- name: remove journal prealloc files + shell: rm /var/lib/mongodb/journal/prealloc.* + when: not mongodb_enabled + - name: create the data directory for mongodb file: state=directory path={{ item.path }} @@ -17,7 +22,6 @@ - { path: '/library/dbdata/mongodb' } - { path: '/var/log/mongodb' } - - name: Create systemd files template: src={{ item.src }} dest={{ item.dest }} @@ -38,7 +42,6 @@ - { name: mongodb } when: mongodb_enabled - - name: disable services service: name={{ item.name }} enabled=no From eb2550141b4cbc454d74d897d2d30d91bb4cc546 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 18 Oct 2017 18:36:35 -0400 Subject: [PATCH 2/8] try removing prealloc files later, to catch them all --- roles/mongodb/tasks/main.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/roles/mongodb/tasks/main.yml b/roles/mongodb/tasks/main.yml index 55ff95615..51dd08d24 100644 --- a/roles/mongodb/tasks/main.yml +++ b/roles/mongodb/tasks/main.yml @@ -8,11 +8,6 @@ tags: - download -# See https://github.com/iiab/iiab/issues/254 for other attempts to eliminate these 256MB files -- name: remove journal prealloc files - shell: rm /var/lib/mongodb/journal/prealloc.* - when: not mongodb_enabled - - name: create the data directory for mongodb file: state=directory path={{ item.path }} @@ -50,6 +45,11 @@ - { name: mongodb } when: not mongodb_enabled +# See https://github.com/iiab/iiab/issues/254 for other attempts to eliminate these 256MB files +- name: remove journal prealloc files + shell: rm /var/lib/mongodb/journal/prealloc.* + when: not mongodb_enabled + - name: add mongodb to service list ini_file: dest='{{ service_filelist }}' section=mongodb From 48b30cc8a71857ed1cde6a414f5a674bf320f249 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 18 Oct 2017 19:08:30 -0400 Subject: [PATCH 3/8] remove prealloc.* in the Ansible way (works even if files absent) --- roles/mongodb/tasks/main.yml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/roles/mongodb/tasks/main.yml b/roles/mongodb/tasks/main.yml index 51dd08d24..12936476d 100644 --- a/roles/mongodb/tasks/main.yml +++ b/roles/mongodb/tasks/main.yml @@ -45,10 +45,19 @@ - { name: mongodb } when: not mongodb_enabled -# See https://github.com/iiab/iiab/issues/254 for other attempts to eliminate these 256MB files -- name: remove journal prealloc files - shell: rm /var/lib/mongodb/journal/prealloc.* - when: not mongodb_enabled +# See https://github.com/iiab/iiab/issues/254 for other attempts to eliminate +# these 256MB files. Brute Force Idea: rm /var/lib/mongodb/journal/prealloc.* +- name: find /var/lib/mongodb/prealloc.* files to delete + find: + paths: /var/lib/mongodb/journal + patterns: prealloc.* + register: files_to_delete + +- name: delete prealloc files + file: + path: "{{ item.path }}" + state: absent + with_items: "{{ files_to_delete.files }}" - name: add mongodb to service list ini_file: dest='{{ service_filelist }}' From 942bb4a18b66ade0f73a5d80f2d25b4f08b6f18d Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 18 Oct 2017 22:00:13 -0400 Subject: [PATCH 4/8] "when: not mongodb_enabled" added back --- roles/mongodb/tasks/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/roles/mongodb/tasks/main.yml b/roles/mongodb/tasks/main.yml index 12936476d..87a3f8824 100644 --- a/roles/mongodb/tasks/main.yml +++ b/roles/mongodb/tasks/main.yml @@ -52,12 +52,14 @@ paths: /var/lib/mongodb/journal patterns: prealloc.* register: files_to_delete + when: not mongodb_enabled - name: delete prealloc files file: path: "{{ item.path }}" state: absent with_items: "{{ files_to_delete.files }}" + when: not mongodb_enabled - name: add mongodb to service list ini_file: dest='{{ service_filelist }}' From 9361f6dc8843fceca8c1c82188edf1222761cd4c Mon Sep 17 00:00:00 2001 From: A Holt Date: Thu, 19 Oct 2017 00:29:52 -0400 Subject: [PATCH 5/8] remove both "when: not mongodb_enabled" so prealloc files actually get deleted See https://github.com/iiab/iiab/blob/master/roles/1-prep/tasks/computed_vars.yml#L63-L67 pasted in here: - name: Turn on mongodb if sugarizer enabled set_fact: mongodb_install: True mongodb_enabled: True when: sugarizer_enabled The above 5 lines might be commented out as an experiment, to dump MongoDB entirely on a trial basis. --- roles/mongodb/tasks/main.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/roles/mongodb/tasks/main.yml b/roles/mongodb/tasks/main.yml index 87a3f8824..12936476d 100644 --- a/roles/mongodb/tasks/main.yml +++ b/roles/mongodb/tasks/main.yml @@ -52,14 +52,12 @@ paths: /var/lib/mongodb/journal patterns: prealloc.* register: files_to_delete - when: not mongodb_enabled - name: delete prealloc files file: path: "{{ item.path }}" state: absent with_items: "{{ files_to_delete.files }}" - when: not mongodb_enabled - name: add mongodb to service list ini_file: dest='{{ service_filelist }}' From a60133713da290798e9b2673d3513e6787adbb95 Mon Sep 17 00:00:00 2001 From: A Holt Date: Thu, 19 Oct 2017 00:41:40 -0400 Subject: [PATCH 6/8] Trial removal of MongoDB, for a more lightweight Sugarizer --- roles/1-prep/tasks/computed_vars.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/roles/1-prep/tasks/computed_vars.yml b/roles/1-prep/tasks/computed_vars.yml index 5fb7f824d..e775e9fc3 100644 --- a/roles/1-prep/tasks/computed_vars.yml +++ b/roles/1-prep/tasks/computed_vars.yml @@ -60,11 +60,12 @@ # we decided to enable mysql unconditionally # when: elgg_enabled or rachel_enabled or owncloud_enabled or phpmyadmin_enabled or wordpress_enabled or iiab_menu_install -- name: Turn on mongodb if sugarizer enabled - set_fact: - mongodb_install: True - mongodb_enabled: True - when: sugarizer_enabled +# Commenting out MongoDB on a trial basis, for a more basic/lightweight Sugarizer, per https://github.com/iiab/iiab/pull/427 +# - name: Turn on mongodb if sugarizer enabled +# set_fact: +# mongodb_install: True +# mongodb_enabled: True +# when: sugarizer_enabled # There might be other db's - name: Turn on postgresql if moodle or pathagar enabled From f0b5dde2c7eceb9b4de133b3c8a9e57c1eaab704 Mon Sep 17 00:00:00 2001 From: A Holt Date: Thu, 19 Oct 2017 01:28:27 -0400 Subject: [PATCH 7/8] experiment with removing MongoDB --- roles/sugarizer/templates/sugarizer.service.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/sugarizer/templates/sugarizer.service.j2 b/roles/sugarizer/templates/sugarizer.service.j2 index 23e5a9206..fd5f17e40 100644 --- a/roles/sugarizer/templates/sugarizer.service.j2 +++ b/roles/sugarizer/templates/sugarizer.service.j2 @@ -1,6 +1,6 @@ [unit] Description=Node.js Sugarizer Server -Requires=After=mongodb.service # Requires the mongodb service to run first +# Requires=After=mongodb.service # Requires the mongodb service to run first [Service] WorkingDirectory={{ sugarizer_location }}/sugarizer/server/ From 9963f8bb1b243cf42cc36ae96395ce519b4f7551 Mon Sep 17 00:00:00 2001 From: A Holt Date: Thu, 19 Oct 2017 01:31:24 -0400 Subject: [PATCH 8/8] experiment with Sugarizer w/o MongoDB --- roles/sugarizer/meta/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/sugarizer/meta/main.yml b/roles/sugarizer/meta/main.yml index 60cc7431a..e3fcddc52 100644 --- a/roles/sugarizer/meta/main.yml +++ b/roles/sugarizer/meta/main.yml @@ -1,2 +1,2 @@ dependencies: - - { role: mongodb, tags: ['generic','mongodb'], when: sugarizer_install } +# - { role: mongodb, tags: ['generic','mongodb'], when: sugarizer_install }