You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by alexGalushka <al...@emc.com> on 2016/03/25 22:04:58 UTC

Ignite terminology

Hello Ignite community!

I read through the Ignite docs a few times and was playing with Ignite for a
few weeks. 
But I still can't figure out the Ignite terminology...

What are definitions and relations of the following: grid, grid instance,
ignite cluster (cluster), ignite node (node)?
I feel like in the Ignite context grid and cluster are interchangeably
terms, but still not 100% sure about it.

How to make the nodes belong to the same cluster (/grid, if the term is
interchangeable)? Setting the same gridName seems to do it: 

Ignition.ignite("MY_GRID_NAME").cluster().nodes()... 

I see 2 nodes in the collection and with the correct node IDs.

But I'm confused by the .ignite(...) java doc, which says: "Note that caller
of this method should not assume that it will return the same instance every
time. Grid name defines what grid a particular grid instance (and
correspondingly its node) belongs to"

--Alexander.







--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Ignite-terminology-tp3687.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Ignite terminology

Posted by vkulichenko <va...@gmail.com>.
Alexander,

It's weird that you get NULL instead of the set of nodes. Regardless of the
grid name it should return all nodes in the topology. Are you sure that
nodes discover each other? Maybe you have the simple test that reproduces
it?

Answering your questions:
1. Correct.
2. Ignite instance has the name. Essentially, this is the key of the static
map used inside of Ignition class. So if there is only one node per JVM, the
name should not change anything.
3. Correct.

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Ignite-terminology-tp3687p3753.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Ignite terminology

Posted by alexGalushka <al...@emc.com>.
Val, 

Thank you for your response. Here is my simple use-case for POC to evaluate
Apache Ignire I'm currently working on, which have generated the Apache
Ignite terminology question.

My setup: VM {Ubuntu 15.04; 4 cores}, 2 docker containers (each has its own
JVM, each deploys its own Vert.x clustered instance with Apache Ignite as a
cluster manager, I use multicast for node discovery). Whenever you start the
Vert.x instance, Ignite.start() is called, so I the Ignite instance is
created. The idea is to have each node to get the list of nodes in the
cluster, I've tried 3 different ways:

First, Ignition.localIgnite().cluster().nodes() returns NULL
In javadoc to localignite it says: "According to contract this method has to
be called only under IgniteThread. An IllegalArgumentException will be
thrown otherwise."

Second, Ignition.ignite(UUID.fromString(nodeID)).cluster().nodes() - same
result
But, I have an interesting finding from the javadoc: "Note that grid
instance and local node have one-to-one relationship *where node has ID and
instance has name of the grid to which both grid instance and its node
belong*."
So per this javadoc there is a grid (cluster) name, it's not a node name,
it's a name of the cluster which node belongs to!

Third, I've added this: to ignite xml config file <property name="gridName"
value="APPLIANCE"/>

To get all the nodes which belong (assuming that the javadoc is correct) to
the grid with name "APPLIANCE":

System.out.println("Here are the nodes in the APPLIANCE : "
    + Ignition.localIgnite().cluster().nodes()
    .stream().map(node ->
node.id()).collect(Collectors.toList()).toString());

It returns the expected result!

================================================================

Val, now back to your reply, I need a few clarifications:

1. When you say topology you mean the net of nodes, which is the cluster as
I see it correct?
2. Node doesn't have a name, it has a unique ID, the grid (cluster) does
have name, correct?
3. The discovered nodes define the cluster, so if nodes see each other they
form the cluster (and it's defined by discovery SPI), correct?

Thank you all your help, guys!!!

--Alexander
   



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Ignite-terminology-tp3687p3746.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Ignite terminology

Posted by vkulichenko <va...@gmail.com>.
Alexander,

Every time you call Ignition.start(..), a new node is started and a new
instance of Ignite is created. If you start several instances in the same
JVM, they are required to have unique names, which you then can use to
acquire concrete instance using Ignition.ignite(..) method. (Note that there
is no requirement for all nodes in one topology to have the same name.
Whether nodes discover each other or not is defined only by discovery SPI.)

There are two typical scenarios when this can be used:

1. You start two or more Ignite instances that connect to different
clusters. In this case each instance will give you access to different
cluster, so you can treat instance names as local references to these
clusters.
2. You start the whole topology within one JVM. This is very useful for unit
testing and debugging. You can take a look at any of Ignite's internal
tests, we utilize this approach heavily.

In all other cases you should not worry about this setting at all and simply
use 'null' as the instance name (which is already the default value).

Makes sense?

-Val 



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Ignite-terminology-tp3687p3723.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Ignite terminology

Posted by alexGalushka <al...@emc.com>.
Vladimir,

Thank you so much for your answer, things are starting making a bit more
sense now, but I still confuse about the the
Ignition.ignite("Grid_Instance_Name") javadoc:

"Note that Java VM can run multiple grid instances and every *grid instance
(and its node)* can belong to a different grid."

You said that "grid instance" == "ignite node", should the javadoc be
corrected to "grid instance (aka node)"?

Following your terminology, the "gridName" in the IgniteConfiguration it's
indeed "gridInstanceName" (or to be more accurate, "nodeName"), the comments
in the IgniteConfiguration say:

    /** Optional grid name. */
    private String gridName;

Should it be 

    /** Optional node name. */
    private String gridInstanceName; (or nodeName)  ?


I'm also confused on what Ignition.ignite("MY_GRID_*INSTANCE*_NAME")
returns, it return the Ignite instance, which is the "Main entry-point for
all Ignite APIs", in order to get the particular node, you have to address
it by UUID:

Ignition.ignite("APPLIANCE").cluster().node("some_UUID") ? 

Can you please clarify?

I also have follow up questions on the cluster naming, but I'll hold on for
those in order to avoid confusion and.

--Alexander





--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Ignite-terminology-tp3687p3709.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Ignite terminology

Posted by Vladimir Ozerov <vo...@gridgain.com>.
Hi Alexander,

Basically, "grid" == "Ignite cluster" and "grid instance" == "ignite node".
"Grid" terms came from old GridGain days. I suggest you to operate on terms
"node" and "cluster".

Ignition.ignite(String) returns a node with a given name started in current
JVM. If you re-start the node with the same name, instance returned after
restart will differ from instance returned before restart:

Ignition.start([config with gridName="A"]);
Ignite before = Ignition.ignite("A");

Ignition.stop("A", true);

Ignition.start([config with gridName="A"]);
Ignite after = Ignition.ignite("A");

assert before == after; // Will fail.

Vladimir.

On Sat, Mar 26, 2016 at 12:04 AM, alexGalushka <al...@emc.com>
wrote:

> Hello Ignite community!
>
> I read through the Ignite docs a few times and was playing with Ignite for
> a
> few weeks.
> But I still can't figure out the Ignite terminology...
>
> What are definitions and relations of the following: grid, grid instance,
> ignite cluster (cluster), ignite node (node)?
> I feel like in the Ignite context grid and cluster are interchangeably
> terms, but still not 100% sure about it.
>
> How to make the nodes belong to the same cluster (/grid, if the term is
> interchangeable)? Setting the same gridName seems to do it:
>
> Ignition.ignite("MY_GRID_NAME").cluster().nodes()...
>
> I see 2 nodes in the collection and with the correct node IDs.
>
> But I'm confused by the .ignite(...) java doc, which says: "Note that
> caller
> of this method should not assume that it will return the same instance
> every
> time. Grid name defines what grid a particular grid instance (and
> correspondingly its node) belongs to"
>
> --Alexander.
>
>
>
>
>
>
>
> --
> View this message in context:
> http://apache-ignite-users.70518.x6.nabble.com/Ignite-terminology-tp3687.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>