This file contains hidden or 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
| example_topic "example" do | |
| partitions 1 | |
| replication 1 | |
| end |
This file contains hidden or 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
| if defined?(ChefSpec) | |
| def create_example_topic(resource_name) | |
| ChefSpec::Matchers::ResourceMatcher.new(:example_topic, :create, resource_name) | |
| end | |
| end |
This file contains hidden or 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
| if defined?(ChefSpec) | |
| [:create, :update].each do |action| | |
| self.class.send(:define_method, "#{action}_example_topic") do |resource| | |
| ChefSpec::Matchers::ResourceMatcher.new(:example_topic, action, resource) | |
| end | |
| end | |
| end |
This file contains hidden or 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
| { | |
| "version":1, | |
| "partitions":[ | |
| { | |
| "topic":"foo", | |
| "partition":0, | |
| "replicas":[ | |
| 5, | |
| 6, | |
| 7 |
This file contains hidden or 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
| bin/kafka-reassign-partitions.sh \ | |
| --zookeeper $ZK \ | |
| --reassignment-json-file increase-replication-factor.json \ | |
| --execute |
This file contains hidden or 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
| bin/kafka-topics.sh \ | |
| --zookeeper $ZK \ | |
| --alter \ | |
| --topic <name> \ | |
| --partitions <partitions> |
This file contains hidden or 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
| bin/kafka-topics.sh | |
| --zookeeper $ZK | |
| --create | |
| --topic <name> | |
| --replication-factor <value> | |
| --partitions <value> |
This file contains hidden or 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
| bin/kafka-topics.sh \ | |
| --zookeeper $ZK \ | |
| --describe \ | |
| --topic <name> |
This file contains hidden or 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
| property :topic, String, name_property: true | |
| property :partitions, Fixnum, default: 3 | |
| property :replicas, Fixnum, default: 3 | |
| property :zookeeper, String, default: "localhost:2181" | |
| property :directory, String, default: "/kafka" | |
| action :create do | |
| cmd = %W( | |
| #{directory}/bin/kafka-topics.sh | |
| --zookeeper #{zookeeper} |
This file contains hidden or 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
| - hosts: localhost | |
| become: yes | |
| connection: local | |
| tasks: | |
| - apt_key: | |
| keyserver: keyserver.ubuntu.com | |
| id: 642AC823 | |
| - apt_repository: |