This is an automated email from the ASF dual-hosted git repository.

morrysnow pushed a commit to branch branch-3.1
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-3.1 by this push:
     new ad9f8f14d7b branch-3.1: [chore](cloud) Check local ip before start 
metaservice #53793 (#53888)
ad9f8f14d7b is described below

commit ad9f8f14d7bdff4b132e089ec114aff57f600ecb
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Fri Jul 25 16:00:56 2025 +0800

    branch-3.1: [chore](cloud) Check local ip before start metaservice #53793 
(#53888)
    
    Cherry-picked from #53793
    
    Co-authored-by: walter <[email protected]>
---
 cloud/src/common/network_util.cpp | 1 +
 cloud/src/main.cpp                | 5 +++++
 2 files changed, 6 insertions(+)

diff --git a/cloud/src/common/network_util.cpp 
b/cloud/src/common/network_util.cpp
index 5ac8483cc14..14b6d0fa13d 100644
--- a/cloud/src/common/network_util.cpp
+++ b/cloud/src/common/network_util.cpp
@@ -170,6 +170,7 @@ std::string get_local_ip(const std::string& 
priority_networks) {
                      << "there may be multiple NICs for use, "
                      << "please set priority_networks with a CIDR expression 
in doris_cloud.conf "
                      << "to choose a non-loopback address accordingly";
+        LOG(WARNING) << "process will exit ...";
         exit(-1);
     };
     if (priority_networks == "") {
diff --git a/cloud/src/main.cpp b/cloud/src/main.cpp
index 6d0c22f3204..d4d027dc9a5 100644
--- a/cloud/src/main.cpp
+++ b/cloud/src/main.cpp
@@ -36,6 +36,7 @@
 #include "common/configbase.h"
 #include "common/encryption_util.h"
 #include "common/logging.h"
+#include "common/network_util.h"
 #include "meta-service/meta_server.h"
 #include "meta-store/mem_txn_kv.h"
 #include "meta-store/txn_kv.h"
@@ -228,6 +229,10 @@ int main(int argc, char** argv) {
     LOG(INFO) << build_info();
     std::cout << build_info() << std::endl;
 
+    // Check the local ip before starting the meta service or recycler.
+    std::string ip = get_local_ip(config::priority_networks);
+    std::cout << "local ip: " << ip << std::endl;
+
     if (!args.get<bool>(ARG_META_SERVICE) && !args.get<bool>(ARG_RECYCLER)) {
         std::get<0>(args.args()[ARG_META_SERVICE]) = true;
         std::get<0>(args.args()[ARG_RECYCLER]) = true;


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

Reply via email to