10 Ekim 2021 Pazar

Data Center Replication

Giriş
Replication active-passive veya active-active olarak yapılabiliyor. Açıklaması burada

Active/Passive Replication
Adımlar şöyle
1. Set Cluster ID
2. Configure Connection Between Clusters

Burada önemli olan nokta şöyle. Yani her iki cluster'da aynı sayıda düğüm olmalı
To connect the master cluster to the replica, configure a few sender nodes in the master cluster and the same number of receiver nodes in the replica cluster.
Ayrıca istenirse bir "Sender Group" oluşturulabilir. Açıklaması şöyle. Eğer oluşturulmazsa sender düğüm ismi "<default>" olan gruba dahil edilir.
A sender group is a logical group of nodes identified by a name, in which each node is configured to connect to the nodes in the replica. 
...
Basic sender node configuration involves two properties:
- The name of the sender group this node belongs to. This property is optional. If it’s not specified, the node will be included in the default group, named "<default>", which includes all nodes configured as sender nodes.

- The connection configuration that establishes a connection to the replica cluster. You can have multiple connection configurations, each connecting to different nodes.

Örnek
Cluster ID vermek için şöyle yaparız
<bean class="org.apache.ignite.configuration.IgniteConfiguration" id="ignite.cfg">
  <property name="pluginConfigurations">
    <list>
      <bean class="org.gridgain.grid.configuration.GridGainConfiguration">
        <!-- Unique ID of this cluster -->
        <property name="dataCenterId" value="1"/>
      </bean>
    </list>
  </property>
</bean>
Örnek
Adresleri vermek için şöyle yaparız
<bean class="org.gridgain.grid.configuration.GridGainConfiguration">
  <!-- Unique ID of this cluster -->
  <property name="dataCenterId" value="1"/>
  <property name="drSenderConfiguration">
    <bean class="org.gridgain.grid.configuration.DrSenderConfiguration">
      <!-- this node is part of group1 -->
      <property name="senderGroups">
        <list>
          <value>group1</value>
        </list>
      </property>
      <!-- connection configuration -->
      <property name="connectionConfiguration">
        <bean class="org.gridgain.grid.dr.DrSenderConnectionConfiguration">
          <!-- the ID of the remote cluster -->
	  <property name="dataCenterId" value="2"/>
	  <!-- Addresses of the remote cluster's nodes this node will connect to -->
	  <property name="receiverAddresses">
	    <list>
	      <value>172.25.4.200:50001</value>
	      <value>172.25.4.201:50001</value>
	    </list>
	  </property>
        </bean>
      </property>
    </bean>
  </property>
</bean>
Cache Template
Hem IgniteConfiguration hem de CacheConfiguration sınıflarının pluginConfigurations alanı var. Dolayısıyla özel bir cache yapmak istersek şöyle yaparız
<property name="cacheConfiguration">
    <bean class="org.apache.ignite.configuration.CacheConfiguration">
        <!-- Setting up basic cache parameters -->
        <property name="name" value="myCache"/>
        <property name="cacheMode" value="PARTITIONED"/>
        <property name="backups" value="1"/>

        <!-- Setting up DR related cache parameters -->
        <property name="pluginConfigurations">
            <bean class="org.gridgain.grid.configuration.GridGainCacheConfiguration">


            </bean>
        </property>
    </bean>
</property>
Cache template yapmak istersek şöyle yaparız
<bean class="org.apache.ignite.configuration.IgniteConfiguration">
  <property name="cacheConfiguration">
    <list>
      <bean abstract="true" class="org.apache.ignite.configuration.CacheConfiguration" id="cache-template-bean">
        <!-- when you create a template via XML configuration, you must add an asterisk to the name of the template -->
        <property name="name" value="myCacheTemplate*"/>
        <property name="cacheMode" value="PARTITIONED"/>
        <property name="backups" value="2"/>
        <!-- Other cache parameters -->
      </bean>
    </list>
  </property>
</bean>
Eğer çoklu cache template istersek bir örnek burada


Hiç yorum yok:

Yorum Gönder

Ignite Transaction Kullanımı

Giriş Bir tablo 3 tane atomicity değerinden birisine sahip olabilir. 1. ATOMIC 2. TRANSACTIONAL 3. TRANSACTIONAL_SNAPSHOT ATOMIC Açıklaması ...