-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cruise control: severale enhancements
- Loading branch information
Showing
7 changed files
with
139 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
- name: "Ensure required parameters are provided" | ||
ansible.builtin.assert: | ||
that: | ||
- amq_streams_cruise_control_capacity_template is defined and amq_streams_cruise_control_capacity_template | length > 0 | ||
- amq_streams_cruise_control_path_to_capacity_file is defined and amq_streams_cruise_control_path_to_capacity_file | length > 0 | ||
quiet: True | ||
|
||
- name: "Ensure capacity.json is properly configured" | ||
ansible.builtin.template: | ||
src: "{{ amq_streams_cruise_control_capacity_template }}" | ||
dest: "{{ amq_streams_cruise_control_path_to_capacity_file }}" | ||
owner: "{{ amq_streams_cruise_control_user | default(omit) }}" | ||
group: "{{ amq_streams_cruise_control_group | default(omit) }}" | ||
mode: 0644 | ||
notify: "Restart {{ amq_streams_cruise_control_service_name }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
roles/amq_streams_cruise_control/templates/capacity.json.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"brokerCapacities":[ | ||
{%if amq_streams_broker_inventory_group is defined and amq_streams_broker_inventory_group | length > 0 %}{% for broker in amq_streams_broker_inventory_group %}{ | ||
"brokerId": "{{ amq_streams_broker_inventory_group.index(broker) }}", | ||
"capacity": { | ||
"DISK": "500000", | ||
"CPU": "100", | ||
"NW_IN": "50000", | ||
"NW_OUT": "50000" | ||
}, | ||
"doc": "This overrides the capacity for broker {{ amq_streams_broker_inventory_group.index(broker) }}." | ||
},{% endfor %}{% endif %} | ||
{ | ||
"brokerId": "-1", | ||
"capacity": { | ||
"DISK": "100000", | ||
"CPU": "100", | ||
"NW_IN": "10000", | ||
"NW_OUT": "10000" | ||
}, | ||
"doc": "This is the default capacity. Capacity unit used for disk is in MB, cpu is in percentage, network throughput is in KB." | ||
} | ||
] | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
roles/amq_streams_cruise_control/templates/log4j.properties.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# | ||
# Copyright 2017 LinkedIn Corp. Licensed under the BSD 2-Clause License (the "License"). See License in the project root for license information. | ||
# | ||
|
||
rootLogger.level=INFO | ||
appenders=console, kafkaCruiseControlAppender, operationAppender, requestAppender | ||
|
||
{%if amq_streams_cruise_control_logfilename is defined and amq_streams_cruise_control_logfilename | length > 0 %}property.filename={{ amq_streams_cruise_control_logfilename }}" | ||
{% endif %} | ||
|
||
appender.console.type=Console | ||
appender.console.name=STDOUT | ||
appender.console.layout.type=PatternLayout | ||
appender.console.layout.pattern=[%d] %p %m (%c)%n | ||
|
||
appender.kafkaCruiseControlAppender.type=RollingFile | ||
appender.kafkaCruiseControlAppender.name=kafkaCruiseControlFile | ||
appender.kafkaCruiseControlAppender.fileName=${filename}/kafkacruisecontrol.log | ||
appender.kafkaCruiseControlAppender.filePattern=${filename}/kafkacruisecontrol.log.%d{yyyy-MM-dd-HH} | ||
appender.kafkaCruiseControlAppender.layout.type=PatternLayout | ||
appender.kafkaCruiseControlAppender.layout.pattern=[%d] %p %m (%c)%n | ||
appender.kafkaCruiseControlAppender.policies.type=Policies | ||
appender.kafkaCruiseControlAppender.policies.time.type=TimeBasedTriggeringPolicy | ||
appender.kafkaCruiseControlAppender.policies.time.interval=1 | ||
|
||
appender.operationAppender.type=RollingFile | ||
appender.operationAppender.name=operationFile | ||
appender.operationAppender.fileName=${filename}/kafkacruisecontrol-operation.log | ||
appender.operationAppender.filePattern=${filename}/kafkacruisecontrol-operation.log.%d{yyyy-MM-dd} | ||
appender.operationAppender.layout.type=PatternLayout | ||
appender.operationAppender.layout.pattern=[%d] %p [%c] %m %n | ||
appender.operationAppender.policies.type=Policies | ||
appender.operationAppender.policies.time.type=TimeBasedTriggeringPolicy | ||
appender.operationAppender.policies.time.interval=1 | ||
|
||
appender.requestAppender.type=RollingFile | ||
appender.requestAppender.name=requestFile | ||
appender.requestAppender.fileName=${filename}/kafkacruisecontrol-request.log | ||
appender.requestAppender.filePattern=${filename}/kafkacruisecontrol-request.log.%d{yyyy-MM-dd-HH} | ||
appender.requestAppender.layout.type=PatternLayout | ||
appender.requestAppender.layout.pattern=[%d] %p %m (%c)%n | ||
appender.requestAppender.policies.type=Policies | ||
appender.requestAppender.policies.time.type=TimeBasedTriggeringPolicy | ||
appender.requestAppender.policies.time.interval=1 | ||
|
||
# Loggers | ||
logger.cruisecontrol.name=com.linkedin.kafka.cruisecontrol | ||
logger.cruisecontrol.level=debug | ||
logger.cruisecontrol.appenderRef.kafkaCruiseControlAppender.ref=kafkaCruiseControlFile | ||
|
||
logger.detector.name=com.linkedin.kafka.cruisecontrol.detector | ||
logger.detector.level=info | ||
logger.detector.appenderRef.kafkaCruiseControlAppender.ref=kafkaCruiseControlFile | ||
|
||
logger.operationLogger.name=operationLogger | ||
logger.operationLogger.level=info | ||
logger.operationLogger.appenderRef.operationAppender.ref=operationFile | ||
|
||
logger.CruiseControlPublicAccessLogger.name=CruiseControlPublicAccessLogger | ||
logger.CruiseControlPublicAccessLogger.level=info | ||
logger.CruiseControlPublicAccessLogger.appenderRef.requestAppender.ref=requestFile | ||
|
||
rootLogger.appenderRefs=console, kafkaCruiseControlAppender | ||
rootLogger.appenderRef.console.ref=STDOUT | ||
rootLogger.appenderRef.kafkaCruiseControlAppender.ref=kafkaCruiseControlFile |