wzhxs opened a new issue, #42695:
URL: https://github.com/apache/doris/issues/42695

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/doris/issues?q=is%3Aissue) and found no 
similar issues.
   
   
   ### Version
   
   doris 2.1.6
   
   ### What's Wrong?
   
   
   ipv6网络使用包含简写如 :: 时,存在无法join的现象。
   
   
   ### What You Expected?
   
   后续版本支持包含 :: 的ipv6地址。
   
   ### How to Reproduce?
   
   1、如配置fe.conf 网络ip为:fe80::20c:29ff:fef9:3a18/64,或任意包含 :: 的ipv6 网络地址。
   2、正常启动fe,查看fe状态无法join
   
   ### Anything Else?
   
   分析源码,确定是类org.apache.doris.common.proc.FrontendsProcNode 的 isJoin 
方法,匹配ipv6值时,参数 Frontend 的host属性值为 
`fe80::20c:29ff:fef9:3a18`,而List<InetSocketAddress> allFeHosts 由于使用了java 的 
InetAddress类 getHostAddress()获取ip 值为:`fe80:0:0:0:20c:29ff:fef9:3a18`
   
   两个ip地址不相同,无法join。
   
   **处理方法**
   使用如下方法,对 InetAddress.getHostAddress() 的结果进行二次处理。
   
   ```java
        public String formatIp(String context) {
                
                while(true) {
                        if(context.contains(":0:")) {
                                context=context.replaceAll(":0:", "::");
                        }else {
                                break;
                        }
                }
                
                while(true) {
                        if(context.contains(":::")) {
                                context=context.replaceAll(":::", "::");
                        }else {
                                return context;
                        }
                }
        }
   ```
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to