Yukang-Lian commented on code in PR #16617: URL: https://github.com/apache/doris/pull/16617#discussion_r1102817961
########## be/src/service/backend_options.cpp: ########## @@ -101,6 +100,61 @@ bool BackendOptions::analyze_priority_cidrs() { return true; } + +//从network_interface中获取IP Review Comment: ditto ########## be/src/service/backend_options.cpp: ########## @@ -101,6 +100,61 @@ bool BackendOptions::analyze_priority_cidrs() { return true; } + +//从network_interface中获取IP +bool BackendOptions::analyze_network_interface() { + if (config::network_interface[0] == "") { + // 为空,则去分析priority_networks配置值 + return false; + } + LOG(INFO) << "network name in conf: " << config::network_interface[0]; + LOG(INFO) << "priority cidrs in conf: " << config::network_interface[1]; + + if (analyze_cidrs(config::network_interface[1])) { + return true; + } else { + return false; + } + // std::vector<std::string> cidr_strs = + // strings::Split(config::network_interface[1], PRIORITY_CIDR_SEPARATOR); + + // for (auto& cidr_str : cidr_strs) { + // CIDR cidr; + // if (!cidr.reset(cidr_str)) { + // LOG(FATAL) << "wrong cidr format. cidr_str=" << cidr_str; + // return false; + // } + // _s_priority_cidrs.push_back(cidr); + // } + // return true; Review Comment: useless code? ########## conf/be.conf: ########## @@ -34,13 +34,14 @@ brpc_port = 8060 # If no ip match this rule, will choose one randomly. # use CIDR format, e.g. 10.10.10.0/24 # Default value is empty. -# priority_networks = 10.10.10.0/24;192.168.0.0/16 +priority_networks = 127.0.0.1/16 +network_interface = eth1, 127.0.0.1/16 # data root path, separate by ';' # you can specify the storage medium of each root path, HDD or SSD # you can add capacity limit at the end of each root path, separate by ',' # eg: -# storage_root_path = /home/disk1/doris.HDD,50;/home/disk2/doris.SSD,1;/home/disk2/doris +# storage_root_path = /root/git/output/be/storage;/home/disk2/doris.SSD,1;/home/disk2/doris # /home/disk1/doris.HDD, capacity limit is 50GB, HDD; # /home/disk2/doris.SSD, capacity limit is 1GB, SSD; Review Comment: modify this file in your environment, but do not commit it. ########## conf/fe.conf: ########## @@ -52,7 +52,7 @@ mysql_service_nio_enabled = true # If no ip match this rule, will choose one randomly. # use CIDR format, e.g. 10.10.10.0/24 # Default value is empty. -# priority_networks = 10.10.10.0/24;192.168.0.0/16 +priority_networks = 127.0.0.1/16 # Advanced configurations # log_roll_size_mb = 1024 Review Comment: ditto ########## be/src/service/backend_options.cpp: ########## @@ -101,6 +100,61 @@ bool BackendOptions::analyze_priority_cidrs() { return true; } + +//从network_interface中获取IP +bool BackendOptions::analyze_network_interface() { + if (config::network_interface[0] == "") { + // 为空,则去分析priority_networks配置值 + return false; + } + LOG(INFO) << "network name in conf: " << config::network_interface[0]; + LOG(INFO) << "priority cidrs in conf: " << config::network_interface[1]; + + if (analyze_cidrs(config::network_interface[1])) { + return true; + } else { + return false; + } + // std::vector<std::string> cidr_strs = + // strings::Split(config::network_interface[1], PRIORITY_CIDR_SEPARATOR); + + // for (auto& cidr_str : cidr_strs) { + // CIDR cidr; + // if (!cidr.reset(cidr_str)) { + // LOG(FATAL) << "wrong cidr format. cidr_str=" << cidr_str; + // return false; + // } + // _s_priority_cidrs.push_back(cidr); + // } + // return true; +} + +bool BackendOptions::analyze_priority_cidrs() { + if (config::priority_networks == "") { + return true; + } + LOG(INFO) << "priority cidrs in conf: " << config::priority_networks; + + if (analyze_cidrs(config::priority_networks)) { + return true; + } else { + return false; + } + + // std::vector<std::string> cidr_strs = + // strings::Split(config::priority_networks, PRIORITY_CIDR_SEPARATOR); + + // for (auto& cidr_str : cidr_strs) { + // CIDR cidr; + // if (!cidr.reset(cidr_str)) { + // LOG(FATAL) << "wrong cidr format. cidr_str=" << cidr_str; + // return false; + // } + // _s_priority_cidrs.push_back(cidr); + // } + // return true; +} Review Comment: ditto -- 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 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