[ 
https://issues.apache.org/jira/browse/CASSANDRA-20988?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18035351#comment-18035351
 ] 

Michael Burman commented on CASSANDRA-20988:
--------------------------------------------

This appears to be the case indeed. The syscall RTM_GETLINK just returns it 
without the non-peer part:

Found interface: {Index:11 MTU:65535 Name:eth0 HardwareAddr:06:e3:26:48:65:e1 
Flags:up|broadcast|multicast|running}

Perhaps I'll just go around this with some logic in our config builder, 
fetching the interface and then mapping that interface to an IP instead and 
remove the rpc_interface parameter if user has used it. This should allow a bit 
easier automated interface targeting (and just reject it if there's more than 
one peered one). I'll close this ticket for now since it's not possible to do 
anything sane in Cassandra itself.

> rpc_interface won't find veth peer interfaces
> ---------------------------------------------
>
>                 Key: CASSANDRA-20988
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-20988
>             Project: Apache Cassandra
>          Issue Type: Bug
>            Reporter: Michael Burman
>            Priority: Normal
>
> If the network is using peered interfaces, the ability to use "rpc_interface" 
> is lost since it only accepts the exact naming. This naming is however 
> dynamic since it depends on the time the interface was generated. Virtual 
> networks with peered interfaces have the format 
> <network-interface>@if<running-number>. For example, the following output is 
> possible:
> {noformat}
> 11: eth0@if20: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 65535 qdisc noqueue 
> state UP group default qlen 1000
>     link/ether 32:41:2a:58:15:2d brd ff:ff:ff:ff:ff:ff link-netnsid 0
>     inet6 fd00:10:244:4::a/64 scope global 
>        valid_lft forever preferred_lft forever
>     inet6 fe80::3041:2aff:fe58:152d/64 scope link proto kernel_ll 
>        valid_lft forever preferred_lft forever
> {noformat}
> This is pretty common in virtualized environments (or Kubernetes). The way 
> that rpc_interface works is by using NetworkInterface.getByName(intf) and 
> this leads to exact name matching (at least in the current JDK, 
> https://github.com/openjdk/jdk/blob/e7c7892b9f0fcee37495cce312fdd67dc800f9c9/src/java.base/unix/native/libnet/NetworkInterface.c#L202
>  which does not understand the @ separator. 
> This leads to an issue where setting "eth0" on every node as the preferred 
> rpc_interface (due to existence of multiple interfaces in the system with 
> dynamic IPs) will result in Cassandra not starting. 
> A similar issue might happen with VLANs where the naming has a running index 
> also. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to