Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(meta): add back host, a deprecated cmd line argument #7616

Merged
merged 2 commits into from
Jan 31, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/meta/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ pub struct MetaNodeOpts {
#[clap(long, default_value = "127.0.0.1:5690")]
listen_addr: String,

/// Deprecated. But we keep it for backward compatibility.
#[clap(long)]
host: Option<String>,

/// The endpoint for this meta node, which also serves as its unique identifier in cluster
/// membership and leader election.
#[clap(long)]
Expand Down Expand Up @@ -120,6 +124,7 @@ pub struct MetaNodeOpts {
}

use std::future::Future;
use std::net::SocketAddr;
use std::pin::Pin;

use risingwave_common::config::load_config;
Expand All @@ -132,13 +137,14 @@ pub fn start(opts: MetaNodeOpts) -> Pin<Box<dyn Future<Output = ()> + Send>> {
let config = load_config(&opts.config_path);
tracing::info!("Starting meta node with config {:?}", config);
tracing::info!("Starting meta node with options {:?}", opts);
let listen_addr = opts.listen_addr.parse().unwrap();
let listen_addr: SocketAddr = opts.listen_addr.parse().unwrap();
let meta_addr = opts.host.unwrap_or_else(|| opts.listen_addr.clone());
let dashboard_addr = opts.dashboard_host.map(|x| x.parse().unwrap());
let prometheus_addr = opts.prometheus_host.map(|x| x.parse().unwrap());
let (meta_endpoint, backend) = match opts.backend {
Backend::Etcd => (
opts.meta_endpoint
.expect("meta_endpoint must be specified when using etcd"),
.unwrap_or_else(|| format!("{}:{}", meta_addr, listen_addr.port())),
MetaStoreBackend::Etcd {
endpoints: opts
.etcd_endpoints
Expand Down