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