Skip to content

Commit

Permalink
fix: support multi addrs while using etcd (GreptimeTeam#2562)
Browse files Browse the repository at this point in the history
fix: support multi addrs while useing etcd
  • Loading branch information
fengjiachun authored and paomian committed Oct 19, 2023
1 parent ed43921 commit 13c67d9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions src/meta-srv/src/bootstrap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,13 @@ pub async fn build_meta_srv(opts: &MetaSrvOptions, plugins: Plugins) -> Result<M
Some(Arc::new(MemLock::default()) as _),
)
} else {
let etcd_endpoints = [&opts.store_addr];
let etcd_client = Client::connect(etcd_endpoints, None)
let etcd_endpoints = opts
.store_addr
.split(',')
.map(|x| x.trim())
.filter(|x| !x.is_empty())
.collect::<Vec<_>>();
let etcd_client = Client::connect(&etcd_endpoints, None)
.await
.context(error::ConnectEtcdSnafu)?;
(
Expand Down
2 changes: 1 addition & 1 deletion src/meta-srv/src/metasrv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ impl Default for MetaSrvOptions {
store_addr: "127.0.0.1:2379".to_string(),
selector: SelectorType::default(),
use_memory_store: false,
enable_region_failover: true,
enable_region_failover: false,
http: HttpOptions::default(),
logging: LoggingOptions {
dir: format!("{METASRV_HOME}/logs"),
Expand Down

0 comments on commit 13c67d9

Please sign in to comment.