barriers / 阅读 / 详情

kafka配置KAFKA_LISTENERS和KAFKA_ADVERTISED_LISTENERS

2023-05-19 18:22:31
TAG: 配置 listen
共1条回复
慧慧

kafka配置KAFKA_LISTENERS和KAFKA_ADVERTISED_LISTENERS

介绍kafka的两个参数KAFKA_LISTENERS和KAFKA_ADVERTISED_LISTENERS

主要在kafka需要部署在container里面时必须要注意用到。

配置KAFKA_LISTENERS=PLAINTEXT://:9092

因为这种场景下主机都是明确的,对谁都一样;任何人都可以通过<hostname>:9092访问kafka。

因为container里面的主机和端口,只有和container在同一个网络里的主机才能访问,而默认情况下container所在的宿主机是访问不了的。

例如:KAFKA_LISTENERS=PLAINTEXT://:9092, 那么:

那么如何在宿主机上访问呢?

首先想到要把端口映射出来:9092:9092,把kafka container的端口9092映射到主机上的9092;

再试一下宿主机上:localhost:9092,这时是可以成功的。

换一个用法:<hostname>:9092,既然都映射出来的,我不用localhost而用真正的主机名行不行呢,答案是不行的,是不是很吃惊。这就引发另一个问题,和宿主机在同一个网络的其他物理主机也不能访问kafka了,因为不能通过hostname:9092的地址访问啊。

原因是什么呢?

这里我们就要提到KAFKA_ADVERTISED_LISTENERS的使用。

其实kafka客户端访问kafka是分两步走:

kafka对这两个参数的说明:

结合我们的例子:

如何让外部其他主机也能访问。

方案已经很明确了,就是发布一个KAFKA_ADVERTISED_LISTENERS到所有人都认识的地址。

这样不管是谁都通过统一的<宿主主机>:9092地址来访问kafka。

让容器网络上的主机访问一个kafka地址,让宿主机网络上的主机访问另一个kafka地址,实现内外地址分离。

主要INSIDE和OUTSIDE不是保留字,只是普通标识,可以任意取名,解释在KAFKA_LISTENER_SECURITY_PROTOCOL_MAP。

相关推荐

英语这里advertised什么意思?

advertised登广告,首句意思为【一人曾登广告为他办公室招聘一人。】
2023-01-07 22:54:362

advertised的意思

广告
2023-01-07 22:54:483

adervertise怎么翻译

advertise;做广告宣传
2023-01-07 22:55:003

WHATjobpositionisadvertised?什么意思。

什么工作职位被公布?
2023-01-07 22:55:144

You will see this product advertised wherever you go.为何不是to be advertised?

You will see this product advertised wherever you go.see这个动词很好用,就像hear,wtach等,后面可直接跟动词原形,不定式或过去词态
2023-01-07 22:55:276

有几个英语问题 拜托帮忙解答一下

1,你到家的时候,给我个电话好让我知道你安全到达了到达是已经到了,过去的动作2,帮我去问问日报上的登出的职位不能用having been advertised没这时态3,——对不起,我有点跟不上你,你刚才是说你们想在九月二十号回来?——对不起,我没说清楚。我们想在十月二十号回来。这是过去的东西,我刚才没说清楚,过去式
2023-01-07 22:55:493

you will see this product advertised wherever you go.

你好you will see this product advertised wherever you go.无论你走到哪里,你都会看到这个产品的广告。advertised 这里为形容词,做宾补,补充说明宾语product.~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~祝你学习进步,更上一层楼!不明白请及时追问,满意敬请采纳,O(∩_∩)O谢谢~~
2023-01-07 22:56:036

I had seen an agency advertised in a local newspaper .I rushed out of the house in search of it.

advertised 在这是过去分词短语作后置定语不是:had seen sb did sth.
2023-01-07 22:56:283

帮忙回答几道英语问题

11.C12.A13.C14.B15.A16.B17.A18.B19.B20.A21.C22.A23.D24.C25.A
2023-01-07 22:56:394

kafka advertised.listeners和listeners怎么配置

一般场景下只配置listeners即可,在server.properties里:listeners=SASL_PLAINTEXT://IP or hostName:port1,PLAINTEXT://IP or hostName:port2,SSL://IP or hostName:port3,SASL_SSL://IP or hostName:port4 (这些协议可以不用全部配置)在IaaS场景下,比如Kafka集群内部通讯走内网,而对外提供服务的是公网或者隔离网络,则需要配置advertised.listeners,配置方式同上。
2023-01-07 22:56:521

When I saw the job advertised in the paper,I wrote to the company to ask for the detail of it.

当我在报纸上看到这个工作广告信息时,我写信给该公司询问他的详细信息。
2023-01-07 22:56:574

I saw advertised in a local newspaper a teaching

Advertised in a local newspaper 做定语,省略了which was, 修饰a teaching post,两种理解都可以
2023-01-07 22:57:113

work for meal

第一句的主语是the dietitian ,它的谓语就是works,因为the dietitian 是第三人称单数,所以用works,而who is cooking the meal 是修饰the dietitian 既是作为定语部分,对于第一句来说,句子的主干是the dietitian (who is cooking the meal) works for the museum,不要看括号那部分,括号那部分只是修饰the dietitian.你试想一下,如果一个句子是 the dietitian _____for the museum,横线上要你填work的一个正确形式,相信根据A dietitian is cooking the meal.She works for the museum 这个原句的第2句,你会很自然地在横线上填上works而不是is works吧?更何况没有这样的一种形式! 至于第二个,在定语从句 which is advertised in the paper 中,which是这个句子的主语,which指代的正是the movie,那试问,电影是被人做广告,做宣传,还是自己做广告,做宣传?因为电影是一个物体,它自己不能advertise,只能被人advertise,所以这个地方要用被动形式,而被动形式的结构式be动词+动词的过去分词,用到上文正是is+advertised(advertise的过去分词),所以才要加is,这个is的用意是形成被动结构! 在定语从句中选择动词的正确形式一般要取决于对应的主语或宾语在所在的句子中是不是主动,如果是被动需要用被动形式,如果是第三人称单数则要选用对应的第三人称单数.
2023-01-07 22:57:221

in your recently advertised position当中recently是修饰

recently是修饰advertisedyour recently advertised position相当于your position (that was) advertised recently这样就好理解了。
2023-01-07 22:57:273

英语:帮我解释为什么要选这个选项

第一个是做后置定语。横线上应该是that was advertised 的省略第二是drive sb out of sth是固定搭配
2023-01-07 22:57:382

用英语适当形式填空

understood 过去分词做名词的定语including sth;sth included
2023-01-07 22:57:465

I"m calling to enquire about the position ( ) in yesterday"s China Daily .为什么填advertised ~具体

建议采纳3楼
2023-01-07 22:58:074

apply for a post advertised in a newspaper 中文翻译

申请一个职位在报纸上登了广告
2023-01-07 22:58:218

英语句子的用法和解释

advertised是修饰post的…是说那个学校里打了post的广告…然后这事在当地的报纸上登了…最后一个是指站起来…至于第二个没太明白LZ你问的啥…= =||
2023-01-07 22:58:471

非谓语动词急急急

AA 有will则是将来时,这里还应该用完成时,则选AB
2023-01-07 22:58:536

英语提问,急

不是完整的从句,是一个定语而已 看介词with在电视广告播出期间的玩具 进行时,被动
2023-01-07 22:59:144

英语 3道高中非谓语题 求详解 谢谢:)

1.A,该句子中已有主语和谓语,所以不缺谓语动词,非谓语动词做的是position的后置定语。position是被打广告,C和D都是主动,所以只能在A和B来选,因为句中时间是yesterday,所以要用advertised.表示过去,被动。B选项表示将来,所以不选。另外,后置定语不一定是非谓语,通常以a-开头的形容词做定语也后置。修饰不定代词的成分都后置。例如:thebabyasleepseemssweet./i"vegotsomethinginterestingtotellyou.2.因为此处前后有逗号,没有连词,且主干已经有主语(Dina)和谓语(took),所以,两个逗号之间的部分做状语,谓语动词要弱化为非谓语动词做状语。3.traveled表示完成,过去分词做状语只能放在句首以免与动词的过去式混淆;且这里做的是伴随状语,所以不能用过去分词的形式。travel这个动作是伴随着hadawonderfulchildhood同时发生的,所以要用traveling。
2023-01-07 22:59:271

请求翻译(汉译英)

就是 那么长 翻译公司那边收80块大洋还差不多
2023-01-07 22:59:385

to be advertised

see sth done 看到某物被做 过去分词本身就是被动含义.注意:see是感官动词,后面不接加to 不定式,所以,to be advertised是错的.
2023-01-07 23:00:071

什么是advertised window?

信息提示窗口
2023-01-07 23:00:131

本地连接的网卡速率中 lowest speed advertised 是什么意思?

最低速度连接
2023-01-07 23:00:192

wherever you go,you can see the products________

【解答】wherever you go,you can see the products_____D___?A.advertise动词原形B.advertised过去式/过去分词C.to be advertised动词不定式的被动形式D.being advertised现在分词的被动形式选好说下理由1、see sb/sth do sth 看见某人做完某事的全过程,2 see sb/sth doing sth 看见某人正在做某事的的片段,安照生活习惯,D答案 恰当。
2023-01-07 23:00:281

ebay 商品页面的评价下面有一个“as advertised”,这是什么意思啊?

as advertised 像广告所说的那样。
2023-01-07 23:00:331

A job was advertised. A lot of people applied for it. Few of them had the necessary qualifications

A job was advertised and lot of people applied for it, but few of them had the necessary qualificationsA lot of people applied for a job which was advertised , but few of them had the necessary qualifications. Although a lot of people applied for a job which was advertised , few of them had the necessary qualifications Few of the people who applied for the job advertised had the necessary qualifications.
2023-01-07 23:00:421

the advertised sentences make me impressive on t

那些广告上的话让我对这个地铁站印象深刻。供参考。
2023-01-07 23:00:471

英语急需答案

1. A 2 C,3.C,4.D,5 C,6 ,D 7C,8B
2023-01-07 23:00:532

英语单选一道~需要解释,谢谢啦! You will see this product____whe

B
2023-01-07 23:01:123

我装一个软件,老是给我这样的提示:This advertised application will not ....

是什么 软件阿
2023-01-07 23:01:234

which+I+saw+advertised+in+the+school+newspaper+last+week句子成分

这个仅仅是从句。不是个完整的句子。这个从句里, 从句的主语是I。 从句的谓语是saw。which是从句的宾语,也是关系代词。剩余的advertised+in+the+school+newspaper+last+week是宾语补足语。
2023-01-07 23:01:371

If you see an article consistently advertised, i

这句话的主语是it 代替 an article consistently advertisedI know是插入语 可去掉 that从句 是同位语 从句
2023-01-07 23:01:426

帮忙再做几道题,英语的

11.D,cancel an order是取消订单的意思,“既然我们不能继续等待我们所订商品的寄送,那我们就得取消订单”12.A,information是不可数名词,所以用A中的形式13.C,not until用再句首,后面的成分要倒装;而not until后面表示时间点,句子的后半部分通常用一般过去时态14.A,AB都可以表示“满足于...”,但是B项后面要接with15.C,夸大的意思,广播工作者在对电视提出异议16.A,unrecorded,未被记录的;这个就是过去分词做忠吧语了,可以把过去分词看成一个形容词17.C,have objection to doing,这里根据语境推定,应该是对方又重复了一遍自己的故事,说话人才回这么说,所以用完成时,并且变成ing形式18.B,status有社会地位的意思19.C,其他三个词都不合适;excessive是过分的,超出普通的20.B,see后面有两种形式,一种是doing一种是to do,doing表示看到...正处于..的状态,而且这里product是被做广告,做广告的主体是人活着公司,所以应该用被动语态,所以这里应该用being advertised比较好,但是没有这个选项,只好用see sth done, 可以类似上面的理解为“看到某事/物...被置于...状态”
2023-01-07 23:02:047

I have bought such a watch ( ) was advertised on

句中有such...所以后面的定语从句用as, 句子的意思是:我已经买了电视广告中的手表。as引导的定语从句可以用在such...as, the same .. as, so..as, as..as的结构中。 如:He is not the same guide as showed the foreigners around our city a few days ago.他不是前天带领外宾参观我们城市的那个导游。This is not so easy a problem as everyone can work out.这题目并不容易, 不是人人都能解出的。
2023-01-07 23:02:286

you will see this product advertised wherever you go.

seesthdone看到某物被做过去分词本身就是被动含义。注意:see是感官动词,后面不接加to不定式,所以,tobeadvertised是错的。
2023-01-07 23:02:521

"We advertised for pupils last autumn, and got ________ 60."

答案A本题主要考查了数词前修饰语的选用。more than与数词连用,意为“多于”,在此符合语境;more of在此处本身结构有误;as much as用来修饰不可数名词,而此处60 pupils是可数名词复数;so many as仅用于否定句中。句意为:去年秋天我们贴了招生广告,结果招收了60多名学生。
2023-01-07 23:02:581

car for sale什么意思

carforsale的中文翻译  carforsale  汽车销售  双语例句  1  Theyadvertisedausedcarforsale.  他们登了出售旧车的广告。  2  Iadvertisedmycarforsale.  我登广告卖我的车。  3  Theyadvertisedinthenewspaperthattheyhadausedcarforsale.  他们在报上登广告,说有部旧车要卖。
2023-01-07 23:03:031

linux 网卡的Advertised link modes怎么恢复到原始值

重启一下服务器或者网卡
2023-01-07 23:03:092

刊登的英语翻译 刊登用英语怎么说

刊登 [词典] publish; carry; [例句]我们在一家地方报纸上刊登了招聘广告。We advertised for staff in a local newspaper
2023-01-07 23:03:181

you will see this product______whenever you go in this city.

B
2023-01-07 23:03:234

you will see the product

无论你在哪里,你都会看到这个产品的广告. 选B,advertised.是动词advertise的过去分词修饰名词this product,表示被动语态,因产品的广告是不能自己做的,必须是被人来做的.A,to be advertised,表示的是将来的动作,与题意不符,这里表示已经做了广告.
2023-01-07 23:03:381

英语写作广告

Advertisements are forcing their way into people"s lives. People refer to advertisements in their daily lives because they are consumers. The advertisers are usually manufacturers, retailers and salesmen. Their merchandise needs to be advertised to bring it to the attention to the customers. Thus nearly every product is advertised in some way. To a large extent, good advertising leads to success while bad advertising can mean failure.广告正以它们的方式进入到人们的生活中。人们在日常生活中与广告有关因为他们是消费者。广告商通常是制造商,零售商和批发商。他们的商品需要通过广告以引起消费者的关注。因而机会每种产品都以某种方式被广告。在很大程度上来说,好的广告带来成功,而差的广告意味着失败。There are many ways to advertise and ‘ads" come in different forms. Newspapers carry advertisements. Some products are publicized on TV and radio which bring them into notice of a wide audience. Billboards also carry advertising. Advertising is a big industry now and many agencies have been set up to furnish a variety of forms.有很多方式可以打广告,广告的形式各不相同。报纸可以承载广告。有些产品在电视或者广播中宣传,这样能引起大众的注意。广告牌也可以承载广告。现在广告是一个大产业,并设立了很多机构提供各种形式的广告。However, advertising is not always truthful. A product is often misrepresented. The advertiser exaggerates the benefits of the merchandise he wants to sell. Thus, he misrepresents the truth. The consumer falls victim to such advertising. Millions of people have bought advertised products and have been dissatisfied with them。然而,广告并非总是真实的。一种产品通常是被歪曲呈现的。广告商夸大了他想销售的商品的好处。这样一来,他就扭曲了事实。消费者就成为了这类广告的受害者。数百万人们买了广告商品又对它们不满意
2023-01-07 23:03:431

麻烦看看这道题You will see the product ____wherever you go

因为前面的will已经体现了后文to do的含义,是为了避免重复哟。所以选B。希望对你有用!
2023-01-07 23:03:494

信用证翻译

条款不完整
2023-01-07 23:04:123

几句中译英

1.I doubt that kind of does to advertisedly reduce weight whether medicine is really valid or not on TV2He feels oneself incapable for the dint, seeing that a teacher"s help.3The transportation present condition of the our country less than we thought of.4.Once you have confidence in by yourself, you sure be successd in studying第5句不知道
2023-01-07 23:04:584

雅思口语问题do you think that certain product are better advertised particular ways怎么回答

it really depends.when i am working on a case, teamwork does matter since my peers would give me more comprehensive examples and points of view to solve the problem. i can explore my knowledge and obtain good views by brainstorming, research grouping.when i am focusing on a specific issue, i would like to study individually. because i can concentrate on collecting information, analyzing it and draw conclusion clearly. moreover, studying personally will trigger my creativity.
2023-01-07 23:05:121

linux下查看网卡信息返回值的意思

PAUSE Frame是网卡流量控制的一种技术,中文意思是"暂停帧“。因此,那三个分别是:Advertised pause frame use:NO ;----宣告暂停帧使用, 不支持。Advertised pause frame use:symmetric ;;----宣告暂停帧使用, 同步。Advertised pause frame use:symmetric receive-only ;----宣告暂停帧使用, 仅同步接收。
2023-01-07 23:05:181