Fix conflict
This commit is contained in:
parent
93246b3ded
commit
c7100e25f8
@ -28,17 +28,16 @@ import static com.alibaba.nacos.common.util.SystemUtils.PREFER_HOSTNAME_OVER_IP;
|
||||
*/
|
||||
public class NetUtils {
|
||||
|
||||
private static String localIpAddress = null;
|
||||
private static String serverAddress = null;
|
||||
|
||||
public static String localIP() {
|
||||
public static String localServer() {
|
||||
try {
|
||||
if (StringUtils.isBlank(localIpAddress)) {
|
||||
localIpAddress = InetAddress.getLocalHost().getHostAddress();
|
||||
if (StringUtils.isNotBlank(serverAddress)) {
|
||||
return serverAddress + UtilsAndCommons.CLUSTER_CONF_IP_SPLITER + RunningConfig.getServerPort();
|
||||
}
|
||||
return localIpAddress + ":" + RunningConfig.getServerPort();
|
||||
|
||||
InetAddress inetAddress = InetAddress.getLocalHost();
|
||||
String serverAddress = inetAddress.getHostAddress();
|
||||
serverAddress = inetAddress.getHostAddress();
|
||||
if (PREFER_HOSTNAME_OVER_IP) {
|
||||
if (inetAddress.getHostName().equals(inetAddress.getCanonicalHostName())) {
|
||||
serverAddress = inetAddress.getHostName();
|
||||
|
@ -973,7 +973,7 @@ public class ApiCommands {
|
||||
if (RaftCore.isLeader()) {
|
||||
try {
|
||||
domainsManager.getDom2LockMap().get(dom).lock();
|
||||
proxyParams.put("clientIP", NetUtils.localIP());
|
||||
proxyParams.put("clientIP", NetUtils.localServer());
|
||||
proxyParams.put("notify", "true");
|
||||
|
||||
proxyParams.put("term", String.valueOf(RaftCore.getPeerSet().local().term));
|
||||
|
Loading…
Reference in New Issue
Block a user