Fix kafka logs not being deleted
Change-Id: I5269332bbe780422a73f6845e5efbf1598b0c1b3
Closes-Bug: PROD-16382
diff --git a/opencontrail/control/analytics4_0.yml b/opencontrail/control/analytics4_0.yml
index a426e02..c38e06a 100644
--- a/opencontrail/control/analytics4_0.yml
+++ b/opencontrail/control/analytics4_0.yml
@@ -5,6 +5,8 @@
- system.haproxy.proxy.listen.opencontrail.analytics
parameters:
_param:
+ opencontrail_kafka_log_cleanup_mtime: '+7'
+ opencontrail_kafka_log_cleanup_dir: '/usr/share/kafka/logs/'
opencontrail_version: 4.0
linux_repo_contrail_component: oc40
opencontrail_message_queue_node01_address: ${_param:openstack_message_queue_node01_address}
@@ -19,6 +21,12 @@
kernel:
modules:
- nf_conntrack_ipv4
+ job:
+ kafka_logs_cleanup:
+ command: "find ${_param:opencontrail_kafka_log_cleanup_dir} -name '*.log.*' -type f -mtime ${_param:opencontrail_kafka_log_cleanup_mtime} -exec rm {} \\;"
+ identifier: kafka_logs_cleanup
+ hour: 0
+ minute: 0
opencontrail:
common:
config_only: true
@@ -84,6 +92,7 @@
- /usr/share/kafka/config/server.properties:/usr/share/kafka/config/server.properties
- /usr/share/kafka/config/consumer.properties:/usr/share/kafka/config/consumer.properties
- /usr/share/kafka/config/zookeeper.properties:/usr/share/kafka/config/zookeeper.properties
+ - /usr/share/kafka/logs:/usr/share/kafka/logs
- /etc/zookeeper/conf/zoo_analytics.cfg:/etc/zookeeper/conf/zoo.cfg
- /etc/zookeeper/conf/log4j.properties:/etc/zookeeper/conf/log4j.properties
network_mode: "host"