Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
06ba587
commit 5c23e0e
Showing
7 changed files
with
185 additions
and
5 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,26 @@ | ||
# | ||
# | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
# | ||
|
||
--- | ||
|
||
kafka_package_name: "confluent-5.3.1" | ||
kafka_tgz_url: "http://packages.confluent.io/archive/5.3/confluent-5.3.1-2.12.zip" | ||
kafka_dir: "{{ datalake_deployment_dir }}/{{ kafka_package_name }}" | ||
kafka_rest_proxy_listener_port: 8082 |
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,33 @@ | ||
# | ||
# | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
# | ||
|
||
--- | ||
# Kafka related handlers | ||
- name: start kafka-rest-proxy | ||
service: name=kafka-rest-proxy state=started enabled=yes | ||
become: yes | ||
|
||
- name: stop kafka-rest-proxy | ||
service: name=kafka-rest-proxy state=stopped enabled=yes | ||
become: yes | ||
|
||
- name: restart kafka-rest-proxy | ||
service: name=kafka-rest-proxy state=restarted enabled=yes | ||
become: yes |
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,79 @@ | ||
# | ||
# | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
# | ||
|
||
--- | ||
|
||
# Check for the availability of the Kafka package | ||
- name: Check kafka package availability | ||
stat: path={{ kafka_dir }} | ||
register: kafka_package | ||
become: yes | ||
|
||
- name: Create deployment directory {{ datalake_deployment_dir }} | ||
file: path={{datalake_deployment_dir}} | ||
state=directory | ||
mode=0755 | ||
owner={{ user }} | ||
group={{ group }} | ||
become: yes | ||
|
||
# Download Kafka | ||
- name: Download and unarchive Kafka from {{ kafka_tgz_url }} | ||
unarchive: src="{{ kafka_tgz_url }}" | ||
dest="{{ datalake_deployment_dir }}" | ||
copy=no | ||
owner="{{ user }}" | ||
group="{{ group }}" | ||
when: not kafka_package.stat.exists | ||
become: yes | ||
|
||
# Create kafka logs directory | ||
- name: Create kafka logs directory | ||
file: path="{{ kafka_dir }}/logs" state=directory owner={{ user }} group={{ group }} | ||
become: yes | ||
|
||
# Config rest proxy and start | ||
- name: Copy kafka rest proxy properties file | ||
template: src=kafka-rest.properties.j2 | ||
dest="{{ kafka_dir }}/etc/kafka-rest/kafka-rest.properties" | ||
owner={{ user }} | ||
group={{ group }} | ||
mode="u=rw,g=r,o=r" | ||
become: yes | ||
|
||
- name: open kafka rest proxy port | ||
firewalld: port="{{ kafka_rest_proxy_listener_port }}/tcp" | ||
zone=public permanent=true state=enabled immediate=yes | ||
become: yes | ||
|
||
- name: systemd install kafka rest proxy service script | ||
template: src=kafka-rest-proxy.service.j2 | ||
dest=/usr/lib/systemd/system/kafka-rest-proxy.service | ||
owner={{ user }} | ||
group={{ group }} | ||
mode="u=rw,g=r,o=r" | ||
become: yes | ||
|
||
- name: Reload systemd daemons | ||
command: systemctl daemon-reload | ||
notify: restart kafka-rest-proxy | ||
become: yes | ||
|
||
... |
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,14 @@ | ||
# {{ansible_managed}} | ||
|
||
[Unit] | ||
Description=Kafka-Rest-Proxy | ||
Before= | ||
After=network.target | ||
|
||
[Service] | ||
LOG_DIR={{ kafka_dir }}/logs | ||
ExecStart={{ kafka_dir }}/bin/kafka-rest-start {{ kafka_dir }}/etc/kafka-rest/kafka-rest.properties | ||
Restart=on-abort | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
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 @@ | ||
# | ||
# Copyright 2018 Confluent Inc. | ||
# | ||
# Licensed under the Confluent Community License (the "License"); you may not use | ||
# this file except in compliance with the License. You may obtain a copy of the | ||
# License at | ||
# | ||
# http://www.confluent.io/confluent-community-license | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OF ANY KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations under the License. | ||
# | ||
|
||
#id=kafka-rest-test-server | ||
#schema.registry.url=http://localhost:8081 | ||
#zookeeper.connect=localhost:2181 | ||
bootstrap.servers=PLAINTEXT://{{ kafka_url }} | ||
listeners=http://{{ ansible_default_ipv4.address }}:{{ kafka_rest_proxy_listener_port }} | ||
# | ||
# Configure interceptor classes for sending consumer and producer metrics to Confluent Control Center | ||
# Make sure that monitoring-interceptors-<version>.jar is on the Java class path | ||
#consumer.interceptor.classes=io.confluent.monitoring.clients.interceptor.MonitoringConsumerInterceptor | ||
#producer.interceptor.classes=io.confluent.monitoring.clients.interceptor.MonitoringProducerInterceptor |