提交 b7293702 编写于 作者: wu-sheng's avatar wu-sheng

Provide some documents in cn, and change nodeHanlder -> nodeProcessor

上级 abc141f0
......@@ -36,9 +36,9 @@ public final class Graph<INPUT> {
startNode.execute(INPUT);
}
public <OUTPUT> Node<INPUT, OUTPUT> addNode(NodeHandler<INPUT, OUTPUT> nodeHandler) {
public <OUTPUT> Node<INPUT, OUTPUT> addNode(NodeProcessor<INPUT, OUTPUT> nodeProcessor) {
synchronized (this) {
startNode = new Node(this, nodeHandler);
startNode = new Node(this, nodeProcessor);
return startNode;
}
}
......
......@@ -24,31 +24,31 @@ package org.skywalking.apm.collector.core.graph;
* @author peng-yongsheng, wu-sheng
*/
public final class Node<INPUT, OUTPUT> {
private final NodeHandler nodeHandler;
private final NodeProcessor nodeProcessor;
private final Next<OUTPUT> next;
private final Graph graph;
Node(Graph graph, NodeHandler<INPUT, OUTPUT> nodeHandler) {
Node(Graph graph, NodeProcessor<INPUT, OUTPUT> nodeProcessor) {
this.graph = graph;
this.nodeHandler = nodeHandler;
this.nodeProcessor = nodeProcessor;
this.next = new Next<>();
this.graph.checkForNewNode(this);
}
public final <NEXTOUTPUT> Node<OUTPUT, NEXTOUTPUT> addNext(NodeHandler<OUTPUT, NEXTOUTPUT> nodeHandler) {
public final <NEXTOUTPUT> Node<OUTPUT, NEXTOUTPUT> addNext(NodeProcessor<OUTPUT, NEXTOUTPUT> nodeProcessor) {
synchronized (graph) {
Node<OUTPUT, NEXTOUTPUT> node = new Node<>(graph, nodeHandler);
Node<OUTPUT, NEXTOUTPUT> node = new Node<>(graph, nodeProcessor);
next.addNext(node);
return node;
}
}
final void execute(INPUT INPUT) {
nodeHandler.process(INPUT, next);
nodeProcessor.process(INPUT, next);
}
NodeHandler getHandler() {
return nodeHandler;
NodeProcessor getHandler() {
return nodeProcessor;
}
Next<OUTPUT> getNext() {
......
......@@ -21,7 +21,7 @@ package org.skywalking.apm.collector.core.graph;
/**
* @author peng-yongsheng, wu-sheng
*/
public interface NodeHandler<INPUT, OUTPUT> {
public interface NodeProcessor<INPUT, OUTPUT> {
/**
* The unique id in the certain graph.
*
......
......@@ -49,8 +49,8 @@ public class GraphManagerTest {
@Test
public void testGraph() {
Graph<String> testGraph = GraphManager.INSTANCE.createIfAbsent(1, String.class);
Node<String, String> node = testGraph.addNode(new Node1Handler());
Node<String, Integer> node1 = node.addNext(new Node2Handler());
Node<String, String> node = testGraph.addNode(new Node1Processor());
Node<String, Integer> node1 = node.addNext(new Node2Processor());
testGraph.start("Input String");
String output = outputStream.toString();
......@@ -63,7 +63,7 @@ public class GraphManagerTest {
@Test
public void testGraphWithChainStyle() {
Graph<String> graph = GraphManager.INSTANCE.createIfAbsent(2, String.class);
graph.addNode(new Node1Handler()).addNext(new Node2Handler()).addNext(new Node4Handler());
graph.addNode(new Node1Processor()).addNext(new Node2Processor()).addNext(new Node4Processor());
graph.start("Input String");
......@@ -78,14 +78,14 @@ public class GraphManagerTest {
@Test(expected = PotentialAcyclicGraphException.class)
public void testPotentialAcyclicGraph() {
Graph<String> testGraph = GraphManager.INSTANCE.createIfAbsent(3, String.class);
Node<String, String> node = testGraph.addNode(new Node1Handler());
node.addNext(new Node1Handler());
Node<String, String> node = testGraph.addNode(new Node1Processor());
node.addNext(new Node1Processor());
}
@Test
public void testContinueStream() {
Graph<String> graph = GraphManager.INSTANCE.createIfAbsent(4, String.class);
graph.addNode(new Node1Handler()).addNext(new Node2Handler()).addNext(new Node4Handler());
graph.addNode(new Node1Processor()).addNext(new Node2Processor()).addNext(new Node4Processor());
Next next = GraphManager.INSTANCE.findGraph(4).findNext(2);
......@@ -100,7 +100,7 @@ public class GraphManagerTest {
@Test(expected = NodeNotFoundException.class)
public void handlerNotFound() {
Graph<String> graph = GraphManager.INSTANCE.createIfAbsent(5, String.class);
graph.addNode(new Node1Handler()).addNext(new Node2Handler()).addNext(new Node4Handler());
graph.addNode(new Node1Processor()).addNext(new Node2Processor()).addNext(new Node4Processor());
Next next = GraphManager.INSTANCE.findGraph(5).findNext(3);
}
......
......@@ -21,7 +21,7 @@ package org.skywalking.apm.collector.core.graph;
/**
* @author wusheng
*/
public class Node1Handler implements NodeHandler<String, String> {
public class Node1Processor implements NodeProcessor<String, String> {
@Override public int id() {
return 1;
}
......
......@@ -21,7 +21,7 @@ package org.skywalking.apm.collector.core.graph;
/**
* @author wusheng
*/
public class Node2Handler implements NodeHandler<String, Integer> {
public class Node2Processor implements NodeProcessor<String, Integer> {
@Override public int id() {
return 2;
}
......
......@@ -21,7 +21,7 @@ package org.skywalking.apm.collector.core.graph;
/**
* @author wusheng
*/
public class Node3Handler implements NodeHandler<Long, Long> {
public class Node3Processor implements NodeProcessor<Long, Long> {
@Override public int id() {
return 3;
}
......
......@@ -21,7 +21,7 @@ package org.skywalking.apm.collector.core.graph;
/**
* @author wusheng
*/
public class Node4Handler implements NodeHandler<Integer, Long> {
public class Node4Processor implements NodeProcessor<Integer, Long> {
@Override public int id() {
return 4;
}
......
......@@ -7,7 +7,7 @@
* [Deploy Cluster mode collector](en/Deploy-collector-in-cluster-mode.md)
* [Deploy javaagent](en/Deploy-skywalking-agent.md)
* [Deploy docker image](en/Deploy-docker-image.md)
* [Supported middlewares, frameworks and libraries](en/Supported-list.md)
* [Supported middlewares, frameworks and libraries](Supported-list.md)
* [How to disable plugins?](en/How-to-disable-plugin.md)
* Application Toolkit
* [Overview](en/Applicaton-toolkit.md)
......
## 中文文档
* [项目简介](cn/sky-walking-documents-zh-contents.md)
[![EN doc](https://img.shields.io/badge/document-English-blue.svg)](README.md)
* [项目简介](/README_ZH.md)
* [快速入门](cn/Quick-start-chn.md)
* [部署单机collector](cn/3.2.3-%E5%8D%95%E6%9C%BA%E6%A8%A1%E5%BC%8F%E9%83%A8%E7%BD%B2Collector.md)
* [部署集群collector](cn/3.2.3-%E9%9B%86%E7%BE%A4%E6%A8%A1%E5%BC%8F%E9%83%A8%E7%BD%B2Collector.md)
* [部署探针Agent](cn/3.2.3-部署探针Agent.md)
* [部署Collector镜像](cn/3.2-部署Collector镜像.md)
* [中间件,框架与类库支持列表](cn/3.2.3-supported-list.md)
* [如何关闭特定插件](cn/3.2.2-Plugin-list-and-how-to-disable-plugin-zh.md)
* [部署单机collector](cn/Deploy-collector-in-standalone-mode-CN.md)
* [部署集群collector](cn/Deploy-collector-in-cluster-mode-CN.md)
* [部署探针Agent](cn/Deploy-skywalking-agent-CN.md)
* [部署Collector镜像](cn/Deploy-docker-image.CN.md)
* [中间件,框架与类库支持列表](Supported-list.md)
* [如何关闭特定插件](cn/How-to-disable-plugin-CN.md)
* APM相关介绍资料
* [APM简介(百度百科)](http://baike.baidu.com/link?url=HizLjnUrwvXqPQ4fZH_MA81MA7R_sE-kpdEIfuUHf-yNHhPiEkA97_7FshVR6raiZL6pvbChTZSIgrC1lY6lhq.md)
* [OpenTracing中文版](https://github.com/opentracing-contrib/opentracing-specification-zh.md)
......
## 所需的第三方软件
- 被监控程序要求JDK6+
- sky-walking server和webui要求JDK8+
- Elasticsearch 5.3
- Zookeeper 3.4.10
## 下载发布版本
- 前向[发布页面](https://github.com/OpenSkywalking/skywalking/releases)
## 部署Elasticsearch
- 修改`elasticsearch.yml`文件
- 设置 `cluster.name: CollectorDBCluster`。此名称需要和collector配置文件一致。
- 设置 `node.name: anyname`, 可以设置为任意名字,如Elasticsearch为集群模式,则每个节点名称需要不同。
- 增加如下配置
```
# ES监听的ip地址
network.host: 0.0.0.0
thread_pool.bulk.queue_size: 1000
```
- 启动Elasticsearch
### 部署collector
1. 解压安装包`tar -xvf skywalking-collector.tar.gz`,windows用户可以选择zip包
1. 运行`bin/startup.sh`启动。windows用户为.bat文件。
- `config/application.yml`
```
cluster:
# Zookeeper地址配置
zookeeper:
hostPort: localhost:2181
sessionTimeout: 100000
# agent_server, agent_stream, ui, collector_inside中配置的IP都是Collector所使用的IP地址
agent_server:
jetty:
host: localhost
# The port used
port: 10800
context_path: /
agent_stream:
grpc:
host: localhost
port: 11800
jetty:
host: localhost
port: 12800
context_path: /
ui:
jetty:
host: localhost
port: 12800
context_path: /
collector_inside:
grpc:
host: localhost
port: 11800
storage:
elasticsearch:
cluster_name: CollectorDBCluster
cluster_transport_sniffer: true
# Elastic Search地址信息
cluster_nodes: localhost:9300
index_shards_number: 2
index_replicas_number: 0
```
## Collector集群模式启动
集群模式主要依赖Zookeeper的注册和应用发现能力。所以,你只需要调整 `config/application.yml`中,agent_server, agent_stream, ui, collector_inside这些配置项的ip信息,使用真实的IP地址或者hostname,Collector就会使用集群模式运行。
其次,将elasticsearch的注释取消,并修改集群的节点地址信息。
## 用途说明
单机模式使用本地H2数据库,不支持集群部署。主要用于:预览、功能测试、演示和低压力系统。
## 所需的第三方软件
- JDK8+
## 下载发布版本
- 前向[发布页面](https://github.com/OpenSkywalking/skywalking/releases)
## Quick Start
Collector单机模拟启动简单,提供和集群模式相同的功能,单机模式下除端口被占用的情况下,直接启动即可。
### 部署collector
1. 解压安装包`tar -xvf skywalking-collector.tar.gz`,windows用户可以选择zip包
1. 运行`bin/startup.sh`启动。windows用户为.bat文件。
- `config/application.yml`
```
# 单机模式下无需配置集群相关信息
#cluster:
# zookeeper:
# hostPort: localhost:2181
# sessionTimeout: 100000
# agent_server, agent_stream, ui, collector_inside中配置的IP都是Collector所使用的IP地址
agent_server:
jetty:
host: localhost
# The port used
port: 10800
context_path: /
agent_stream:
grpc:
host: localhost
port: 11800
jetty:
host: localhost
port: 12800
context_path: /
ui:
jetty:
host: localhost
port: 12800
context_path: /
collector_inside:
grpc:
host: localhost
port: 11800
#storage:
# elasticsearch:
# cluster_name: CollectorDBCluster
# cluster_transport_sniffer: true
# Elastic Search地址信息
# cluster_nodes: localhost:9300
# index_shards_number: 2
# index_replicas_number: 0
```
## 使用Elastic Search代替H2存储
由于H2数据库性能的局限性,我们在单机模式下,也支持使用ElasticSearch 5.3作为存储。你需要安装对应的ElasticSearch 5.3,并取消
- 在单机模式下除了支持内置的H2数据库运行,也支持其他的存储(当前已支持的ElasticSearch 5.3以及将会支持的ShardJdbc),安装storage注释,修改配置信息即可。
- [下载Source code](https://github.com/OpenSkywalking/skywalking/releases)并解压,进入解压目录,执行以下命令:
```shell
> docker-compose pull
> docker-compose up
```
- 探针配置的端口是10800。
- 通过http://localhost:8080 访问WebUI
注意:Docker Compose主要用于在本地进行快速环境搭建和测试,请不要通过远程访问默认Docker Compose启动的Collector环境
___
测试环境: docker 17.03.1-ce, docker compose 1.11.2
## Download skywalking agent release version
- Go to [release page](https://github.com/OpenSkwaylking/skywalking/releases)
## Deploy skywalking javaagent
1. Copy the agent package to anywhere you like. The logs, plugins and config are all included in the package.
2. Add -javaagent:/path/to/skywalking-agent/skywalking-agent.jar to VM argument.
New agent package looks like this:
```
+-- skywalking-agent
+-- activations
apm-toolkit-log4j-1.x-activation.jar
apm-toolkit-log4j-2.x-activation.jar
apm-toolkit-logback-1.x-activation.jar
...
+-- config
agent.config
+-- plugins
apm-dubbo-plugin.jar
apm-feign-default-http-9.x.jar
apm-httpClient-4.x-plugin.jar
.....
skywalking-agent.jar
```
- Start your application。
# Advanced features
- All plugins are in `/plugin` folder. The plugin jar is active when it is in there. Remove the plugin jar, it disabled.
- Besides set config through `/config/agent.config`, you can use System.Env and System.Properties(-D) to set config.
- Key of env and properties = `skywalking.` + key in `agent.config` file
- Priority: System.Env > System.Properties(-D) > `/config/agent.config`
- The default logging output folder is `/log`.
# Deploy agent in Tomcat FAQ
- Tomcat 7
Change the first line of `tomcat/bin/catalina.sh`.
```shell
CATALINA_OPTS="$CATALINA_OPTS -javaagent:/path/to/skywalking-agent/skywalking-agent.jar"; export CATALINA_OPTS
```
- Tomcat 8
Change the first line of `tomcat/bin/catalina.sh`.
```shell
set "CATALINA_OPTS=... -javaagent:E:\apache-tomcat-8.5.20\skywalking-agent\skywalking-agent.jar -Dconfig=\skywalking\config\dir"
```
\ No newline at end of file
# Disable plugins
删除plugin目录下的相关jar包:`skywalking-agent/plugins/*.jar`
```
+-- skywalking-agent
+-- activations
apm-toolkit-log4j-1.x-activation.jar
apm-toolkit-log4j-2.x-activation.jar
apm-toolkit-logback-1.x-activation.jar
...
+-- config
agent.config
+-- plugins
apm-dubbo-plugin.jar
apm-feign-default-http-9.x.jar
apm-httpClient-4.x-plugin.jar
.....
skywalking-agent.jar
```
\ No newline at end of file
# 部署步骤
1. 部署 Collector
1. [单机模式](Deploy-collector-in-standalone-mode-CN.md)
1. [集群模式](Deploy-collector-in-cluster-mode-CN.md)
1. 部署 webui server, [doc](https://github.com/OpenSkywalking/skywalking-ui#quickstart)
1. 部署 Java Agent,[doc](Deploy-skywalking-agent-CN.md)
1. 重启并访问系统功能,查看UI即可。
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册