Browse Source

Move rabbitmq logs to volume for heka collecting

Change-Id: Ide02b7933000bf1a23c727cfaad1b7a9cad197f1
Proskurin Kirill 2 years ago
parent
commit
6e082e06e5

+ 1
- 1
docker/rabbitmq/rabbitmq_sudoers View File

@@ -1 +1 @@
1
-%microservices ALL=(root) NOPASSWD: /usr/bin/chown -R rabbitmq\: /var/lib/rabbitmq, /bin/chown -R rabbitmq\: /var/lib/rabbitmq, /bin/chown -R rabbitmq\: /etc/rabbitmq
1
+%microservices ALL=(root) NOPASSWD: /bin/chown -R rabbitmq\: /var/lib/rabbitmq, /bin/chown -R rabbitmq\: /etc/rabbitmq, /bin/chown rabbitmq\: /var/log/ccp/rabbitmq

+ 1
- 0
service/files/defaults.yaml View File

@@ -2,3 +2,4 @@ configs:
2 2
     rabbitmq_port: 5672
3 3
     rabbitmq_password: password
4 4
     rabbitmq_user: rabbitmq
5
+    rabbitmq_log_base: /var/log/ccp/rabbitmq

+ 2
- 0
service/files/rabbitmq-env.conf.j2 View File

@@ -0,0 +1,2 @@
1
+NODENAME=rabbitmq
2
+RABBITMQ_LOG_BASE={{ rabbitmq_log_base }}

+ 12
- 0
service/rabbitmq.yaml View File

@@ -8,15 +8,27 @@ service:
8 8
       probes:
9 9
         readiness: "true"
10 10
         liveness: "true"
11
+      volumes:
12
+      - name: rabbitmq-logs
13
+        path: "{{ rabbitmq_log_base }}"
14
+        type: host
15
+        readOnly: False
16
+      pre:
17
+        - name: chown-logs-dir
18
+          command: "sudo /bin/chown rabbitmq: {{ rabbitmq_log_base }}"
11 19
       daemon:
12 20
         files:
13 21
           - rabbitmq-conf
22
+          - rabbitmq-env
14 23
           - erlang-cookie
15 24
         command: rabbitmq-server
16 25
 files:
17 26
   rabbitmq-conf:
18 27
     path: /etc/rabbitmq/rabbitmq.config
19 28
     content: rabbitmq.config.j2
29
+  rabbitmq-env:
30
+    path: /etc/rabbitmq/rabbitmq-env.conf
31
+    content: rabbitmq-env.conf.j2
20 32
   erlang-cookie:
21 33
     path: /var/lib/rabbitmq/.erlang.cookie
22 34
     content: erlang.cookie

Loading…
Cancel
Save