From 3f353ad072210baefd9e69c0b323b85833e77c51 Mon Sep 17 00:00:00 2001 From: William Hirigoyen Date: Fri, 10 Mar 2023 10:29:55 +0100 Subject: [PATCH] elasticsearch: disable GC logging --- CHANGELOG.md | 3 +-- elasticsearch/tasks/configuration.yml | 21 ++++----------------- elasticsearch/tasks/logs.yml | 8 -------- elasticsearch/templates/logrotate.j2 | 12 ------------ 4 files changed, 5 insertions(+), 39 deletions(-) delete mode 100644 elasticsearch/templates/logrotate.j2 diff --git a/CHANGELOG.md b/CHANGELOG.md index 70fc3f4a..7bd46d2d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,12 +38,12 @@ The **patch** part changes is incremented if multiple releases happen the same m * yarn: update apt key * apt: Use pub.evolix.org instead of pub.evolix.net' * userlogrotate: set rotate date format in right order (YYYY-MM-DD)! +* elasticsearch: Disable garabge collector logging (JDK >= 9) ### Fixed * Proper jinja spacing * evolinux-base: ensure dbus is started and enabled (not by default in the case of an offline netinst) -* elasticsearch : use logrotate for garbage collector logs instead of breaking compression cron * docker-host: fix type in daemon.json and remove host configuration that is already in the systemd service by default * haproxy: fix missing admin ACL in stats module access permissions * openvpn: fix the client cipher configuration to match the server cipher configuration @@ -54,7 +54,6 @@ The **patch** part changes is incremented if multiple releases happen the same m * userlogrotate: fix bug introduced in commit 2e54944a246 (rotated files were not zipped) * userlogrotate: skip zipping if .gz log already exists (prevents interactive question) * postfix: avoid Amavis transport to be considered dead when restarted. -* elasticsearch: Disable GC rotation for JDK 8 (priorly done only for >= 9) ### Removed diff --git a/elasticsearch/tasks/configuration.yml b/elasticsearch/tasks/configuration.yml index 77e90b09..7324f610 100644 --- a/elasticsearch/tasks/configuration.yml +++ b/elasticsearch/tasks/configuration.yml @@ -118,24 +118,11 @@ tags: - config -- name: Garbage collector logs rotation by the JVM is disabled (JDK >= 9) +- name: Disable garbage collector logs (JDK >= 9) lineinfile: - dest: /etc/elasticsearch/jvm.options.d/evolinux.options - regexp: "^-Xlog:gc" - line: "9-:-Xlog:gc*,gc+age=trace,safepoint:file=/var/log/elasticsearch/gc.log:utctime,pid,tags:filecount=0" - create: yes - owner: root - group: elasticsearch - mode: "0640" - tags: - - config - -- name: Garbage collector logs rotation by the JVM is disabled (JDK == 8) - lineinfile: - dest: /etc/elasticsearch/jvm.options.d/evolinux.options - regexp: "^-Xlog:gc" - line: "8:-XX:GCLogFileSize=0" - create: yes + dest: /etc/elasticsearch/jvm.options + regexp: "Xlog:gc" + line: "#9-:-Xlog:gc*,gc+age=trace,safepoint:file=/opt/my-app/gc.log:utctime,pid,tags:filecount=32,filesize=64m" owner: root group: elasticsearch mode: "0640" diff --git a/elasticsearch/tasks/logs.yml b/elasticsearch/tasks/logs.yml index 018a0201..8c5977a4 100644 --- a/elasticsearch/tasks/logs.yml +++ b/elasticsearch/tasks/logs.yml @@ -18,11 +18,3 @@ mode: "0750" when: is_cron_installed.rc == 0 -- name: "Setup logrotate for JVM garbage collector" - template: - src: logrotate.j2 - dest: /etc/logrotate/elasticsearch - owner: root - group: root - mode: "0750" - when: is_cron_installed.rc == 0 diff --git a/elasticsearch/templates/logrotate.j2 b/elasticsearch/templates/logrotate.j2 deleted file mode 100644 index 1e78ddec..00000000 --- a/elasticsearch/templates/logrotate.j2 +++ /dev/null @@ -1,12 +0,0 @@ -/var/log/elasticsearch/gc.log { - su elasticsearch elasticsearch - daily - rotate {{ elasticsearch_log_rotate_days }} - compress - nodelaycompress - missingok - copytruncate - dateext - dateformat .%Y-%m-%d -} -