Skip to content

Commit

Permalink
feat: add arg to standalone start command (#2837)
Browse files Browse the repository at this point in the history
* feat: add  arg to standalone start command

Signed-off-by: Ruihang Xia <[email protected]>

* add this arg to metasrv

Signed-off-by: Ruihang Xia <[email protected]>

* remove short arg name

Signed-off-by: Ruihang Xia <[email protected]>

---------

Signed-off-by: Ruihang Xia <[email protected]>
  • Loading branch information
waynexia authored Nov 29, 2023
1 parent 92a9802 commit 445bd92
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/cmd/src/metasrv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ struct StartCommand {
http_timeout: Option<u64>,
#[clap(long, default_value = "GREPTIMEDB_METASRV")]
env_prefix: String,
/// The working home directory of this metasrv instance.
#[clap(long)]
data_home: Option<String>,
}

impl StartCommand {
Expand Down Expand Up @@ -152,6 +155,10 @@ impl StartCommand {
opts.http.timeout = Duration::from_secs(http_timeout);
}

if let Some(data_home) = &self.data_home {
opts.data_home = data_home.clone();
}

// Disable dashboard in metasrv.
opts.http.disable_dashboard = true;

Expand Down
7 changes: 7 additions & 0 deletions src/cmd/src/standalone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,9 @@ struct StartCommand {
user_provider: Option<String>,
#[clap(long, default_value = "GREPTIMEDB_STANDALONE")]
env_prefix: String,
/// The working home directory of this standalone instance.
#[clap(long)]
data_home: Option<String>,
}

impl StartCommand {
Expand Down Expand Up @@ -257,6 +260,10 @@ impl StartCommand {
opts.http.addr = addr.clone()
}

if let Some(data_home) = &self.data_home {
opts.storage.data_home = data_home.clone();
}

if let Some(addr) = &self.rpc_addr {
// frontend grpc addr conflict with datanode default grpc addr
let datanode_grpc_addr = DatanodeOptions::default().rpc_addr;
Expand Down

0 comments on commit 445bd92

Please sign in to comment.