This is an automated email from the ASF dual-hosted git repository.

kturner pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/fluo-muchos.git


The following commit(s) were added to refs/heads/main by this push:
     new d2ebae1  avoids starting tracer for Accumulo 2.1.0 (#426)
d2ebae1 is described below

commit d2ebae1b6746a4432b21bf18350fbab96c4c9686
Author: Keith Turner <[email protected]>
AuthorDate: Wed Jan 12 10:40:19 2022 -0500

    avoids starting tracer for Accumulo 2.1.0 (#426)
---
 ansible/accumulo.yml                                    | 14 +++++++++++---
 ansible/roles/accumulo/tasks/main.yml                   |  6 ++++--
 .../{files => templates}/accumulo-cluster-systemd       | 17 +++++++++++++++--
 ansible/roles/accumulo/templates/accumulo-env.sh        |  2 +-
 lib/requirements.txt                                    |  2 +-
 5 files changed, 32 insertions(+), 9 deletions(-)

diff --git a/ansible/accumulo.yml b/ansible/accumulo.yml
index 1a50d70..ac247cc 100644
--- a/ansible/accumulo.yml
+++ b/ansible/accumulo.yml
@@ -53,7 +53,7 @@
       when: accumulo_major_version == '2' and not use_systemd
 - hosts: accumulomaster
   tasks:
-    - name: "start accumulo 2.0 master, monitor, gc & tracer"
+    - name: "start accumulo 2.x master, monitor, and gc"
       command: "nohup {{ accumulo_home }}/bin/accumulo-service {{ item }} 
start"
       register: start_result
       changed_when: "'Starting' in start_result.stdout"
@@ -61,8 +61,12 @@
         - master
         - monitor
         - gc
-        - tracer
       when: accumulo_major_version == '2' and not use_systemd
+    - name: "start accumulo 2.0 tracer"
+      command: "nohup {{ accumulo_home }}/bin/accumulo-service tracer start"
+      register: start_tracer_result
+      changed_when: "'Starting' in start_tracer_result.stdout"
+      when: accumulo_version is version('2.0.0','>=') and accumulo_version is 
version('2.1.0','<') and not use_systemd
 - hosts: accumulomaster
   tasks:
     - name: "install and start all the accumulo services using systemd"
@@ -70,9 +74,13 @@
         - import_tasks: roles/accumulo/tasks/start-master.yml
         - import_tasks: roles/accumulo/tasks/start-gc.yml
         - import_tasks: roles/accumulo/tasks/start-monitor.yml
-        - import_tasks: roles/accumulo/tasks/start-tracer.yml
       when: use_systemd
       become: yes
+    - name: "install and start all the accumulo tracer service using systemd"
+      block:
+        - import_tasks: roles/accumulo/tasks/start-tracer.yml
+      when: accumulo_version is version('2.0.0','>=') and use_systemd and 
accumulo_version is version('2.1.0','<')
+      become: yes
 
 - hosts: workers
   gather_facts: false
diff --git a/ansible/roles/accumulo/tasks/main.yml 
b/ansible/roles/accumulo/tasks/main.yml
index 9833c4a..6c99594 100644
--- a/ansible/roles/accumulo/tasks/main.yml
+++ b/ansible/roles/accumulo/tasks/main.yml
@@ -43,10 +43,12 @@
     - accumulo.properties
     - accumulo-client.properties
     - gc
-    - tracers
     - masters
     - monitor
   when: accumulo_major_version == '2'
+- name: "configure accumulo 2.0 tracer"
+  template: src=tracers dest={{ accumulo_home }}/conf/tracers
+  when: accumulo_version is version('2.0.0','>=') and accumulo_version is 
version('2.1.0','<')
 - name: "Rename 'masters' file to 'managers' when using Accumulo 2.1 or above"
   shell: |
     [[ -e {{ accumulo_home }}/conf/masters ]] && mv {{ accumulo_home 
}}/conf/masters {{ accumulo_home }}/conf/managers || echo "Nothing to do"
@@ -76,7 +78,7 @@
 - name: "Create accumulo log dir"
   file: path={{ worker_data_dirs[0] }}/logs/accumulo state=directory
 - name: "Copy the modified accumulo-cluster script that supports systemd to 
bin"
-  copy: src=roles/accumulo/files/accumulo-cluster-systemd dest={{ 
accumulo_home }}/bin/accumulo-cluster-systemd mode=0755
+  template: src=accumulo-cluster-systemd dest={{ accumulo_home 
}}/bin/accumulo-cluster-systemd mode=0755
   when: use_systemd
 - name: "Remove the existing accumulo-service and accumulo-cluster scripts"
   file: path={{ accumulo_home }}/bin/{{ item }} state=absent
diff --git a/ansible/roles/accumulo/files/accumulo-cluster-systemd 
b/ansible/roles/accumulo/templates/accumulo-cluster-systemd
similarity index 94%
rename from ansible/roles/accumulo/files/accumulo-cluster-systemd
rename to ansible/roles/accumulo/templates/accumulo-cluster-systemd
index 2d311c1..780c19b 100755
--- a/ansible/roles/accumulo/files/accumulo-cluster-systemd
+++ b/ansible/roles/accumulo/templates/accumulo-cluster-systemd
@@ -74,6 +74,7 @@ function verify_config {
       echo "$master1" > "${conf}/monitor"
     fi
   fi
+{% if accumulo_version is version('2.1.0','<') %}
 
   if [[ ! -f "${conf}/tracers" ]]; then
     if [[ -z "${master1}" ]] ; then
@@ -84,6 +85,7 @@ function verify_config {
       echo "$master1" > "${conf}/tracers"
     fi
   fi
+{% endif %}
 
   if [[ ! -f "${conf}/gc" ]]; then
     if [[ -z "${master1}" ]] ; then
@@ -178,11 +180,12 @@ function start_all() {
     start_service "$host" gc &
   done
   wait
-
+{% if accumulo_version is version('2.1.0','<') %}
   for host in $(grep -E -v '(^#|^\s*$)' "${conf}/tracers"); do
     start_service "$host" tracer &
   done
   wait
+{% endif %}
 }
 
 function start_here() {
@@ -215,6 +218,7 @@ function start_here() {
       break
     fi
   done
+{% if accumulo_version is version('2.1.0','<') %}
 
   for host in $local_hosts; do
     if grep -q "^${host}\$" "${conf}/tracers"; then
@@ -222,6 +226,7 @@ function start_here() {
       break
     fi
   done
+{% endif %}
 }
 
 function stop_service() {
@@ -286,17 +291,23 @@ function stop_all() {
     stop_service "$monitor" monitor &
   done
   wait
+{% if accumulo_version is version('2.1.0','<') %}
 
   for tracer in $(grep -E -v '(^#|^\s*$)' "${conf}/tracers"); do
     stop_service "$tracer" tracer &
   done
   wait
+{% endif %}
 
   # stop tserver still running
   stop_tservers
 
   echo "Cleaning all server entries in ZooKeeper"
+{% if accumulo_version is version('2.1.0','<') %}
   ${accumulo_cmd} org.apache.accumulo.server.util.ZooZap -master -tservers 
-tracers
+{% else %}
+  ${accumulo_cmd} org.apache.accumulo.server.util.ZooZap -manager -tservers
+{% endif %}
 }
 
 function stop_here() {
@@ -304,7 +315,7 @@ function stop_here() {
   hosts_to_check=("$(hostname -a 2> /dev/null | head -1)" "$(hostname -f)")
 
   for host in "${hosts_to_check[@]}"; do
-    for svc in  tserver gc master monitor tracer; do
+    for svc in  tserver gc master monitor{{ ' tracer' if accumulo_version is 
version('2.1.0','<') else '' }}; do
       stop_service "$host" "$svc"
     done
   done
@@ -335,7 +346,9 @@ function main() {
       echo "localhost" > "$conf/gc"
       echo "localhost" > "$conf/masters"
       echo "localhost" > "$conf/monitor"
+{% if accumulo_version is version('2.1.0','<') %}
       echo "localhost" > "$conf/tracers"
+{% endif %}
       echo "localhost" > "$conf/tservers"
       ;;
     restart)
diff --git a/ansible/roles/accumulo/templates/accumulo-env.sh 
b/ansible/roles/accumulo/templates/accumulo-env.sh
index 1200c51..9f9796e 100755
--- a/ansible/roles/accumulo/templates/accumulo-env.sh
+++ b/ansible/roles/accumulo/templates/accumulo-env.sh
@@ -111,7 +111,7 @@ JAVA_OPTS=("${JAVA_OPTS[@]}"
 
 case "$cmd" in
 {% if accumulo_version is version('2.1.0','>=') %}
-  monitor|gc|manager|tserver|tracer|compaction-coordinator|compactor)
+  monitor|gc|manager|tserver|compaction-coordinator|compactor)
     JAVA_OPTS=("${JAVA_OPTS[@]}" 
"-Dlog4j.configurationFile=log4j2-service.properties")
     ;;
 {% else %}
diff --git a/lib/requirements.txt b/lib/requirements.txt
index 4433ead..b15637e 100644
--- a/lib/requirements.txt
+++ b/lib/requirements.txt
@@ -1,4 +1,4 @@
 flake8==4.0.1
 ansible-core==2.11.3
-ansible-lint==5.3.1
+ansible-lint==5.3.2
 nose2==0.10.0

Reply via email to