Skip to content

Commit

Permalink
Fixed single VM deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
daniellavoie committed Mar 16, 2020
1 parent f153929 commit afdccf0
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 61 deletions.
9 changes: 0 additions & 9 deletions jobs/confluent-connect/spec
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,12 @@ properties:
config.storage.topic:
description: Names of the internal topics for storing configs
default: connect-configs
config.storage.replication_factor:
description: Replication factor for the config topic
default: 3
offset.storage.topic:
description: Names of the internal topics for storing offsets
default: connect-offsets
offset.storage.replication_factor:
description: Replication factor for the offset topic
default: 3
status.storage.topic:
description: Names of the internal topics for storing statuses
default: connect-statuses
status.storage.replication_factor:
description: Replication factor for the status topic
default: 3

tls.ca_certs:
description: |
Expand Down
14 changes: 8 additions & 6 deletions jobs/confluent-connect/templates/config/connect.properties.erb
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<% servers = link('confluent-server') %>
<% schemaRegistries = link('confluent-schema-registry') %>
<% servers = link('confluent-server')
schemaRegistries = link('confluent-schema-registry')

replication = servers.instances.size > 1 ? (instances.size > 2 ? 3 : 2) : 1 %>
# Sample configuration for a distributed Kafka Connect worker that uses Avro serialization and
# integrates the the Schema Registry. This sample configuration assumes a local installation of
# Confluent Platform with all services running on their default ports.

# Bootstrap Kafka servers. If multiple servers are specified, they should be comma-separated.
bootstrap.servers=<%= servers.instances.map { |instance| "#{instance.address}:9093" }.join(",") %>
bootstrap.servers=<%= servers.instances.map { |instance| "#{instance.address}:9092" }.join(",") %>

security.protocol=SASL_SSL

Expand Down Expand Up @@ -57,9 +59,9 @@ status.storage.topic=<%= p("status.storage.topic") %>
# only a single broker, we set the replication factor here to just 1. That's okay for the examples, but
# ALWAYS use a replication factor of AT LEAST 3 for production environments to reduce the risk of
# losing connector offsets, configurations, and status.
config.storage.replication.factor=<%= p("config.storage.replication_factor") %>
offset.storage.replication.factor=<%= p("offset.storage.replication_factor") %>
status.storage.replication.factor=<%= p("status.storage.replication_factor") %>
config.storage.replication.factor=<%= replication %>
offset.storage.replication.factor=<%= replication %>
status.storage.replication.factor=<%= replication %>

# The config storage topic must have a single partition, and this cannot be changed via properties.
# Offsets for all connectors and tasks are written quite frequently and therefore the offset topic
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
connect = link('confluent-connect')
ksql = link('confluent-ksql')
registry = link('confluent-schema-registry')
replication = servers.instances.size > 2 ? 3 : 1 %>
replication = servers.instances.size > 1 ? (instances.size > 2 ? 3 : 2) : 1 %>


bootstrap.servers=<%= servers.instances.map { |instance| "#{instance.address}:9093" }.join(",") %>
bootstrap.servers=<%= servers.instances.map { |instance| "#{instance.address}:9092" }.join(",") %>

confluent.controlcenter.auth.restricted.roles=Restricted
confluent.controlcenter.command.topic.replication=<%= replication %>
Expand Down
10 changes: 7 additions & 3 deletions jobs/confluent-ksql/templates/config/ksql-server.properties.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<% servers = link('confluent-server') %>
<% schemaRegistries = link('confluent-schema-registry') %>
<% servers = link('confluent-server')
schemaRegistries = link('confluent-schema-registry')

replication = servers.instances.size > 1 ? (instances.size > 2 ? 3 : 2) : 1 %>
#
# Copyright 2018 Confluent Inc.
#
Expand Down Expand Up @@ -53,7 +55,7 @@ ksql.logging.processing.stream.auto.create=true
#------ External service config -------

# The set of Kafka brokers to bootstrap Kafka cluster information from:
bootstrap.servers=<%= servers.instances.map { |instance| "#{instance.address}:9093" }.join(",") %>
bootstrap.servers=<%= servers.instances.map { |instance| "#{instance.address}:9092" }.join(",") %>

security.protocol=SASL_SSL

Expand All @@ -68,6 +70,8 @@ ssl.keystore.location=/var/vcap/jobs/confluent-ksql/config/generated.keystore.jk
ssl.keystore.password=<%= p("keystore_password") %>
ssl.key.password=<%= p("keystore_password") %>

ksql.streams.replication.factor=<%= replication %>

# Uncomment and complete the following to enable KSQL's integration to the Confluent Schema Registry:
<% schema_registry_url = "https://" + schemaRegistries.address + ":" + schemaRegistries.p("listen_port").to_s %>
ksql.schema.registry.url=<%= schema_registry_url %>
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<% servers = link('confluent-server') %>
<% servers = link('confluent-server')

replication = servers.instances.size > 1 ? (instances.size > 2 ? 3 : 2) : 1 %>
#
# Copyright 2018 Confluent Inc.
#
Expand Down Expand Up @@ -47,7 +49,7 @@ ssl.key.password=<%= p("keystore_password") %>
# (Note that you cannot mix the two modes; use this mode only on new deployments or by shutting down
# all instances, switching to the new configuration, and then starting the schema registry
# instances again.)
kafkastore.bootstrap.servers=SASL_SSL://<%= servers.instances.map { |instance| "#{instance.address}:9093" }.join(",") %>
kafkastore.bootstrap.servers=SASL_SSL://<%= servers.instances.map { |instance| "#{instance.address}:9092" }.join(",") %>

kafkastore.security.protocol=SASL_SSL
kafkastore.sasl.mechanism=SCRAM-SHA-512
Expand All @@ -66,6 +68,6 @@ kafkastore.ssl.key.password=<%= p("keystore_password") %>

# The name of the topic to store schemas in
kafkastore.topic=<%= p("topic") %>

kafkastore.topic.replication.factor=<%= replication %>
# If true, API requests that fail will include extra debugging information, including stack traces
debug=<%= p("debug") %>
8 changes: 2 additions & 6 deletions jobs/confluent-server/spec
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,11 @@ properties:
description: "Switch to enable topic deletion or not"
default: false

offsets.topic.replication.factor:
replication_factor:
description: "The replication factor for the offsets topic"
default: 3

transaction.state.log.replication.factor:
description: "The replication factor for the transaction topic"
default: 3

transaction.state.log.min.isr:
min_isr:
description: "Overridden min.insync.replicas config for the transaction topic"
default: 2

Expand Down
12 changes: 6 additions & 6 deletions jobs/confluent-server/templates/config/server.properties.erb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ delete.topic.enable=<%= p("delete_topic") %>
# EXAMPLE:
# listeners = PLAINTEXT://your.host.name:9092

listeners=PLAINTEXT://<%= spec.address %>:9092,SASL_SSL://<%= spec.address %>:9093
listeners=SASL_SSL://<%= spec.address %>:9092
security.inter.broker.protocol=SASL_SSL

sasl.enabled.mechanisms=SCRAM-SHA-512
Expand All @@ -58,7 +58,7 @@ ssl.truststore.type=PKCS12
#advertised.listeners=PLAINTEXT://your.host.name:9092
<% if_p('advertised.listener') do |advertised_listener|
if advertised_listener[spec.index] != nil %>
advertised.listeners=PLAINTEXT://<%= spec.address %>:9092,<%= security_protocol %>://<%= spec.address %>:9093
advertised.listeners=PLAINTEXT://<%= spec.address %>:9092,<%= security_protocol %>://<%= spec.address %>:9092
<% end
end %>

Expand Down Expand Up @@ -95,9 +95,9 @@ num.recovery.threads.per.data.dir=1
############################# Internal Topic Settings #############################
# The replication factor for the group metadata internal topics "__consumer_offsets" and "__transaction_state"
# For anything other than development testing, a value greater than 1 is recommended for to ensure availability such as 3.
offsets.topic.replication.factor=<%= p("offsets.topic.replication.factor") %>
transaction.state.log.replication.factor=<%= p("transaction.state.log.replication.factor") %>
transaction.state.log.min.isr=<%= p("transaction.state.log.min.isr") %>
offsets.topic.replication.factor=<%= p('replication_factor') %>
transaction.state.log.replication.factor=<%= p('replication_factor') %>
transaction.state.log.min.isr=<%= p('min_isr') %>

############################# Log Flush Policy #############################

Expand Down Expand Up @@ -163,7 +163,7 @@ zookeeper.connection.timeout.ms=6000
# to point to your metrics Kafka cluster.
metric.reporters=io.confluent.metrics.reporter.ConfluentMetricsReporter

confluent.metrics.reporter.bootstrap.servers=<%= p("metric.bootstrap_servers", spec.address + ":9093") %>
confluent.metrics.reporter.bootstrap.servers=<%= p("metric.bootstrap_servers", spec.address + ":9092") %>
confluent.metrics.reporter.topic.replicas=<%= p("metric.replicas") %>

confluent.metrics.reporter.sasl.mechanism=SCRAM-SHA-512
Expand Down
35 changes: 9 additions & 26 deletions manifests/confluent-platform-single.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,6 @@ variables:
options:
ca: ca
common_name: "*.((confluent-server-external-host))"
- name: confluent-connect-tls
type: certificate
options:
ca: ca
common_name: "*.((confluent-connect-external-host))"
- name: confluent-schema-registry-tls
type: certificate
options:
ca: ca
common_name: "*.((confluent-schema-registry-external-host))"
- name: confluent-control-center-tls
type: certificate
options:
ca: ca
common_name: "*.((confluent-control-center-external-host))"
- name: confluent-ksql-tls
type: certificate
options:
ca: ca
common_name: "*.((confluent-ksql-external-host))"
- name: server-jaas-password
type: password
- name: metric-jaas-password
Expand All @@ -63,15 +43,14 @@ variables:
type: password

instance_groups:
- name: server
- name: confluent-server
azs: [z1, z2, z3]
instances: 1
vm_type: single
stemcell: default
persistent_disk: 200000
vm_extensions:
- control-center
- ksql
networks:
- name: default
jobs:
Expand Down Expand Up @@ -113,13 +92,16 @@ instance_groups:
jaas:
username: metric
password: ((metric-jaas-password))
replication_factor: 1
min_isr: 1

- name: confluent-control-center
release: confluent-platform
properties:
tls:
ca_certs:
- ((ca.certificate))
certificate: ((confluent-control-center-tls))
certificate: ((confluent-server-tls))
keystore_password: ((keystore-password))
kafka:
jaas:
Expand All @@ -136,7 +118,7 @@ instance_groups:
tls:
ca_certs:
- ((ca.certificate))
certificate: ((confluent-schema-registry-tls))
certificate: ((confluent-server-tls))
keystore_password: ((keystore-password))
kafka:
jaas:
Expand Down Expand Up @@ -172,7 +154,7 @@ instance_groups:
tls:
ca_certs:
- ((ca.certificate))
certificate: ((confluent-connect-tls))
certificate: ((confluent-server-tls))
keystore_password: ((keystore-password))
basic:
jaas:
Expand All @@ -192,14 +174,15 @@ instance_groups:
access_key: ((connectors-s3-access-key))
secret_key: ((connectors-s3-secret-key))
bucket: ((connectors-s3-bucket))

- name: confluent-ksql
release: confluent-platform
properties:
external_hostname: ((ksql-external-hostname))
tls:
ca_certs:
- ((ca.certificate))
certificate: ((confluent-ksql-tls))
certificate: ((confluent-server-tls))
keystore_password: ((keystore-password))
kafka:
jaas:
Expand Down

0 comments on commit afdccf0

Please sign in to comment.