|
@@ -32,11 +32,10 @@ public class SpringLifecycle implements ApplicationRunner, DisposableBean {
|
|
|
Set<String> ipv4AddressSet = getAddress();
|
|
Set<String> ipv4AddressSet = getAddress();
|
|
|
// 通过 vm option -Dserver.address=192.168.0.10 指定
|
|
// 通过 vm option -Dserver.address=192.168.0.10 指定
|
|
|
String serverAddress1 = System.getProperty("server.address");
|
|
String serverAddress1 = System.getProperty("server.address");
|
|
|
- // 通过环境变量 SERVER_ADDRESS=192.168.0.10 指定时端口会绑定到该地址, 只会监听 192.168.0.10:6002
|
|
|
|
|
- // 通过环境变量 NODE_ADDRESS=192.168.0.10 指定
|
|
|
|
|
|
|
+ // 通过环境变量 NODE_ADDRESS=192.168.0.10 指定时端口会绑定到该地址, 只会监听 192.168.0.10:6002
|
|
|
String serverAddress = System.getenv("NODE_ADDRESS");
|
|
String serverAddress = System.getenv("NODE_ADDRESS");
|
|
|
if (!ipv4AddressSet.contains(serverAddress)) {
|
|
if (!ipv4AddressSet.contains(serverAddress)) {
|
|
|
- log.error("没有通过环境变量 SERVER_ADDRESS 指定地址, 或是指定的地址不是机器地址 {}, 结束 MessageService 进程...", ipv4AddressSet);
|
|
|
|
|
|
|
+ log.error("没有通过环境变量 NODE_ADDRESS 指定地址, 或是指定的地址不是机器地址 {}, 结束 MessageService 进程...", ipv4AddressSet);
|
|
|
System.exit(SpringApplication.exit(applicationContext));
|
|
System.exit(SpringApplication.exit(applicationContext));
|
|
|
}
|
|
}
|
|
|
|
|
|