From 1e8ca497e05a5f1a2c8adc3fc6f811251a231857 Mon Sep 17 00:00:00 2001 From: Dhammika Pathirana Date: Wed, 9 Feb 2022 11:54:25 -0800 Subject: [PATCH] Fix safekeeper loopback addr (#1247) Signed-off-by: Dhammika Pathirana --- control_plane/safekeepers.conf | 4 ++-- control_plane/simple.conf | 4 ++-- control_plane/src/safekeeper.rs | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/control_plane/safekeepers.conf b/control_plane/safekeepers.conf index 118432556b..828d5a5a1e 100644 --- a/control_plane/safekeepers.conf +++ b/control_plane/safekeepers.conf @@ -1,7 +1,7 @@ # Page server and three safekeepers. [pageserver] -listen_pg_addr = 'localhost:64000' -listen_http_addr = 'localhost:9898' +listen_pg_addr = '127.0.0.1:64000' +listen_http_addr = '127.0.0.1:9898' auth_type = 'Trust' [[safekeepers]] diff --git a/control_plane/simple.conf b/control_plane/simple.conf index 3eac5d5757..796c6adbd9 100644 --- a/control_plane/simple.conf +++ b/control_plane/simple.conf @@ -1,8 +1,8 @@ # Minimal zenith environment with one safekeeper. This is equivalent to the built-in # defaults that you get with no --config [pageserver] -listen_pg_addr = 'localhost:64000' -listen_http_addr = 'localhost:9898' +listen_pg_addr = '127.0.0.1:64000' +listen_http_addr = '127.0.0.1:9898' auth_type = 'Trust' [[safekeepers]] diff --git a/control_plane/src/safekeeper.rs b/control_plane/src/safekeeper.rs index 94cbb4254c..f5478b5922 100644 --- a/control_plane/src/safekeeper.rs +++ b/control_plane/src/safekeeper.rs @@ -85,7 +85,7 @@ impl SafekeeperNode { pg_connection_config: Self::safekeeper_connection_config(conf.pg_port), env: env.clone(), http_client: Client::new(), - http_base_url: format!("http://localhost:{}/v1", conf.http_port), + http_base_url: format!("http://127.0.0.1:{}/v1", conf.http_port), pageserver, } } @@ -93,7 +93,7 @@ impl SafekeeperNode { /// Construct libpq connection string for connecting to this safekeeper. fn safekeeper_connection_config(port: u16) -> Config { // TODO safekeeper authentication not implemented yet - format!("postgresql://no_user@localhost:{}/no_db", port) + format!("postgresql://no_user@127.0.0.1:{}/no_db", port) .parse() .unwrap() } @@ -114,8 +114,8 @@ impl SafekeeperNode { ); io::stdout().flush().unwrap(); - let listen_pg = format!("localhost:{}", self.conf.pg_port); - let listen_http = format!("localhost:{}", self.conf.http_port); + let listen_pg = format!("127.0.0.1:{}", self.conf.pg_port); + let listen_http = format!("127.0.0.1:{}", self.conf.http_port); let mut cmd = Command::new(self.env.safekeeper_bin()?); fill_rust_env_vars(