Merge remote-tracking branch 'nacos/develop'

# Conflicts:
#	console/src/main/resources/static/index.js
#	console/src/main/resources/static/src/pages/ConfigurationManagement/ListeningToQuery/ListeningToQuery.js
This commit is contained in:
water.lyl 2018-11-06 21:41:40 +08:00
commit 233272a118
28 changed files with 121 additions and 96 deletions

View File

@ -1,12 +1,16 @@
## Nacos
<img src="doc/Nacos_Logo.png" width="50%" height="50%" />
# Nacos: Dynamic *Na*ming and *Co*nfiguration *S*ervice
[![Gitter](https://badges.gitter.im/alibaba/nacos.svg)](https://gitter.im/alibaba/nacos?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) [![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html)
[![Gitter](https://travis-ci.org/alibaba/nacos.svg?branch=master)](https://travis-ci.org/alibaba/nacos)
-------
<img src="doc/Nacos_Logo.png" width="50%" height="50%" />
Nacos is an easy-to-use platform designed for dynamic service discovery and configuration and service management. It helps you to build cloud native applications and microservices platform easily.
## What does it do
Nacos (official site: [http://nacos.io](http://nacos.io)) is an easy-to-use platform designed for dynamic service discovery and configuration and service management. It helps you to build cloud native applications and microservices platform easily.
Service is a first-class citizen in Nacos. Nacos supports almost all type of servicesfor example[Dubbo/gRPC service](https://nacos.io/en-us/docs/use-nacos-with-dubbo.html)、[Spring Cloud RESTFul service](https://nacos.io/en-us/docs/use-nacos-with-springcloud.html) or [Kubernetes service](https://nacos.io/en-us/docs/use-nacos-with-kubernetes.html).
@ -29,52 +33,52 @@ Nacos provides four major functions.
Nacos provides an easy-to-use service dashboard to help you manage your services metadata, configuration, kubernetes DNS, service health and metrics statistics.
### Quick Start
## Quick Start
It is super easy to get started with your first project.
1. #### Download run package
[Download](https://github.com/alibaba/nacos/releases/download/0.2.1/nacos-server-0.2.1.zip)
#### Step 1: Download the binary package
You can download the package from the [latest stable release](https://github.com/alibaba/nacos/releases).
Take release nacos-server-0.3.0.zip for example.
```
unzip nacos-server-0.2.1.zip
unzip nacos-server-0.3.0.zip
cd nacos/bin
```
2. #### Start Server
* ##### Linux/Unix/Mac
#### Step 2: Start Server
On the **Linux/Unix/Mac** platform, run the following command to start server with standalone mode:
```
Run the following command to start (standalone means non-cluster mode):
sh startup.sh -m standalone
```
* ##### Windows
On the **Windows** platform, run the following command to start server with standalone mode. Alternatively, you can also double-click the startup.cmd to run NacosServer.
```
Run the following command to start:
cmd startup.cmd
Or double-click the startup.cmd to run NacosServer.
cmd startup.cmd -m standalone
```
For more details, see [quick-start.](https://nacos.io/en-us/docs/quick-start.html)
3. #### Quick start for other open-source projects:
## Quick start for other open-source projects:
* [Quick start with Nacos command and console](https://nacos.io/en-us/docs/quick-start.html)
* [quick start with spring cloud](https://nacos.io/en-us/docs/use-nacos-with-springcloud.html)
* [Quick start with dubbo](https://nacos.io/en-us/docs/use-nacos-with-dubbo.html)
* [quick start with dubbo](https://nacos.io/en-us/docs/use-nacos-with-dubbo.html)
* [quick start with spring cloud](https://nacos.io/en-us/docs/quick-start-spring-cloud.html)
* [quick start with kubernetes](https://nacos.io/en-us/docs/use-nacos-with-kubernetes.html)
* [Quick start with kubernetes](https://nacos.io/en-us/docs/use-nacos-with-kubernetes.html)
* [more...](https://nacos.io/)
### Documentation
## Documentation
You can view full documentation on the Nacos website:
You can view the full documentation from the [Nacos website](https://nacos.io/en-us/docs/what-is-nacos.html).
* [nacos.io](https://nacos.io/en-us/docs/what-is-nacos.html)
## Other Related Project Repositories
* [nacos-spring-project](https://github.com/nacos-group/nacos-spring-project) provides the integration functionality for Spring.
* [nacos-sync](https://github.com/nacos-group/nacos-sync) is a tool to synchronize the service registration information from other tools like eureka, zookeeper, etc, to Nacos.
* [spring-cloud-alibaba](https://github.com/spring-cloud-incubator/spring-cloud-alibaba) provides the one-stop solution for application development over Alibaba middleware which includes Nacos.
### Contact

View File

@ -16,7 +16,7 @@
<parent>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-all</artifactId>
<version>0.3.0</version>
<version>0.4.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -16,7 +16,7 @@
<parent>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-all</artifactId>
<version>0.3.0</version>
<version>0.4.0</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@ -18,7 +18,7 @@
<parent>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-all</artifactId>
<version>0.3.0</version>
<version>0.4.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -17,7 +17,7 @@
<parent>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-all</artifactId>
<version>0.3.0</version>
<version>0.4.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -32,7 +32,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletResponse;
/**
* capcity manage
* Capacity Management
*
* @author hexu.hxy
*/
@ -42,8 +42,10 @@ public class CapacityController {
private static final Logger LOGGER = LoggerFactory.getLogger(CapacityController.class);
private final CapacityService capacityService;
@Autowired
private CapacityService capacityService;
public CapacityController(CapacityService capacityService) {this.capacityService = capacityService;}
@ResponseBody
@RequestMapping(method = RequestMethod.GET)

View File

@ -29,10 +29,8 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
@ -45,15 +43,19 @@ import java.io.IOException;
@RequestMapping(Constants.COMMUNICATION_CONTROLLER_PATH)
public class CommunicationController {
@Autowired
private DumpService dumpService;
private final DumpService dumpService;
@Autowired
protected LongPollingService longPollingService;
private final LongPollingService longPollingService;
private String trueStr = "true";
/**
@Autowired
public CommunicationController(DumpService dumpService, LongPollingService longPollingService) {
this.dumpService = dumpService;
this.longPollingService = longPollingService;
}
/**
* 通知配置信息改变
*
*/
@ -87,11 +89,9 @@ public class CommunicationController {
@RequestParam("dataId") String dataId,
@RequestParam("group") String group,
@RequestParam(value = "tenant", required = false) String tenant,
ModelMap modelMap)
throws IOException, ServletException, Exception {
ModelMap modelMap) {
group = StringUtils.isBlank(group) ? Constants.DEFAULT_GROUP : group;
SampleResult sampleResult = longPollingService.getCollectSubscribleInfo(dataId, group, tenant);
return sampleResult;
return longPollingService.getCollectSubscribleInfo(dataId, group, tenant);
}
/**
@ -100,11 +100,7 @@ public class CommunicationController {
@RequestMapping(value= "/watcherConfigs", method = RequestMethod.GET)
@ResponseBody
public SampleResult getSubClientConfigByIp(HttpServletRequest request,
HttpServletResponse response,
@RequestParam("ip") String ip,
ModelMap modelMap)
throws IOException, ServletException, Exception {
SampleResult sampleResult = longPollingService.getCollectSubscribleInfoByIp(ip);
return sampleResult;
HttpServletResponse response, @RequestParam("ip") String ip,ModelMap modelMap) {
return longPollingService.getCollectSubscribleInfoByIp(ip);
}
}

View File

@ -23,7 +23,6 @@ import com.alibaba.nacos.config.server.service.AggrWhitelist;
import com.alibaba.nacos.config.server.service.ConfigDataChangeEvent;
import com.alibaba.nacos.config.server.service.ConfigSubService;
import com.alibaba.nacos.config.server.service.PersistService;
import com.alibaba.nacos.config.server.service.merge.MergeDatumService;
import com.alibaba.nacos.config.server.service.trace.ConfigTraceService;
import com.alibaba.nacos.config.server.utils.*;
import com.alibaba.nacos.config.server.utils.event.EventDispatcher;
@ -61,17 +60,13 @@ public class ConfigController {
private final transient ConfigServletInner inner;
private final transient PersistService persistService;
private final transient MergeDatumService mergeService;
private final transient ConfigSubService configSubService;
@Autowired
public ConfigController(ConfigServletInner configServletInner, PersistService persistService, MergeDatumService mergeService,
ConfigSubService configSubService) {
public ConfigController(ConfigServletInner configServletInner, PersistService persistService, ConfigSubService configSubService) {
this.inner = configServletInner;
this.persistService = persistService;
this.mergeService = mergeService;
this.configSubService = configSubService;
}

View File

@ -322,9 +322,7 @@ public class ConfigServletInner {
private static boolean isUseTag(CacheItem cacheItem, String tag) {
if (cacheItem != null && cacheItem.tagMd5 != null && cacheItem.tagMd5.size() > 0) {
if (StringUtils.isNotBlank(tag) && cacheItem.tagMd5.containsKey(tag)) {
return true;
}
return StringUtils.isNotBlank(tag) && cacheItem.tagMd5.containsKey(tag);
}
return false;
}

View File

@ -38,13 +38,15 @@ import javax.annotation.PostConstruct;
@RequestMapping(Constants.HEALTH_CONTROLLER_PATH)
public class HealthController {
@Autowired
private DynamicDataSource dynamicDataSource;
private final DynamicDataSource dynamicDataSource;
private DataSourceService dataSourceService;
private String heathUpStr = "UP";
private String heathDownStr = "DOWN";
private String heathWarnStr = "WARN";
@Autowired
public HealthController(DynamicDataSource dynamicDataSource) {this.dynamicDataSource = dynamicDataSource;}
@PostConstruct
public void init() {
dataSourceService = dynamicDataSource.getDataSource();
@ -63,7 +65,7 @@ public class HealthController {
sb.append("从数据库 ").append(dbStatus.split(":")[1]).append(" down. ");
} else {
sb.append("DOWN:");
if (dbStatus.indexOf(heathDownStr) != -1) {
if (dbStatus.contains(heathDownStr)) {
sb.append("主数据库 ").append(dbStatus.split(":")[1]).append(" down. ");
}
if (!ServerListService.isAddressServerHealth()) {

View File

@ -57,8 +57,7 @@ public class HistoryController {
pageSize = null == pageSize ? Integer.valueOf(100) : pageSize;
pageSize = pageSize > 500 ? Integer.valueOf(500) : pageSize;
// configInfoBase没有appName字段
Page<ConfigHistoryInfo> page = persistService.findConfigHistory(dataId, group, tenant, pageNo, pageSize);
return page;
return persistService.findConfigHistory(dataId, group, tenant, pageNo, pageSize);
}
/**
@ -68,8 +67,7 @@ public class HistoryController {
@ResponseBody
public ConfigHistoryInfo getConfigHistoryInfo(HttpServletRequest request, HttpServletResponse response,
@RequestParam("nid") Long nid, ModelMap modelMap) {
ConfigHistoryInfo configInfo = persistService.detailConfigHistory(nid);
return configInfo;
return persistService.detailConfigHistory(nid);
}
}

View File

@ -29,10 +29,8 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
@ -46,9 +44,11 @@ import java.util.Map;
@RequestMapping(Constants.LISTENER_CONTROLLER_PATH)
public class ListenerController {
private final ConfigSubService configSubService;
@Autowired
ConfigSubService configSubService;
public ListenerController(ConfigSubService configSubService) {this.configSubService = configSubService;}
/*
* 获取客户端订阅配置信息
*/
@ -57,8 +57,7 @@ public class ListenerController {
public GroupkeyListenserStatus getAllSubClientConfigByIp(HttpServletRequest request, HttpServletResponse response,
@RequestParam("ip") String ip, @RequestParam(value = "all", required = false) boolean all,
@RequestParam(value = "tenant", required = false) String tenant,
@RequestParam(value = "sampleTime", required = false, defaultValue = "1") int sampleTime, ModelMap modelMap)
throws IOException, ServletException, Exception {
@RequestParam(value = "sampleTime", required = false, defaultValue = "1") int sampleTime, ModelMap modelMap) throws Exception {
SampleResult collectSampleResult = configSubService.getCollectSampleResultByIp(ip, sampleTime);
GroupkeyListenserStatus gls = new GroupkeyListenserStatus();
gls.setCollectStatus(200);

View File

@ -40,11 +40,15 @@ public class OpsController {
private static final Logger log = LoggerFactory.getLogger(OpsController.class);
@Autowired
protected PersistService persistService;
protected final PersistService persistService;
private final DumpService dumpService;
@Autowired
DumpService dumpService;
public OpsController(PersistService persistService, DumpService dumpService) {
this.persistService = persistService;
this.dumpService = dumpService;
}
// ops call
@RequestMapping(value = "/localCache", method = RequestMethod.POST)

View File

@ -18,7 +18,7 @@
<parent>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-all</artifactId>
<version>0.3.0</version>
<version>0.4.0</version>
</parent>
<artifactId>nacos-console</artifactId>
<!--<packaging>war</packaging>-->

View File

@ -1,3 +0,0 @@
#!/bin/bash
npm run build
cp ./build/* ./

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -12,7 +12,7 @@
*/
module.exports = {
"zh-cn": {
"com.alibaba.nacos.layout.noenv.nacosversion": "0.3.0",
"com.alibaba.nacos.layout.noenv.nacosversion": "0.4.0",
"com.alibaba.nacos.page.configurationManagementVirtual": "配置管理",
"com.alibaba.nacos.page.serviceManagementVirtual": "服务管理",
"nacos.component.ExportDialog.tags2": "标签:",
@ -529,7 +529,7 @@ module.exports = {
"nacos.page.ConfigEditor.submit_failed": "不能为空, 提交失败",
},
"en-us": {
"com.alibaba.nacos.layout.noenv.nacosversion": "1.0",
"com.alibaba.nacos.layout.noenv.nacosversion": "0.4.0",
"com.alibaba.nacos.page.configurationManagementVirtual": "ConfigManagement",
"com.alibaba.nacos.page.serviceManagementVirtual": "ServiceManagement",
"nacos.component.CloneDialog.the_same_configuration": "Conflict:",

View File

@ -65,12 +65,10 @@ class ListeningToQuery extends React.Component {
if (type === 1) {
var ip = this.getValue('ip');
queryUrl = `/nacos/v1/cs/listener?ip=${ip}`;
let tenant = window.nownamespace || getParams('namespace') || '';
if (tenant) {
queryUrl += '&tenant=' + tenant;
}
} else {
var dataId = this.getValue('dataId');
var group = this.getValue('group');

View File

@ -88,7 +88,7 @@ class ServiceList extends React.Component {
Message.error(res)
return
}
this.props.queryServiceList()
this.queryServiceList()
},
error: res => Message.error(res.responseText || res.statusText),
complete: () => this.closeLoading()

View File

@ -18,7 +18,7 @@
<parent>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-all</artifactId>
<version>0.3.0</version>
<version>0.4.0</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@ -1,12 +1,12 @@
,--.
,--.'|
,--,: : |
,`--.'`| ' : ,---.
| : : | | ' ,'\ .--.--.
,--,: : | Version: 0.4.0
,`--.'`| ' : ,---. Port: 8848
| : : | | ' ,'\ .--.--. Console: http://localhost:8848/nacos/index.html
: | \ | : ,--.--. ,---. / / | / / '
| : ' '; | / \ / \. ; ,. :| : /`./
' ' ;. ;.--. .-. | / / '' | |: :| : ;_
' ' ;. ;.--. .-. | / / '' | |: :| : ;_ https://nacos.io
| | | \ | \__\/: . .. ' / ' | .; : \ \ `.
' : | ; .' ," .--.; |' ; :__| : | `----. \
| | '`--' / / ,. |' | '.'|\ \ / / /`--' /

View File

@ -1,6 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true" scanPeriod="10 seconds">
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<Pattern>%date %level %msg%n%n</Pattern>
<charset>utf8</charset>
</encoder>
</appender>
<appender name="naming-server"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${nacos.home}/logs/naming-server.log</file>
@ -517,6 +524,31 @@
<appender-ref ref="startLog" />
</logger>
<logger name="org.springframework">
<appender-ref ref="CONSOLE"/>
<level value="INFO"/>
</logger>
<logger name="org.apache.catalina.startup.DigesterFactory">
<appender-ref ref="CONSOLE"/>
<level value="INFO"/>
</logger>
<logger name="org.apache.catalina.util.LifecycleBase">
<appender-ref ref="CONSOLE"/>
<level value="ERROR"/>
</logger>
<logger name="org.apache.coyote.http11.Http11NioProtocol">
<appender-ref ref="CONSOLE"/>
<level value="WARN"/>
</logger>
<logger name="org.apache.tomcat.util.net.NioSelectorPool">
<appender-ref ref="CONSOLE"/>
<level value="WARN"/>
</logger>
<root>
<level value="INFO"/>
<appender-ref ref="rootFile"/>

View File

@ -18,7 +18,7 @@
<parent>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-all</artifactId>
<version>0.3.0</version>
<version>0.4.0</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@ -18,7 +18,7 @@
<parent>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-all</artifactId>
<version>0.3.0</version>
<version>0.4.0</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@ -18,7 +18,7 @@
<parent>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-all</artifactId>
<version>0.3.0</version>
<version>0.4.0</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@ -21,7 +21,7 @@
<inceptionYear>2018</inceptionYear>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-all</artifactId>
<version>0.3.0</version>
<version>0.4.0</version>
<packaging>pom</packaging>
<name>Alibaba NACOS ${project.version}</name>
@ -36,7 +36,7 @@
<url>git@github.com:alibaba/nacos.git</url>
<connection>scm:git@github.com:alibaba/nacos.git</connection>
<developerConnection>scm:git@github.com:alibaba/nacos.git</developerConnection>
<tag>nacos-all-0.3.0</tag>
<tag>nacos-all-0.4.0</tag>
</scm>
<mailingLists>

View File

@ -17,7 +17,7 @@
<parent>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-all</artifactId>
<version>0.3.0</version>
<version>0.4.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>