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 ec5d8a41e6d9d4f923a5c9a6153f65574f34ff58 Author: abudnikov <abudni...@gridgain.com> AuthorDate: Wed Aug 26 19:50:23 2020 +0300 add cluster id page --- .../org/apache/ignite/snippets/ClusterAPI.java | 16 ++++++++ docs/_docs/monitoring-metrics/cluster-id.adoc | 48 ++++++++++++++++++++++ 2 files changed, 64 insertions(+) diff --git a/docs/_docs/code-snippets/java/src/main/java/org/apache/ignite/snippets/ClusterAPI.java b/docs/_docs/code-snippets/java/src/main/java/org/apache/ignite/snippets/ClusterAPI.java index fd2eb9e..d56d8a0 100644 --- a/docs/_docs/code-snippets/java/src/main/java/org/apache/ignite/snippets/ClusterAPI.java +++ b/docs/_docs/code-snippets/java/src/main/java/org/apache/ignite/snippets/ClusterAPI.java @@ -1,6 +1,9 @@ package org.apache.ignite.snippets; +import java.util.UUID; + import org.apache.ignite.Ignite; +import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.IgniteCluster; import org.apache.ignite.IgniteCompute; import org.apache.ignite.Ignition; @@ -28,7 +31,20 @@ public class ClusterAPI { ignite.cluster().state(ClusterState.ACTIVE_READ_ONLY); //end::change-state[] ignite.close(); + } + + void changeClusterTag() throws IgniteCheckedException { + //tag::cluster-tag[] + Ignite ignite = Ignition.start(); + + // get the cluster id + java.util.UUID clusterId = ignite.cluster().id(); + + // change the cluster tag + ignite.cluster().tag("new_tag"); + //end::cluster-tag[] + ignite.close(); } @Test diff --git a/docs/_docs/monitoring-metrics/cluster-id.adoc b/docs/_docs/monitoring-metrics/cluster-id.adoc new file mode 100644 index 0000000..0d2ec31 --- /dev/null +++ b/docs/_docs/monitoring-metrics/cluster-id.adoc @@ -0,0 +1,48 @@ += Cluster ID and Tag + +A cluster ID is a unique identifier of the cluster that is generated automatically when the cluster starts for the first time. +A cluster tag is a user friendly name that you can assign to your cluster. +You can use these values to identify your cluster in the monitoring system you use. + +The default cluster tag is generated automatically, but you can change it using one of the available methods. +The length of the tag is limited by 280 characters. + +You can use the following methods to view the cluster ID and view or change the cluster tag: + +* Via the link:control-script#cluster-id-and-tag[control script]. +* JMX Bean: ++ +-- +---- +group=IgniteCluster,name=IgniteClusterMXBeanImpl +---- +[cols="3,2,8", opts="header"] +|=== +| Attribute | Type | Description +|Id| String | The cluster ID. +|Tag | long | The cluster tag. +|=== + +[cols="4,9", opts="header"] +|=== +| Operation | Description +| Tag(String) | Set the new cluster tag. +|=== +-- +* Programmatically: ++ +[tabs] +-- +tab:Java[] +[source, java] +---- +include::{javaCodeDir}/ClusterAPI.java[tags=cluster-tag, indent=0] +---- + +tab:C#/.NET[] +tab:C++[] +-- + + + +