对于多代理kafka设置,侦听器和advertised.listeners的值应该是多少?

时间:2019-07-17 13:54:58

标签: apache-kafka apache-kafka-connect ksql

我在AWS中有一个融合的OSS设置,其中包含三个经纪人,三个动物园管理员和两个工作人员。在其中一个工作线程中配置server.properties时,我陷入了 private async Task<DialogTurnResult> ChoiceStepAsync(WaterfallStepContext stepContext, CancellationToken cancellationToken = default(CancellationToken)) { var userProfile = (UserProfile)stepContext.Values[UserInfoProduct]; userProfile.Product = (stepContext.Result).ToString(); string choice = userProfile.Product.ToLowerInvariant(); switch (choice) { case "contact": { await stepContext.Context.SendActivityAsync($"Info"); return await stepContext.NextAsync(stepContext.Values[UserInfoProduct], cancellationToken); } case "newsletter": { return await stepContext.NextAsync(stepContext.Values[UserInfoProduct], cancellationToken); case "about us": { return await stepContext.NextAsync(stepContext.Values[UserInfoProduct], cancellationToken); } default: { return await stepContext.NextAsync(stepContext.Values[UserInfoProduct], cancellationToken); } } } private const string YesOption = "Yes"; private const string NoOption = "No"; private const string BackOption = "Return"; private static List<Choice> ConfirmOptions = new List<Choice>() { new Choice(YesOption) {Value = "Yes", Synonyms = new List<string> { "Yes" } }, new Choice(NoOption) { Value = "No",Synonyms = new List<string> { "No" }}, new Choice(BackOption) { Synonyms = new List<string> { "Return" }} }; private async Task<DialogTurnResult> MoreInfoStepAsync(WaterfallStepContext stepContext, CancellationToken cancellationToken) { var userProfile = (UserProfile)stepContext.Values[UserInfoProduct]; await stepContext.Context.SendActivityAsync($"Would you like to leave your phone number?", cancellationToken: cancellationToken); return await stepContext.PromptAsync(nameof(ChoicePrompt), new PromptOptions() { Choices = ConfirmOptions, }, cancellationToken); } private async Task<DialogTurnResult> MoreInfoChoiceStepAsync(WaterfallStepContext stepContext, CancellationToken cancellationToken = default(CancellationToken)) { var userProfile = (UserProfile)stepContext.Values[UserInfoProduct]; var optionSelected = ((FoundChoice)stepContext.Result).Value; switch (optionSelected) { case YesOption: return await stepContext.BeginDialogAsync(nameof(PhoneDialog), cancellationToken); case NoOption: return await stepContext.EndDialogAsync(stepContext.Values[UserInfoProduct], cancellationToken); case BackOption: return await stepContext.ReplaceDialogAsync(nameof(ProductDialog), cancellationToken); } await stepContext.Context.SendActivityAsync("I don't recognize this option", cancellationToken: cancellationToken); return await stepContext.EndDialogAsync(stepContext.Values[UserInfoProduct], cancellationToken); } } listeners属性的配置中。

我搜索了解决方案,建议在所有地方设置advertised.listenerslisteners的属性。 我尝试使用以下属性:

advertised.listeners

也尝试过:

listeners=PLAINTEXT://localhost:9092
advertised.listeners=PLAINTEXT://<public-ip-of-worker>:9092

使用上述设置,问题如下:

Kafka Connect服务器出现以下错误:

listeners=PLAINTEXT://0.0.0.0:9092

每当我们尝试使用KSQL创建/删除主题时,都会收到错误消息:

    [2019-07-17 13:03:19,067] WARN [Consumer clientId=consumer-2, groupId=connect-cluster] Error while fetching metadata with correlation id 9781 : {connect-statuses=LEADER_NOT_AVAILABLE} (org.apache.kafka.clients.NetworkClient:968)
    [2019-07-17 13:03:19,170] WARN [Consumer clientId=consumer-2, groupId=connect-cluster] Error while fetching metadata with correlation id 9782 : {connect-statuses=LEADER_NOT_AVAILABLE} (org.apache.kafka.clients.NetworkClient:968)

因此,现在,我对集群的[2019-07-17 12:53:08,351] WARN Timeout to get commandStatus, waited 5000 milliseconds:, statementText:TERMINATE CSAS_YP_SINK_TOPIC_38; (io.confluent.ksql.rest.server.resources.KsqlResource:375) java.util.concurrent.TimeoutException at io.confluent.ksql.rest.server.computation.CommandStatusFuture.get(CommandStatusFuture.java:76) at io.confluent.ksql.rest.server.computation.CommandStatusFuture.get(CommandStatusFuture.java:29) at io.confluent.ksql.rest.server.resources.KsqlResource.distributeStatement(KsqlResource.java:373) at io.confluent.ksql.rest.server.resources.KsqlResource.executeStatement(KsqlResource.java:334) at io.confluent.ksql.rest.server.resources.KsqlResource.handleKsqlStatements(KsqlResource.java:200) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 配置感到困惑,无论是将工作人员IP用作侦听器还是代理IP。 如果是代理IP,则我们有三个代理,我们无法将所有代理设置为相同的端口吗?

任何建议将不胜感激。

共享我的Connect和KSQL属性:

连接 https://www.writeurl.com/publish/15z9zu3j5k5jxim1k81d

KSQL https://www.writeurl.com/publish/uvtlxgbld369hpahozju

0 个答案:

没有答案