You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by rssah <77...@gmail.com> on 2020/01/29 11:26:06 UTC

How to choose Leader manually?

Hi.

Here is the use case:

If I deploy ignite in a cluster where logically, it sees four data nodes,
but physically, I am going to use two nodes as "Main Purpose" nodes and two
nodes as "Disaster Recovery" nodes. Let's say two Data Centres holding two
nodes each.

If I enable replication across all nodes, the data keeps catching up in all
nodes. But here in my case, there will be network delay between two DCs.
Thus, distribution in some node may become slow. So I am planning to make
querying from clients to go to only one DC. In this case, it's Main Purpose
DC.

Is this possible? If so, how to make sure the Leader is elected among nodes
residing in particular DC only?



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: How to choose Leader manually?

Posted by joseheitor <jo...@heitorprojects.com>.
Hi there,

Firstly let me clarify that I am just an Ignite user - not an Ignite team
member/expert...so it will be great to get the views of the experts in this
discussion...

Now, in Ignite, all data gets 'stored' in a 'CACHE'. If you want your data
to be persisted, you simply configure your designated Cache to have
'Persistance' set to enabled.

Also there are various ways in which you can distribute your data among
different nodes on a cluster. But for your basic use-case, you would
probably set the 'Mode' configuration of your cache to 'REPLICATED'. This
will ensure that all data arriving at any of your (2) nodes will be 'synced'
to the other node.

In an environment where your connection between datacenters is very good,
like two AWS Availability Zones, the above scenario will probably give you
satisfactory results. But if your inter-datacenter link is flaky as you
mentioned, the above approach would not be recommended. For this scenario,
you would probably be better off looking into GridGain's commercial
(enhanced) version of Apache Ignite, which offers a specialised mechanism
for Datacenter-Replication (over sub-optimal links).

Hope this helps,
Jose



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: How to choose Leader manually?

Posted by rssah <77...@gmail.com>.
Thanks jose for the prompt reply.

Based on what you reply, I can understand that using DriverManager I can
query a particular node. But my question is regarding replication and data
availability. So, please let me rephrase my question.

Scenario:

Datacenter 1 (Main) -> One Application Server (Client Node CN1) and One DB
Server (Server Node SN1).

Datacenter 2 (Recovery) -> One Application Server (Client Node CN2) and One
DB Server (Server Node SN2).

Usually all the user requests go to CN1 but not CN2. So, technically we will
not run CN2. So forget about CN2. Will tell why it's used later.

So there are three nodes here running -> CN1, SN1, SN2.

Question1:

I don't use Apache Ignite for cache purpose, but we will use it for disk
persistent storage. Now, how to make sure that the data that is being stored
in SN1 will be replicated to SN2. We want SN2 to be backup node for SN1. Is
that possible? If so, how?

Conditions:

1. CN1 will not make connections to SN2.
2. SN1 and SN2 link will be very fragile and of less bandwidth.


Question2 :

After a few months, we will flip the entire setup, making DC2 as Main and
DC1 as Recovery. In this case, CN2 will make connections to SN2 and CN1 will
not be running. How to quickly switch so that SN2 is replicated almost with
SN1 and be ready to serve requests from CN2?



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: How to choose Leader manually?

Posted by joseheitor <jo...@heitorprojects.com>.
Hi,

As I understand it - if you are connecting via the JDBC Thin Client, in the
connection-string, you would list only the endpoints of the servers in the
'Main Purpose' datacenter.

To failover to servers in the other datacenter however, you would have to
change your connection string and re-establish the connection(s).

Another option to consider if your backups can not tolerate data
inconsistency is to configure the cache SYNC mode to a strict, synchronous
policy type, but this will reduce write-performance. In this instance,
however, it will be safe to establish a connection to any of the nodes, as
the data is guaranteed to be up to date. This would provide automatic
failover.

@Ignite Team - please correct me if my understanding is flawed...(?)

Jose



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/