我将 Kafka 与 strimzi 运算符一起使用,创建了一个 Kafka 集群,并使用 yml 文件部署了 Kafka 连接。但在此之后我完全空白下一步该做什么。我读到 Kafka connect 用于将数据从源复制到 Kafka 集群或从 Kafka 集群复制到另一个目的地。我想使用 Kafka connect 将数据从文件复制到 Kafka 集群的任何主题。任何人都可以帮助我,我该怎么做,我正在共享创建 Kafka 连接集群的 yml 文件。
apiVersion: kafka.strimzi.io/v1beta1
kind: KafkaConnect
metadata:
name: my-connect-cluster
# annotations:
# # use-connector-resources configures this KafkaConnect
# # to use KafkaConnector resources to avoid
# # needing to call the Connect REST API directly
# strimzi.io/use-connector-resources: "true"
spec:
version: 2.6.0
replicas: 1
bootstrapServers: my-cluster-kafka-bootstrap:9093
tls:
trustedCertificates:
- secretName: my-cluster-cluster-ca-cert
certificate: ca.crt
config:
group.id: connect-cluster …Run Code Online (Sandbox Code Playgroud) 嘿,我正在使用 Kafka Strimzi。我使用以下 yml 文件创建了我的 kafkaTopic 和 KafkaUser:
apiVersion: kafka.strimzi.io/v1beta1
kind: KafkaUser
metadata:
name: my-user
labels:
strimzi.io/cluster: my-cluster
spec:
authentication:
type: tls
authorization:
type: simple
acls:
# Example consumer Acls for topic my-topic using consumer group my-group
- resource:
type: topic
name: my-topic
patternType: literal
operation: Read
host: "*"
- resource:
type: topic
name: my-topic
patternType: literal
operation: Describe
host: "*"
- resource:
type: group
name: my-group
patternType: literal
operation: Read
host: "*"
# Example Producer Acls for topic my-topic …Run Code Online (Sandbox Code Playgroud)