You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ab...@apache.org on 2020/08/14 15:46:21 UTC

[ignite] branch IGNITE-7595 updated (12fc8a2 -> 9cc04bb)

This is an automated email from the ASF dual-hosted git repository.

abudnikov pushed a change to branch IGNITE-7595
in repository https://gitbox.apache.org/repos/asf/ignite.git.


    from 12fc8a2  update metrics pages
     new d94ad87  add initial documentation on tracing
     new 6c28f14  add running nodes behind nat page
     new 9cc04bb  update toc and setup page

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 docs/_config.yml                                   |   4 +-
 docs/_data/toc.yaml                                |   8 +-
 .../running-client-nodes-behind-nat.adoc           |  33 ++++++++
 .../java/org/apache/ignite/snippets/Discovery.java |  26 +++++++
 .../java/org/apache/ignite/snippets/Tracing.java   |  42 ++++++++++
 .../{on-heap-cache.xml => client-behind-nat.xml}   |   8 +-
 .../code-snippets/xml/{mvcc.xml => tracing.xml}    |   9 +--
 docs/_docs/images/trace_in_zipkin.png              | Bin 0 -> 120344 bytes
 docs/_docs/monitoring-metrics/tracing.adoc         |  86 +++++++++++++++++++++
 docs/_docs/setup.adoc                              |  25 ++++--
 10 files changed, 223 insertions(+), 18 deletions(-)
 create mode 100644 docs/_docs/clustering/running-client-nodes-behind-nat.adoc
 create mode 100644 docs/_docs/code-snippets/java/src/main/java/org/apache/ignite/snippets/Discovery.java
 create mode 100644 docs/_docs/code-snippets/java/src/main/java/org/apache/ignite/snippets/Tracing.java
 copy docs/_docs/code-snippets/xml/{on-heap-cache.xml => client-behind-nat.xml} (83%)
 copy docs/_docs/code-snippets/xml/{mvcc.xml => tracing.xml} (81%)
 create mode 100644 docs/_docs/images/trace_in_zipkin.png
 create mode 100644 docs/_docs/monitoring-metrics/tracing.adoc


[ignite] 02/03: add running nodes behind nat page

Posted by ab...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

abudnikov pushed a commit to branch IGNITE-7595
in repository https://gitbox.apache.org/repos/asf/ignite.git

commit 6c28f14504e7ecd13fc9b2243907987c03e9010a
Author: abudnikov <ab...@gridgain.com>
AuthorDate: Fri Aug 14 18:45:04 2020 +0300

    add running nodes behind nat page
---
 .../running-client-nodes-behind-nat.adoc           | 33 ++++++++++++++++++++++
 .../java/org/apache/ignite/snippets/Discovery.java | 26 +++++++++++++++++
 docs/_docs/code-snippets/xml/client-behind-nat.xml | 28 ++++++++++++++++++
 3 files changed, 87 insertions(+)

diff --git a/docs/_docs/clustering/running-client-nodes-behind-nat.adoc b/docs/_docs/clustering/running-client-nodes-behind-nat.adoc
new file mode 100644
index 0000000..55d5703
--- /dev/null
+++ b/docs/_docs/clustering/running-client-nodes-behind-nat.adoc
@@ -0,0 +1,33 @@
+= Running Client Nodes Behind NAT
+
+If your client nodes are deployed behind a NAT, the server nodes won't be able to establish connection with the clients because of the limitations of the communication protocol.
+This includes deployment cases when client nodes are running in virtual environments (like Kubernetes) and the server nodes are deployed elsewhere.
+
+For cases like this, you need to enable a special mode of communication:
+
+[tabs]
+--
+tab:XML[]
+
+[source, xml]
+----
+include::code-snippets/xml/client-behind-nat.xml[tags=ignite-config;!discovery,indent=0]
+----
+tab:Java[]
+[source, java]
+----
+include::{javaCodeDir}/Discovery.java[tags=client-behind-nat,indent=0]
+----
+tab:C#/.NET[]
+
+tab:C++[unsupported]
+--
+
+== Limitations
+
+* This mode cannot be used when `TcpCommunicationSpi.usePairedConnections = true` on both server and client nodes.
+
+* Peer class loading for link:key-value-api/continuous-queries[continuous queries (transformers and filters)] does not work when a continuous query is started from a client node `forceClientToServerConnections = true`.
+You will need to add the corresponding classes to the classpath of every server node.
+
+* This property can only be used on client nodes. This limitation will be addressed in the future releases.
diff --git a/docs/_docs/code-snippets/java/src/main/java/org/apache/ignite/snippets/Discovery.java b/docs/_docs/code-snippets/java/src/main/java/org/apache/ignite/snippets/Discovery.java
new file mode 100644
index 0000000..adf3e35
--- /dev/null
+++ b/docs/_docs/code-snippets/java/src/main/java/org/apache/ignite/snippets/Discovery.java
@@ -0,0 +1,26 @@
+package org.apache.ignite.snippets;
+
+import org.apache.ignite.Ignite;
+import org.apache.ignite.Ignition;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi;
+import org.junit.jupiter.api.Test;
+
+public class Discovery {
+
+    @Test
+    void clientsBehindNat() {
+
+        //tag::client-behind-nat[]
+        IgniteConfiguration cfg = new IgniteConfiguration();
+        
+        cfg.setClientMode(true);
+
+        cfg.setCommunicationSpi(new TcpCommunicationSpi().setForceClientToServerConnections(true));
+
+        //end::client-behind-nat[]
+        try(Ignite ignite = Ignition.start(cfg)) {
+            
+        } 
+    }
+}
diff --git a/docs/_docs/code-snippets/xml/client-behind-nat.xml b/docs/_docs/code-snippets/xml/client-behind-nat.xml
new file mode 100644
index 0000000..4fa51cd
--- /dev/null
+++ b/docs/_docs/code-snippets/xml/client-behind-nat.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans" xmlns:util="http://www.springframework.org/schema/util" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="         http://www.springframework.org/schema/beans         http://www.springframework.org/schema/beans/spring-beans.xsd         http://www.springframework.org/schema/util         http://www.springframework.org/schema/util/spring-util.xsd">
+    <!-- tag::ignite-config[] -->
+    <bean class="org.apache.ignite.configuration.IgniteConfiguration">
+        <property name="clientMode" value="true"/>
+        <property name="communicationSpi">
+            <bean class="org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi">
+                <property name="forceClientToServerConnections" value="true"/>
+            </bean>
+        </property>
+        <!-- tag::discovery[] -->
+        <property name="discoverySpi">
+            <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
+                <property name="ipFinder">
+                    <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">
+                        <property name="addresses">
+                            <list>
+                                <value>127.0.0.1:47500..47509</value>
+                            </list>
+                        </property>
+                    </bean>
+                </property>
+            </bean>
+        </property>
+        <!-- end::discovery[] -->
+    </bean>
+    <!-- end::ignite-config[] -->
+</beans>
\ No newline at end of file


[ignite] 01/03: add initial documentation on tracing

Posted by ab...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

abudnikov pushed a commit to branch IGNITE-7595
in repository https://gitbox.apache.org/repos/asf/ignite.git

commit d94ad878ce565c600bb9a504b29ea618eea3e212
Author: abudnikov <ab...@gridgain.com>
AuthorDate: Fri Aug 14 18:44:39 2020 +0300

    add initial documentation on tracing
---
 .../java/org/apache/ignite/snippets/Tracing.java   |  42 ++++++++++
 docs/_docs/code-snippets/xml/tracing.xml           |  29 +++++++
 docs/_docs/images/trace_in_zipkin.png              | Bin 0 -> 120344 bytes
 docs/_docs/monitoring-metrics/tracing.adoc         |  86 +++++++++++++++++++++
 4 files changed, 157 insertions(+)

diff --git a/docs/_docs/code-snippets/java/src/main/java/org/apache/ignite/snippets/Tracing.java b/docs/_docs/code-snippets/java/src/main/java/org/apache/ignite/snippets/Tracing.java
new file mode 100644
index 0000000..fd404e2
--- /dev/null
+++ b/docs/_docs/code-snippets/java/src/main/java/org/apache/ignite/snippets/Tracing.java
@@ -0,0 +1,42 @@
+package org.apache.ignite.snippets;
+
+import org.apache.ignite.Ignite;
+import org.apache.ignite.Ignition;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.junit.jupiter.api.Test;
+
+import io.opencensus.exporter.trace.zipkin.ZipkinExporterConfiguration;
+import io.opencensus.exporter.trace.zipkin.ZipkinTraceExporter;
+
+public class Tracing {
+
+    @Test
+    void config() {
+        //tag::config[]
+        IgniteConfiguration cfg = new IgniteConfiguration();
+
+        cfg.setTracingSpi(new org.apache.ignite.spi.tracing.opencensus.OpenCensusTracingSpi());
+
+        Ignite ignite = Ignition.start(cfg);
+        //end::config[]
+
+        ignite.close();
+    }
+
+    @Test
+    void exportToZipkin() {
+        //tag::export-to-zipkin[]
+        ZipkinTraceExporter.createAndRegister(ZipkinExporterConfiguration.builder()
+                .setV2Url("http://localhost:9411/api/v2/spans").setServiceName("ignite-cluster").build());
+
+        IgniteConfiguration cfg = new IgniteConfiguration();
+
+        cfg.setTracingSpi(new org.apache.ignite.spi.tracing.opencensus.OpenCensusTracingSpi());
+
+        Ignite ignite = Ignition.start(cfg);
+        //end::config[]
+        //end::export-to-zipkin[]
+        ignite.close();
+
+    }
+}
diff --git a/docs/_docs/code-snippets/xml/tracing.xml b/docs/_docs/code-snippets/xml/tracing.xml
new file mode 100644
index 0000000..7902987
--- /dev/null
+++ b/docs/_docs/code-snippets/xml/tracing.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans" xmlns:util="http://www.springframework.org/schema/util" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="         http://www.springframework.org/schema/beans         http://www.springframework.org/schema/beans/spring-beans.xsd         http://www.springframework.org/schema/util         http://www.springframework.org/schema/util/spring-util.xsd">
+    <!-- tag::ignite-config[] -->
+    <bean class="org.apache.ignite.configuration.IgniteConfiguration">
+
+        <property name="tracingSpi">
+            <bean class="org.apache.ignite.spi.tracing.opencensus.OpenCensusTracingSpi"/>
+        </property>
+
+        <!-- tag::discovery[] -->
+        <property name="discoverySpi">
+            <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
+                <!-- prevent this client from reconnecting on connection loss -->
+                <property name="clientReconnectDisabled" value="true"/>
+                <property name="ipFinder">
+                    <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">
+                        <property name="addresses">
+                            <list>
+                                <value>127.0.0.1:47500..47509</value>
+                            </list>
+                        </property>
+                    </bean>
+                </property>
+            </bean>
+        </property>
+        <!-- end::discovery[] -->
+    </bean>
+    <!-- end::ignite-config[] -->
+</beans>
\ No newline at end of file
diff --git a/docs/_docs/images/trace_in_zipkin.png b/docs/_docs/images/trace_in_zipkin.png
new file mode 100644
index 0000000..fdf1e18
Binary files /dev/null and b/docs/_docs/images/trace_in_zipkin.png differ
diff --git a/docs/_docs/monitoring-metrics/tracing.adoc b/docs/_docs/monitoring-metrics/tracing.adoc
new file mode 100644
index 0000000..1200afb
--- /dev/null
+++ b/docs/_docs/monitoring-metrics/tracing.adoc
@@ -0,0 +1,86 @@
+= Tracing
+
+:javaFile: {javaCodeDir}/Tracing.java
+
+A number of APIs in Ignite are instrumented with OpenCensus for tracing.
+You can collect distributed traces of various tasks execuded in your cluster and use this information to diagnose latency problems.
+
+We suggest you get familiar with OpenCensus tracing documentation: https://opencensus.io/tracing/.
+
+The following APIs are instrumented for tracing:
+
+* Discovery
+* Communication
+* Exchange
+* Transactions
+
+== Configuring Tracing
+
+. Configure OpenCensus tracing in the node configuration:
++
+[tabs]
+--
+tab:XML[]
+[source, xml]
+----
+include::code-snippets/xml/tracing.xml[tags=ignite-config;!discovery, indent=0]
+----
+
+tab:Java[]
+[source, java]
+----
+include::{javaFile}[tags=config, indent=0]
+----
+tab:C#/.NET[]
+
+tab:C++[unsupported]
+--
+
+. Enable sampling of traces for a specific scope:
++
+--
+[source, shell]
+----
+./control.sh --tracing-configuration set --scope DISCOVERY --sampling-rate 1
+----
+
+The `--scope` parameter specifies the API you want to trace.
+The following APIs are instrumented for tracing:
+
+* `DISCOVERY` — discovery events
+* `EXCHANGE` —  exchange events
+* `COMMUNICATION` — communication events
+* `TX` — transactions
+
+The `--sampling-rate` is the probabilistic sampling rate, a number between `0` and `1`.
+`0` means no sampling, `1` means always sampling.
+--
+
+
+== Viewing Traces
+
+To view traces, you need to export them to an external backend using one of the available exporters.
+OpenCensus supports a number of exporter out-of-the-box, and you can write a custom exporter.
+Refer to the link:https://opencensus.io/exporters/[OpenCensus Exporters^] for details.
+
+In this section, we will show how to export traces to link:https://zipkin.io[Zipkin^].
+Follow link:https://zipkin.io/pages/quickstart.html[this guide^] to launch Zipkin in your local machine.
+
+[source, java]
+----
+include::{javaFile}[tags=export-to-zipkin, indent=0]
+----
+
+Start one server node and then start another node.
+
+TODO
+
+open http://localhost:9411[^] in your browser
+
+This is what a trace of a node join event looks like:
+
+image::images/trace_in_zipkin.png[]
+
+
+
+


[ignite] 03/03: update toc and setup page

Posted by ab...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

abudnikov pushed a commit to branch IGNITE-7595
in repository https://gitbox.apache.org/repos/asf/ignite.git

commit 9cc04bb416b068a6d14b806cf7d695f708cadaf6
Author: abudnikov <ab...@gridgain.com>
AuthorDate: Fri Aug 14 18:45:50 2020 +0300

    update toc and setup page
---
 docs/_config.yml      |  4 ++--
 docs/_data/toc.yaml   |  8 ++++++--
 docs/_docs/setup.adoc | 25 ++++++++++++++++++++-----
 3 files changed, 28 insertions(+), 9 deletions(-)

diff --git a/docs/_config.yml b/docs/_config.yml
index f0411db..a3d394a 100644
--- a/docs/_config.yml
+++ b/docs/_config.yml
@@ -1,6 +1,6 @@
 exclude: [guidelines.md,  "Gemfile", "Gemfile.lock", README.adoc, "_docs/code-snippets", "_docs/includes", '*.sh']
 attrs: &asciidoc_attributes
-  version: '2.8.1'
+  version: 2.9 
   base_url: /docs
   stylesdir: /docs/assets/css
   imagesdir: /docs/{version}
@@ -12,7 +12,7 @@ attrs: &asciidoc_attributes
   githubUrl: https://github.com/apache/ignite/tree/master
 collections:
   docs:
-    permalink: /docs/2.8.1/:path:output_ext
+    permalink: /docs/2.9/:path:output_ext
     output: true
 defaults:
   -
diff --git a/docs/_data/toc.yaml b/docs/_data/toc.yaml
index 950fe1d..7658d8ca 100644
--- a/docs/_data/toc.yaml
+++ b/docs/_data/toc.yaml
@@ -20,9 +20,9 @@
 - title: Setting Up
   items:
     - title: Setting Up GridGain for Java 
-      url: /developers-guide/setup
+      url: /setup
     - title: Setting Up GridGain for .NET/C# 
-      url: /developers-guide/setup-dotnet 
+      url: /setup-dotnet 
 - title: Understanding Configuration
   url: /understanding-configuration
 - title: Configuring Logging
@@ -43,6 +43,8 @@
       url: /clustering/network-configuration
     - title: Connecting Client Nodes 
       url: /clustering/connect-client-nodes
+    - title: Running Client Nodes Behind NAT
+      url: /clustering/running-client-nodes-behind-nat
 - title: Data Modeling 
   items: 
     - title: Introduction
@@ -175,6 +177,8 @@
           url: /monitoring-metrics/new-metrics
     - title: System Views
       url: /monitoring-metrics/system-views
+    - title: Tracing
+      url: /monitoring-metrics/tracing
 - title: Security
   url: /security
   items: 
diff --git a/docs/_docs/setup.adoc b/docs/_docs/setup.adoc
index 01506d3..5bdfca8 100644
--- a/docs/_docs/setup.adoc
+++ b/docs/_docs/setup.adoc
@@ -6,7 +6,6 @@ Ignite was tested on:
 
 include::includes/prereqs.adoc[]
 
-
 == Running Ignite with Java 11 or later
 
 include::includes/java9.adoc[]
@@ -14,20 +13,36 @@ include::includes/java9.adoc[]
 
 == Using Binary Distribution
 
-* Download the appropriate binary package from  TODO.
+* Download the appropriate binary package from https://ignite.apache.org/download.cgi[Apache Ignite Downloads^].
 * Unzip the archive into a directory.
 * (Optional) Set the `IGNITE_HOME` environment variable to point to the
 installation folder and make sure there is no trailing `/` in the path.
 
 == Using Maven
 
-The easiest way to start developing with Ignite is to use Maven.
+The easiest way to use Ignite is to add it to your pom.
+
+[source, xml]
+----
+
+<properties>
+    <ignite.version>{version}</ignite.version>
+</properties>
+
+<dependencies>
+    <dependency>
+        <groupId>org.apache.ignite</groupId>
+        <artifactId>ignite-core</artifactId>
+        <version>${ignite.version}</version>
+    </dependency>
+</dependencies>
+----
+
 
-*TODO*
 
 == Using Docker
 
-If you want to run Ignite in Docker, refer to the link:on-premises-deployment#installing-using-docker[Docker Deployment] section.
+If you want to run Ignite in Docker, refer to the link:installation/installing-using-docker[Docker Deployment] section.
 
 == Configuring Work Directory