Skip to content

Commit

Permalink
Update version to 1.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
nkorange committed Oct 24, 2019
1 parent 2587fa1 commit 4d68565
Show file tree
Hide file tree
Showing 26 changed files with 126 additions and 127 deletions.
2 changes: 1 addition & 1 deletion address/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<parent>
<artifactId>nacos-all</artifactId>
<groupId>com.alibaba.nacos</groupId>
<version>1.1.3</version>
<version>1.1.4</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<parent>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-all</artifactId>
<version>1.1.3</version>
<version>1.1.4</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<parent>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-all</artifactId>
<version>1.1.3</version>
<version>1.1.4</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion cmdb/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<parent>
<artifactId>nacos-all</artifactId>
<groupId>com.alibaba.nacos</groupId>
<version>1.1.3</version>
<version>1.1.4</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<parent>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-all</artifactId>
<version>1.1.3</version>
<version>1.1.4</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion config/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<parent>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-all</artifactId>
<version>1.1.3</version>
<version>1.1.4</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion console/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<parent>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-all</artifactId>
<version>1.1.3</version>
<version>1.1.4</version>
</parent>
<artifactId>nacos-console</artifactId>
<!--<packaging>war</packaging>-->
Expand Down
2 changes: 1 addition & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<parent>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-all</artifactId>
<version>1.1.3</version>
<version>1.1.4</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
1 change: 1 addition & 0 deletions distribution/bin/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ else
JAVA_OPT="${JAVA_OPT} -Xloggc:${BASE_DIR}/logs/nacos_gc.log -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M"
fi

JAVA_OPT="${JAVA_OPT} -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000"
JAVA_OPT="${JAVA_OPT} -Dnacos.home=${BASE_DIR}"
JAVA_OPT="${JAVA_OPT} -Dloader.path=${BASE_DIR}/plugins/health -jar ${BASE_DIR}/target/${SERVER}.jar"
JAVA_OPT="${JAVA_OPT} ${JAVA_OPT_EXT}"
Expand Down
2 changes: 2 additions & 0 deletions distribution/conf/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,5 @@ nacos.security.ignore.urls=/,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/
# nacos.naming.distro.syncRetryDelay=5000
# nacos.naming.data.warmup=true
# nacos.naming.expireInstance=true

nacos.istio.mcp.server.enabled=false
2 changes: 1 addition & 1 deletion distribution/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<parent>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-all</artifactId>
<version>1.1.3</version>
<version>1.1.4</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion example/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<parent>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-all</artifactId>
<version>1.1.3</version>
<version>1.1.4</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion istio/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<parent>
<artifactId>nacos-all</artifactId>
<groupId>com.alibaba.nacos</groupId>
<version>1.1.3</version>
<version>1.1.4</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;

import javax.annotation.PostConstruct;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
Expand Down Expand Up @@ -64,7 +65,8 @@ public class NacosMcpService extends ResourceSourceGrpc.ResourceSourceImplBase {
@Autowired
private IstioConfig istioConfig;

public NacosMcpService() {
@PostConstruct
public void init() {
if (!istioConfig.isMcpServerEnabled()) {
return;
}
Expand Down
2 changes: 1 addition & 1 deletion naming/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<parent>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-all</artifactId>
<version>1.1.3</version>
<version>1.1.4</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import com.alibaba.nacos.naming.misc.UtilsAndCommons;
import com.alibaba.nacos.naming.push.ClientInfo;
import com.alibaba.nacos.naming.web.CanDistro;
import com.alibaba.nacos.naming.web.OverrideParameterRequestWrapper;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.codehaus.jackson.util.VersionUtil;
Expand Down Expand Up @@ -141,13 +142,10 @@ public JSONObject srvIPXT(HttpServletRequest request) throws Exception {

@CanDistro
@RequestMapping("/clientBeat")
public JSONObject clientBeat(HttpServletRequest request,
@RequestParam(defaultValue = Constants.DEFAULT_NAMESPACE_ID) String namespaceId,
@RequestParam String beat,
@RequestParam String dom) throws Exception {

String serviceName = Constants.DEFAULT_GROUP + Constants.SERVICE_INFO_SPLITER + dom;

return beat(namespaceId, beat, serviceName);
public JSONObject clientBeat(HttpServletRequest request) throws Exception {
OverrideParameterRequestWrapper requestWrapper = OverrideParameterRequestWrapper.buildRequest(request);
requestWrapper.addParameter(CommonParams.SERVICE_NAME,
Constants.DEFAULT_GROUP + Constants.SERVICE_INFO_SPLITER + WebUtils.required(request, "dom"));
return beat(requestWrapper);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.nacos.api.common.Constants;
import com.alibaba.nacos.api.exception.NacosException;
import com.alibaba.nacos.api.naming.CommonParams;
import com.alibaba.nacos.api.naming.pojo.AbstractHealthChecker;
import com.alibaba.nacos.core.utils.WebUtils;
import com.alibaba.nacos.naming.core.Cluster;
import com.alibaba.nacos.naming.core.Service;
import com.alibaba.nacos.naming.core.ServiceManager;
import com.alibaba.nacos.api.exception.NacosException;
import com.alibaba.nacos.naming.healthcheck.HealthCheckType;
import com.alibaba.nacos.naming.misc.Loggers;
import com.alibaba.nacos.naming.misc.UtilsAndCommons;
Expand All @@ -32,9 +34,10 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
* @author nkorange
*/
Expand All @@ -46,13 +49,16 @@ public class ClusterController {
protected ServiceManager serviceManager;

@PutMapping
public String update( @RequestParam(defaultValue = Constants.DEFAULT_NAMESPACE_ID) String namespaceId,
@RequestParam String clusterName,
@RequestParam String serviceName,
@RequestParam String healthChecker,
@RequestParam(defaultValue = StringUtils.EMPTY) String metadata,
@RequestParam String checkPort,
@RequestParam String useInstancePort4Check) throws Exception {
public String update(HttpServletRequest request) throws Exception {

String namespaceId = WebUtils.optional(request, CommonParams.NAMESPACE_ID,
Constants.DEFAULT_NAMESPACE_ID);
String clusterName = WebUtils.required(request, CommonParams.CLUSTER_NAME);
String serviceName = WebUtils.required(request, CommonParams.SERVICE_NAME);
String healthChecker = WebUtils.required(request, "healthChecker");
String metadata = WebUtils.optional(request, "metadata", StringUtils.EMPTY);
String checkPort = WebUtils.required(request, "checkPort");
String useInstancePort4Check = WebUtils.required(request, "useInstancePort4Check");

Service service = serviceManager.getService(namespaceId, serviceName);
if (service == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@

import com.alibaba.fastjson.JSONObject;
import com.alibaba.nacos.api.common.Constants;
import com.alibaba.nacos.api.naming.CommonParams;
import com.alibaba.nacos.api.naming.pojo.AbstractHealthChecker;
import com.alibaba.nacos.core.utils.WebUtils;
import com.alibaba.nacos.naming.boot.RunningConfig;
import com.alibaba.nacos.naming.core.Instance;
import com.alibaba.nacos.naming.core.Service;
Expand All @@ -34,6 +36,7 @@
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -66,23 +69,29 @@ public JSONObject server() {

@CanDistro
@PutMapping(value = {"", "/instance"})
public String update(@RequestParam(defaultValue = Constants.DEFAULT_NAMESPACE_ID) String namespaceId,
@RequestParam String serviceName,
@RequestParam(defaultValue = UtilsAndCommons.DEFAULT_CLUSTER_NAME) String clusterName,
@RequestParam String ip,
@RequestParam int port,
@RequestParam(name = "healthy", defaultValue = StringUtils.EMPTY) String healthyString,
@RequestParam(defaultValue = StringUtils.EMPTY) String validString) {
public String update(HttpServletRequest request) {

String namespaceId = WebUtils.optional(request, CommonParams.NAMESPACE_ID,
Constants.DEFAULT_NAMESPACE_ID);
String serviceName = WebUtils.required(request, CommonParams.SERVICE_NAME);
String clusterName = WebUtils.optional(request, CommonParams.CLUSTER_NAME
, UtilsAndCommons.DEFAULT_CLUSTER_NAME);

String ip = WebUtils.required(request, "ip");
int port = Integer.parseInt(WebUtils.required(request, "port"));

boolean valid = false;

String healthyString = WebUtils.optional(request, "healthy", StringUtils.EMPTY);
if (StringUtils.isBlank(healthyString)) {
healthyString = validString;
healthyString = WebUtils.optional(request, "valid", StringUtils.EMPTY);
}

if (StringUtils.isBlank(healthyString)) {
throw new IllegalArgumentException("Param 'healthy' is required.");
}

boolean valid = BooleanUtils.toBoolean(healthyString);
valid = BooleanUtils.toBoolean(healthyString);

Service service = serviceManager.getService(namespaceId, serviceName);
// Only health check "none" need update health status with api
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,14 +207,15 @@ public JSONObject detail(HttpServletRequest request) throws Exception {

@CanDistro
@PutMapping("/beat")
public JSONObject beat(@RequestParam(defaultValue = Constants.DEFAULT_NAMESPACE_ID) String namespaceId,
@RequestParam String beat,
@RequestParam String serviceName) throws Exception {
public JSONObject beat(HttpServletRequest request) throws Exception {

JSONObject result = new JSONObject();

result.put("clientBeatInterval", switchDomain.getClientBeatInterval());

String serviceName = WebUtils.required(request, CommonParams.SERVICE_NAME);
String namespaceId = WebUtils.optional(request, CommonParams.NAMESPACE_ID,
Constants.DEFAULT_NAMESPACE_ID);
String beat = WebUtils.required(request, "beat");
RsInfo clientBeat = JSON.parseObject(beat, RsInfo.class);

if (!switchDomain.isDefaultInstanceEphemeral() && !clientBeat.isEphemeral()) {
Expand Down Expand Up @@ -445,7 +446,7 @@ public JSONObject doSrvIPXT(String namespaceId, String serviceName, String agent

double threshold = service.getProtectThreshold();

if ((float)ipMap.get(Boolean.TRUE).size() / srvedIPs.size() <= threshold) {
if ((float) ipMap.get(Boolean.TRUE).size() / srvedIPs.size() <= threshold) {

Loggers.SRV_LOG.warn("protect threshold reached, return all ips, service: {}", serviceName);
if (isCheck) {
Expand Down
Loading

0 comments on commit 4d68565

Please sign in to comment.