Skip to content

Commit fa4c463

Browse files
authored
fix(playground): listen to 127.0.0.1 instead of 0.0.0.0 for gRPC services (#20297)
Signed-off-by: Bugen Zhao <[email protected]>
1 parent a1e5188 commit fa4c463

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

Diff for: src/cmd_all/src/bin/risingwave.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ impl Component {
122122
Self::Frontend => frontend(parse_opts(matches)),
123123
Self::Compactor => compactor(parse_opts(matches)),
124124
Self::Ctl => ctl(parse_opts(matches)),
125-
Self::Playground => single_node(SingleNodeOpts::new_for_playground()),
125+
Self::Playground => playground(),
126126
Self::Standalone => standalone(parse_opts(matches)),
127127
Self::SingleNode => single_node(parse_opts(matches)),
128128
}
@@ -248,6 +248,10 @@ fn single_node(opts: SingleNodeOpts) -> ! {
248248
risingwave_rt::main_okk(|shutdown| risingwave_cmd_all::standalone(opts, shutdown));
249249
}
250250

251+
fn playground() -> ! {
252+
single_node(SingleNodeOpts::new_for_playground());
253+
}
254+
251255
#[cfg(test)]
252256
mod tests {
253257
use std::assert_matches::assert_matches;

Diff for: src/cmd_all/src/single_node.rs

+3-6
Original file line numberDiff line numberDiff line change
@@ -194,14 +194,11 @@ pub fn map_single_node_opts_to_standalone_opts(opts: SingleNodeOpts) -> ParsedSt
194194
}
195195

196196
// Set listen addresses (force to override)
197-
meta_opts.listen_addr = "0.0.0.0:5690".to_owned();
197+
meta_opts.listen_addr = "127.0.0.1:5690".to_owned();
198198
meta_opts.advertise_addr = "127.0.0.1:5690".to_owned();
199199
meta_opts.dashboard_host = Some("0.0.0.0:5691".to_owned());
200-
compute_opts.listen_addr = "0.0.0.0:5688".to_owned();
201-
compactor_opts.listen_addr = "0.0.0.0:6660".to_owned();
202-
if let Some(frontend_addr) = &opts.node_opts.listen_addr {
203-
frontend_opts.listen_addr.clone_from(frontend_addr);
204-
}
200+
compute_opts.listen_addr = "127.0.0.1:5688".to_owned();
201+
compactor_opts.listen_addr = "127.0.0.1:6660".to_owned();
205202

206203
// Set Meta addresses for all nodes (force to override)
207204
let meta_addr = "http://127.0.0.1:5690".to_owned();

0 commit comments

Comments
 (0)