Bringing together the Apache Cassandra experts from the community and DataStax.

Want to learn? Have a question? Want to share your expertise? You are in the right place!

Not sure where to begin? Getting Started

 

question

wdeng avatar image
wdeng asked ·

broadcast_address和listen_address的区别?

有个问题想请教各位,system.peers的第一列peer所给的net地址,是对应system.local的broadcast_address还是listen_address还是rpc_address?文档说如果是internal node communication应该是broadcast或者listen,从driver thrift访问是rpc_address。不太明白的一点是,为什么需要broadcast 和listen两个config?这两个概念上有什么不同吗?

configuration
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

wdeng avatar image
wdeng answered ·

这个问题实际上在cassandra.yaml里面有标注 分别干嘛的。listen_address主要是port 7000的一个bind 地址,broadcast_address 主要是 gossip交互,告知别人你的ip。如果你不配置broadcast_address,它的取值是和listen_address一样。listen_address和broadcast_address在节点之间的通信时使用。rpc_address 主要是9160 thrift的bind地址,还有native transport 的ip 一般是9042 CQL协议的地址bind。 你看配置文件里面,有详细解释。



Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.