Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
okeanos-LoD
Commits
e0fc6086
Commit
e0fc6086
authored
Jul 08, 2015
by
Georgios Ouzounis
Browse files
LAM-33 Created variables for the mirror, version and installation path in apache-kafka role.
parent
c97163bf
Changes
5
Hide whitespace changes
Inline
Side-by-side
ansible/roles/apache-kafka/handlers/main.yml
View file @
e0fc6086
---
-
name
:
create topics
shell
:
/usr/local
/kafka/bin/kafka-topics.sh --create --zookeeper {{ hostvars['master-node']['master_node_ip'] }}:2181 --replication-factor {{ groups['slaves']|count + 1 }} --partitions 1 --topic input
shell
:
"
{{
installation_path
}}
/kafka/bin/kafka-topics.sh
--create
--zookeeper
{{
hostvars['master-node']['master_node_ip']
}}:2181
--replication-factor
{{
groups['slaves']|count
+
1
}}
--partitions
1
--topic
input
"
notify
:
-
create batch output topic
-
name
:
create batch output topic
shell
:
/usr/local
/kafka/bin/kafka-topics.sh --create --zookeeper {{ hostvars['master-node']['master_node_ip'] }}:2181 --replication-factor {{ groups['slaves']|count + 1 }} --partitions 1 --topic batch-output
shell
:
"
{{
installation_path
}}
/kafka/bin/kafka-topics.sh
--create
--zookeeper
{{
hostvars['master-node']['master_node_ip']
}}:2181
--replication-factor
{{
groups['slaves']|count
+
1
}}
--partitions
1
--topic
batch-output
"
notify
:
-
create stream output topic
-
name
:
create stream output topic
shell
:
/usr/local
/kafka/bin/kafka-topics.sh --create --zookeeper {{ hostvars['master-node']['master_node_ip'] }}:2181 --replication-factor {{ groups['slaves']|count + 1 }} --partitions 1 --topic stream-output
shell
:
"
{{
installation_path
}}
/kafka/bin/kafka-topics.sh
--create
--zookeeper
{{
hostvars['master-node']['master_node_ip']
}}:2181
--replication-factor
{{
groups['slaves']|count
+
1
}}
--partitions
1
--topic
stream-output
"
ansible/roles/apache-kafka/tasks/download.yml
View file @
e0fc6086
---
-
name
:
Download Apache Kafka.
get_url
:
url=
http://mirrors.myaegean.gr/apache/kafka/0.8.2.1/kafka_2.10-0.8.2.1
.tgz dest=
/root/kafka_2.10-0.8.2.1
.tgz
get_url
:
url=
"{{ mirror_url }}/{{ version }}/kafka_{{ scala_version }}-{{ version }}
.tgz
"
dest=
"{{ download_path }}/kafka_{{ scala_version }}-{{ version }}
.tgz
"
tags
:
-
download
-
name
:
Uncompress Apache Kafka.
unarchive
:
src=
/root/kafka_2.10-0.8.2.1
.tgz dest=
/usr/local
copy=no
unarchive
:
src=
"{{ download_path }}/kafka_{{ scala_version }}-{{ version }}
.tgz
"
dest=
"{{ installation_path }}"
copy=no
tags
:
-
download
-
name
:
Create softlink for Apache Kafka.
file
:
src=
/usr/local/kafka_2.10-0.8.2.1 dest=/usr/local
/kafka state=link
file
:
src=
"{{ installation_path }}/kafka_{{ scala_version }}-{{ version }}" dest="{{ installation_path }}
/kafka
"
state=link
tags
:
-
download
ansible/roles/apache-kafka/tasks/master.yml
View file @
e0fc6086
---
-
name
:
Configure Apache kafka.
copy
:
src=
usr/local/kafka/config/server.properties dest=/usr/local
/kafka/config/server.properties owner=root group=root mode=0644
copy
:
src=
server.properties dest="{{ installation_path }}
/kafka/config/server.properties
"
owner=root group=root mode=0644
tags
:
-
configure-kafka
-
name
:
Start Apache Zookeeper server.
shell
:
/usr/local
/kafka/bin/zookeeper-server-start.sh
/usr/local
/kafka/config/zookeeper.properties
shell
:
"
{{
installation_path
}}
/kafka/bin/zookeeper-server-start.sh
{{
installation_path
}}
/kafka/config/zookeeper.properties
"
async
:
31536000
# Stay alive for a year(1 year = 31536000 seconds).
poll
:
0
tags
:
...
...
@@ -17,7 +17,7 @@
-
start-zookeeper
-
name
:
Start Apache Kafka server.
shell
:
/usr/local
/kafka/bin/kafka-server-start.sh
/usr/local
/kafka/config/server.properties
shell
:
"
{{
installation_path
}}
/kafka/bin/kafka-server-start.sh
{{
installation_path
}}
/kafka/config/server.properties
"
async
:
31536000
# Stay alive for a year(1 year = 31536000 seconds).
poll
:
0
tags
:
...
...
ansible/roles/apache-kafka/tasks/slaves.yml
View file @
e0fc6086
---
-
name
:
Configure Apache kafka.
template
:
src=
usr/local/kafka/config/
server.properties.j2 dest=
/usr/local
/kafka/config/server.properties owner=root group=root mode=0644
template
:
src=server.properties.j2 dest=
"{{ installation_path }}
/kafka/config/server.properties
"
owner=root group=root mode=0644
tags
:
-
configure-kafka
-
name
:
Start Apache Kafka server.
shell
:
/usr/local
/kafka/bin/kafka-server-start.sh
/usr/local
/kafka/config/server.properties
shell
:
"
{{
installation_path
}}
/kafka/bin/kafka-server-start.sh
{{
installation_path
}}
/kafka/config/server.properties
"
async
:
31536000
# Stay alive for a year(1 year = 31536000 seconds).
poll
:
0
tags
:
...
...
ansible/roles/apache-kafka/vars/main.yml
0 → 100644
View file @
e0fc6086
---
mirror_url
:
"
http://mirrors.myaegean.gr/apache/kafka"
scala_version
:
"
2.10"
version
:
"
0.8.2.1"
download_path
:
"
/root"
installation_path
:
"
/usr/local"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment