You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2021/08/04 08:18:19 UTC

[GitHub] [incubator-doris] vergilchiu opened a new issue #6376: [Bug] Be can't reconnect fe over hostname in k8s

vergilchiu opened a new issue #6376:
URL: https://github.com/apache/incubator-doris/issues/6376


   **Describe the bug**
   I deploy doris in k8s .
   Connecting to fe , adding be node using be's hostname , not ip .
   Be can't reconnect fe over hostname , when be's pod restart and it's ip changed.
   
   **To Reproduce**
   Assuming that “node-1” 's ip is "172.1.10"
   
   ```shell
   alter system add backend "node-1:9050"
   ```
   
   Now, I change node-1 's to "172.1.11" and restart be .
   Be cant't reconnect fe.
   
   
   **Expected behavior**
   Be can reconnect fe over hostname if I add be node using be's hostname
   
   
   **Desktop (please complete the following information):**
    - OS: ceonts7
   
   


-- 
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-unsubscribe@doris.apache.org

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



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


[GitHub] [incubator-doris] chovy-3012 edited a comment on issue #6376: [Bug] Be can't reconnect fe over hostname in k8s

Posted by GitBox <gi...@apache.org>.
chovy-3012 edited a comment on issue #6376:
URL: https://github.com/apache/incubator-doris/issues/6376#issuecomment-1011885402


   Be maybe would also use hostname as it's address in the later version . 


-- 
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-unsubscribe@doris.apache.org

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



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


[GitHub] [incubator-doris] chovy-3012 commented on issue #6376: [Bug] Be can't reconnect fe over hostname in k8s

Posted by GitBox <gi...@apache.org>.
chovy-3012 commented on issue #6376:
URL: https://github.com/apache/incubator-doris/issues/6376#issuecomment-1011881768


   > I have the same problem as you. The temporary solution I am currently using is hostNetwork
   
   Using `host` network and host's ip can resovle this problem .
   
   Be can't using hostname as it's address , because `Doris` will  convert hostname to ip before writing into meta .


-- 
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-unsubscribe@doris.apache.org

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



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


[GitHub] [incubator-doris] morningman commented on issue #6376: [Bug] Be can't reconnect fe over hostname in k8s

Posted by GitBox <gi...@apache.org>.
morningman commented on issue #6376:
URL: https://github.com/apache/incubator-doris/issues/6376#issuecomment-1011895227


   Yes, currently, all hostname will be converted to ip at first time. And use IP every where.


-- 
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-unsubscribe@doris.apache.org

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



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


[GitHub] [incubator-doris] liangyongz commented on issue #6376: [Bug] Be can't reconnect fe over hostname in k8s

Posted by GitBox <gi...@apache.org>.
liangyongz commented on issue #6376:
URL: https://github.com/apache/incubator-doris/issues/6376#issuecomment-1011877601


   I have the same problem as you. The temporary solution I am currently using is hostNetwork


-- 
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-unsubscribe@doris.apache.org

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



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


[GitHub] [incubator-doris] chovy-3012 commented on issue #6376: [Bug] Be can't reconnect fe over hostname in k8s

Posted by GitBox <gi...@apache.org>.
chovy-3012 commented on issue #6376:
URL: https://github.com/apache/incubator-doris/issues/6376#issuecomment-1011885402


   Be would also use hostname as it's address in the later version . 


-- 
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-unsubscribe@doris.apache.org

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



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


[GitHub] [incubator-doris] vergilchiu commented on issue #6376: [Bug] Be can't reconnect fe over hostname in k8s

Posted by GitBox <gi...@apache.org>.
vergilchiu commented on issue #6376:
URL: https://github.com/apache/incubator-doris/issues/6376#issuecomment-892472378


   I read the addBackend code .
   When adding backend , doris will validate host and port , and replace hostname with ip.
   
   I wonder that why replacing hostname with ip ? If so , fe will not save ip instead of hostname . 
   Because in some deploy scenarios , it is necessary to use  hostname instead of ip.
   
   
   class : org.apache.doris.system. SystemInfoService
   ```java
   public static Pair<String, Integer> validateHostAndPort(String hostPort) throws AnalysisException {
           hostPort = hostPort.replaceAll("\\s+", "");
           if (hostPort.isEmpty()) {
               throw new AnalysisException("Invalid host port: " + hostPort);
           }
   
           String[] pair = hostPort.split(":");
           if (pair.length != 2) {
               throw new AnalysisException("Invalid host port: " + hostPort);
           }
   
           String host = pair[0];
           if (Strings.isNullOrEmpty(host)) {
               throw new AnalysisException("Host is null");
           }
   
           int heartbeatPort = -1;
           try {
               // validate host
               if (!InetAddressValidator.getInstance().isValid(host)) {
                   // maybe this is a hostname
                   // if no IP address for the host could be found, 'getByName'
                   // will throw
                   // UnknownHostException
                   InetAddress inetAddress = InetAddress.getByName(host);
                   //**************************
                   //here, replace hostname with ip
                   host = inetAddress.getHostAddress();
               }
   
               // validate port
               heartbeatPort = Integer.parseInt(pair[1]);
   
               if (heartbeatPort <= 0 || heartbeatPort >= 65536) {
                   throw new AnalysisException("Port is out of range: " + heartbeatPort);
               }
   
               return new Pair<String, Integer>(host, heartbeatPort);
           } catch (UnknownHostException e) {
               throw new AnalysisException("Unknown host: " + e.getMessage());
           } catch (Exception e) {
               throw new AnalysisException("Encounter unknown exception: " + e.getMessage());
           }
       }
   ```


-- 
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-unsubscribe@doris.apache.org

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



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