@@ -64,19 +64,13 @@ pub struct MetaNodeOpts {
64
64
#[ clap( long, env = "RW_LISTEN_ADDR" , default_value = "127.0.0.1:5690" ) ]
65
65
listen_addr : String ,
66
66
67
- /// Deprecated. But we keep it for backward compatibility.
68
- #[ clap( long, env = "RW_HOST" ) ]
69
- host : Option < String > ,
70
-
71
67
/// The address for contacting this instance of the service.
72
68
/// This would be synonymous with the service's "public address"
73
69
/// or "identifying address".
74
70
/// It will serve as a unique identifier in cluster
75
71
/// membership and leader election. Must be specified for etcd backend.
76
- /// TODO: After host is removed, we require that this parameter must be provided when using
77
- /// etcd
78
72
#[ clap( long, env = "RW_ADVERTISE_ADDR" ) ]
79
- advertise_addr : Option < String > ,
73
+ advertise_addr : String ,
80
74
81
75
#[ clap( long, env = "RW_DASHBOARD_HOST" ) ]
82
76
dashboard_host : Option < String > ,
@@ -165,7 +159,6 @@ pub struct OverrideConfigOpts {
165
159
}
166
160
167
161
use std:: future:: Future ;
168
- use std:: net:: SocketAddr ;
169
162
use std:: pin:: Pin ;
170
163
171
164
use risingwave_common:: config:: { load_config, MetaBackend , RwConfig } ;
@@ -181,13 +174,9 @@ pub fn start(opts: MetaNodeOpts) -> Pin<Box<dyn Future<Output = ()> + Send>> {
181
174
let config = load_config ( & opts. config_path , Some ( opts. override_opts ) ) ;
182
175
info ! ( "> config: {:?}" , config) ;
183
176
info ! ( "> version: {} ({})" , RW_VERSION , GIT_SHA ) ;
184
- let listen_addr: SocketAddr = opts. listen_addr . parse ( ) . unwrap ( ) ;
185
- let meta_addr = opts. host . unwrap_or_else ( || listen_addr. ip ( ) . to_string ( ) ) ;
177
+ let listen_addr = opts. listen_addr . parse ( ) . unwrap ( ) ;
186
178
let dashboard_addr = opts. dashboard_host . map ( |x| x. parse ( ) . unwrap ( ) ) ;
187
179
let prometheus_addr = opts. prometheus_host . map ( |x| x. parse ( ) . unwrap ( ) ) ;
188
- let advertise_addr = opts
189
- . advertise_addr
190
- . unwrap_or_else ( || format ! ( "{}:{}" , meta_addr, listen_addr. port( ) ) ) ;
191
180
let backend = match config. meta . backend {
192
181
MetaBackend :: Etcd => MetaStoreBackend :: Etcd {
193
182
endpoints : opts
@@ -212,7 +201,7 @@ pub fn start(opts: MetaNodeOpts) -> Pin<Box<dyn Future<Output = ()> + Send>> {
212
201
213
202
info ! ( "Meta server listening at {}" , listen_addr) ;
214
203
let add_info = AddressInfo {
215
- advertise_addr,
204
+ advertise_addr : opts . advertise_addr ,
216
205
listen_addr,
217
206
prometheus_addr,
218
207
dashboard_addr,
0 commit comments