这是我的kafka连接器属性
##
# 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.
##
# This file contains some of the configurations for the Kafka Connect distributed worker. This file is intended
# to be used with the examples, and some settings may differ from those used in a production system, especially
# the `bootstrap.servers` and those specifying replication factors.
# A list of host/port pairs to use for establishing the initial connection to the Kafka cluster.
bootstrap.servers=localhost:9092
# unique name for the cluster, used in forming the Connect cluster group. Note that this must not conflict with consumer group IDs
group.id=connect-cluster
# The converters specify the format of data in Kafka and how to translate it into Connect data. Every Connect user will
# need to configure these based on the format they want their data in when loaded from or stored into Kafka
key.converter=org.apache.kafka.connect.json.JsonConverter
value.converter=org.apache.kafka.connect.html" target="_blank">json.JsonConverter
# Converter-specific settings can be passed in by prefixing the Converter's setting with the converter we want to apply
# it to
key.converter.schemas.enable=false
value.converter.schemas.enable=false
# Topic to use for storing offsets. This topic should have many partitions and be replicated and compacted.
# Kafka Connect will attempt to create the topic automatically when needed, but you can always manually create
# the topic before starting Kafka Connect if a specific topic configuration is needed.
# Most users will want to use the built-in default replication factor of 3 or in some cases even specify a larger value.
# Since this means there must be at least as many brokers as the maximum replication factor used, we'd like to be able
# to run this example on a single-broker cluster and so here we instead set the replication factor to 1.
offset.storage.topic=__connect_offsets
offset.storage.replication.factor=1
#offset.storage.partitions=25
# Topic to use for storing connector and task configurations; note that this should be a single partition, highly replicated,
# and compacted topic. Kafka Connect will attempt to create the topic automatically when needed, but you can always manually create
# the topic before starting Kafka Connect if a specific topic configuration is needed.
# Most users will want to use the built-in default replication factor of 3 or in some cases even specify a larger value.
# Since this means there must be at least as many brokers as the maximum replication factor used, we'd like to be able
# to run this example on a single-broker cluster and so here we instead set the replication factor to 1.
config.storage.topic=__connect_configs
config.storage.replication.factor=1
# Topic to use for storing statuses. This topic can have multiple partitions and should be replicated and compacted.
# Kafka Connect will attempt to create the topic automatically when needed, but you can always manually create
# the topic before starting Kafka Connect if a specific topic configuration is needed.
# Most users will want to use the built-in default replication factor of 3 or in some cases even specify a larger value.
# Since this means there must be at least as many brokers as the maximum replication factor used, we'd like to be able
# to run this example on a single-broker cluster and so here we instead set the replication factor to 1.
status.storage.topic=__connect_status
status.storage.replication.factor=1
#status.storage.partitions=5
# Flush much faster than normal, which is useful for testing/debugging
#offset.flush.interval.ms=10000
# These are provided to inform the user about the presence of the REST host and port configs
# Hostname & Port for the REST API to listen on. If this is set, it will bind to the interface used to listen to requests.
#rest.host.name=
#rest.port=8083
# The Hostname & Port that will be given out to other workers to connect to i.e. URLs that are routable from other servers.
#rest.advertised.host.name=
#rest.advertised.port=
# Set to a list of filesystem paths separated by commas (,) to enable class loading isolation for plugins
# (connectors, converters, transformations). The list should consist of top level directories that include
# any combination of:
# a) directories immediately containing jars with plugins and their dependencies
# b) uber-jars with plugins and their dependencies
# c) directories immediately containing the package directory structure of classes of plugins and their dependencies
# Examples:
# plugin.path=/usr/local/share/java,/usr/local/share/kafka/plugins,/opt/connectors,
plugin.path=/usr/share/java
这是我用来创建Elasticsearch水槽的POST主体
{
"name" : "test-distributed-connector",
"config" : {
"connector.class" : "io.confluent.connect.elasticsearch.ElasticsearchSinkConnector",
"tasks.max" : "2",
"topics.regex" : "^test[0-9A-Za-z-_]*(?<!-raw$)$",
"connection.url" : "http://elasticsearch:9200",
"connection.username": "admin",
"connection.password": "admin",
"type.name" : "_doc",
"key.ignore" : "true",
"schema.ignore" : "true",
"transforms": "TimestampRouter",
"transforms.TimestampRouter.type": "org.apache.kafka.connect.transforms.TimestampRouter",
"transforms.TimestampRouter.topic.format": "${topic}-${timestamp}",
"transforms.TimestampRouter.timestamp.format": "YYYY.MM.dd",
"batch.size": "100",
"offset.flush.interval.ms":"60000",
"offset.flush.timeout.ms": "15000",
"read.timeout.ms": "15000",
"connection.timeout.ms": "10000",
"max.buffered.records": "1500"
}
}
我遇到的问题是,有时这个接收器会工作并将数据发送到Elasticsearch并显示
〔2020-09-15 20:27:05904〕INFO WorkerLinkTask{id=test-distributed-connector-0}使用序列号1异步提交偏移。。。。。。。
但大多数时候,它只会卡住并重复这一部分。
[2020-09-15 20:24:29,458] INFO [Consumer clientId=consumer-4, groupId=connect-test-distributed-connector] Group coordinator kafka:9092 (id: 2147483543 rack: null) is unavailable or invalid, will attempt rediscovery (org.apache.kafka.clients.consumer.internals.AbstractCoordinator:706)
[2020-09-15 20:24:29,560] INFO [Consumer clientId=consumer-4, groupId=connect-test-distributed-connector] Discovered group coordinator kafka:9092 (id: 2147483543 rack: null) (org.apache.kafka.clients.consumer.internals.AbstractCoordinator:654)
[2020-09-15 20:24:29,561] INFO [Consumer clientId=consumer-4, groupId=connect-test-distributed-connector] (Re-)joining group (org.apache.kafka.clients.consumer.internals.AbstractCoordinator:486)
我有一个疑问是,这个 Elasticsearch 接收器会读取大量带有大量消息/数据的主题。
因此,当试图阅读Kafka的主题时,这是有问题的
因为我有另一个Elasticearh水槽,它的设置与这个和那个基本相同。
是否有任何方法/调整可以做这个Elasticseach工作?
########更新#########
有时(经常)我会看到这个日志
[2020-09-16 09:51:18,189] WARN [Consumer clientId=consumer-6, groupId=connect-test-distributed-connector] Close timed out with 1 pending requests to coordinator, terminating client connections (org.apache.kafka.clients.consumer.internals.AbstractCoordinator:769)
和
[2020-09-16 10:17:43,369] WARN [Consumer clientId=consumer-16, groupId=connect-test-distributed-connector-] Close timed out with 1 pending requests to coordinator, terminating client connections (org.apache.kafka.clients.consumer.internals.AbstractCoordinator:769)
您使用的是安全连接,我假设您的< code>xpack已启用。
尝试更改
"connection.url" : "http://elasticsearch:9200"
到
"connection.url" : "https://elasticsearch:9200"
我在localhost:9200上有一个本地弹性搜索,当我向浏览器输入地址时,我得到了以下内容: 当我尝试运行我的应用程序时,我得到以下错误: 如何用我的Jhipster(V5.0.0-beta.3)后端连接到这个弹性服务器?
我正在尝试创建一个节点。带有RESTAPI的js应用程序,用于查询弹性搜索应用程序云上的数据。我有以下elasticsearch连接代码 上面的连接连接正确,如果我添加任何数据,它也会被添加。但是我希望数据不会被添加到本地主机。我希望我的实际集群拥有数据。我尝试了以下代码 上面的代码仍然没有添加数据或从我的云集群中检索数据... Evrry在互联网上我只找到localhost示例...有人能告诉我
我试图使用docker容器创建一个弹性搜索安装。我只使用Elastic.io提供者的映像。 我不知道为什么,但logstash告诉我,他无法连接到带有此错误消息的ElasticSearch实例: 如果logstash真的得到了我的设置,有人能告诉我为什么他使用了一个坏的主机事件吗?
由于已经有很多关于连字符的问题,我已经尝试了以下解决方案: 使用字符筛选器:ElasticSearch-在名称中使用连字符进行搜索。 所以我做了这个映射: 所以char筛选器似乎没有在搜索字符串上执行?我该怎么做才能让它起作用?
我目前正在运行elastic search和kibana 7.0.0版,在我的项目中有一个docker compose文件 我能够连接到端口5601上的kibana(索引和搜索数据),以及端口9200上的弹性搜索。 我试图使用NEST连接到弹性这里是我的基本配置 当我通过NEST执行任何命令时,如ping、健康检查或搜索等,我检索到以下异常。这让我相信docker容器(linux容器)中存在一些与
我使用Elasticsearch允许用户输入要搜索的术语。例如,我要搜索以下属性'name': 如果使用以下代码搜索或,我希望返回此文档。 我尝试过做一个bool must和做多个术语,但它似乎只有在整个字符串都匹配的情况下才起作用。 所以我真正想做的是,这个词是否以任何顺序包含两个词。 有人能帮我走上正轨吗?我已经在这上面砸了一段时间了。