title: How to give multiple static ip in apache ignite cache configuration xml file
body: <p>I'm using Spring Boot microservice integrated with apache ignite to store the key and some value for it in cache.</p>
  
  <p>In the ignite cache configuration file I'm trying to share my cache across 4 servers with same port i.e.,I should able to fetch but couldn't share the cache across 4 but it is picking only 2 servers for clustering, In other servers it ignite cache is started as a separate one and it is not into the cluster. Please help on this.</p>
  
  <p>Do i need to do any other configuration changes to cluster 4 servers.</p>
  
  <p><code>Cacheconfig.xml</code>:</p>
  
  <pre><code>&lt;property name="discoverySpi"&gt;
    &lt;bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi"&gt;
      &lt;property name="ipFinder"&gt;
        &lt;bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder"&gt;
          &lt;property name="addresses"&gt;
            &lt;list&gt;
              &lt;!-- In distributed environment, replace with actual host IP address. --&gt;
              &lt;!-- &lt;value&gt;127.0.0.1:47500..47509&lt;/value&gt; --&gt;
              &lt;value&gt;158.xxx.xx.xxx&lt;/value&gt;&lt;!--server1 ip--&gt;
              &lt;value&gt;158.xxx.xx.xxx&lt;/value&gt;&lt;!--server2 ip--&gt;
              &lt;value&gt;158.xxx.xx.xxx&lt;/value&gt;&lt;!--server3 ip--&gt;
              &lt;value&gt;4444&lt;/value&gt;&lt;!--my port--&gt;
            &lt;/list&gt;
          &lt;/property&gt;
        &lt;/bean&gt;
      &lt;/property&gt;
    &lt;/bean&gt;
  &lt;/property&gt;
  </code></pre>
  
  <p>Here I have replaced the default IP address with the actual server IP address required.</p>
  
  <p>But I could see when I give this way <code>&lt;value&gt;158.xxx.xx.xxx:4444..158.xxx.xx.xxx:4444&lt;/value&gt;</code> it worked for sharing between 2 servers.</p>
  
  <p>This will not work when it has more than 2 server IP addresses to be added to the list.</p>
  
  <p>Please help in sharing cache for more than 3 servers.</p>
  
  <p>Below is code i m using for starting the ignite and activate the cluster</p>
  
  <pre><code>import java.util.Enumeration;
  import java.util.Properties;
  
  import org.apache.ignite.Ignite;
  import org.apache.ignite.IgniteCache;
  import org.apache.ignite.IgniteException;
  import org.apache.ignite.Ignition;
  import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.stereotype.Component;
  
  @Component
  public class IgniteCacheManager {
      private static final Logger LOGGER = LoggerFactory.getLogger(IgniteCacheManager.class); 
      private  Ignite ignite;
      public Ignite getIgnite() {
          return ignite;
      }
      @Autowired
      private IgniteCacheManager(AppSpecificIgniteProperties igniteProperties) {
          Properties p = System.getProperties();
          Enumeration&lt;Object&gt; keys = p.keys();
          LOGGER.debug("-----------------------------SYSTEM PROPERTIES Start--------------------------------------");
          while (keys.hasMoreElements()) {
              String key = (String) keys.nextElement();
              String value = (String) p.get(key);
              LOGGER.info(key);
              LOGGER.info(value);
          }
          LOGGER.debug("-----------------------------SYSTEM PROPERTIES End--------------------------------------");
          try {
  
              // Ignite cache will start
              ignite=Ignition.start(igniteProperties.getConfigFile());            
              //Cluster Activation 
              ignite.cluster().active(true);
              LOGGER.info("IGNITE CACHE STARTED");
          } catch (IgniteException e) {
              LOGGER.error(e.getMessage(), e);
              throw e;
          }
  
      }
      public IgniteCache&lt;String, Integer&gt; getOrCreateCache(String name){
  
          return  ignite.getOrCreateCache(name);
  
      }
  }
  </code></pre>
  
  <p>Here igniteProperties.getproperties is the cacheconfig.xml file which the DiscoverySpi and cache expiry configurations.
  To add the server the to cluster whether i have to make any other changes.
  Please help on this.</p>
  
  <p>Below is my cache configuration used while starting the ignite</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util"
      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"&gt;
      &lt;bean abstract="true" id="ignite.cfg"
          class="org.apache.ignite.configuration.IgniteConfiguration"&gt;
  
          &lt;!-- Set to true to enable distributed class loading for examples, default 
              is false. --&gt;
          &lt;!-- &lt;property name="clientMode" value="true"/&gt; --&gt;
          &lt;property name="peerClassLoadingEnabled" value="true" /&gt;
          &lt;property name="cacheConfiguration"&gt;
              &lt;list&gt;
                  &lt;bean class="org.apache.ignite.configuration.CacheConfiguration"&gt;
                      &lt;property name="name" value="hcache" /&gt;
                      &lt;property name="expiryPolicyFactory"&gt;
                          &lt;!-- &lt;bean id="expiryPolicy" class="javax.cache.expiry.CreatedExpiryPolicy" 
                              factory-method="factoryOf"&gt; --&gt;
                          &lt;bean id="expiryPolicy" class="javax.cache.expiry.CreatedExpiryPolicy"
                              factory-method="factoryOf"&gt;
                              &lt;!-- CreatedExpiryPolicy is used to inform the cache provider to remove 
                                  the entry after a specified time since the entry’s addition to the cache. --&gt;
                              &lt;constructor-arg&gt;
                                  &lt;bean class="javax.cache.expiry.Duration"&gt;
                                      &lt;constructor-arg value="HOURS" /&gt;
                                      &lt;constructor-arg value="1" /&gt;
  
                                  &lt;/bean&gt;
                              &lt;/constructor-arg&gt;
                          &lt;/bean&gt;
                      &lt;/property&gt;
                  &lt;/bean&gt;
                  &lt;bean class="org.apache.ignite.configuration.CacheConfiguration"&gt;
                      &lt;property name="name" value="dcache" /&gt;
                      &lt;property name="expiryPolicyFactory"&gt;
                          &lt;bean id="expiryPolicy" class="javax.cache.expiry.CreatedExpiryPolicy"
                              factory-method="factoryOf"&gt;
                              &lt;constructor-arg&gt;
                                  &lt;bean class="javax.cache.expiry.Duration"&gt;
                                      &lt;constructor-arg value="HOURS" /&gt;
                                      &lt;constructor-arg value="24" /&gt;
                                  &lt;/bean&gt;
                              &lt;/constructor-arg&gt;
                          &lt;/bean&gt;
                      &lt;/property&gt;
                  &lt;/bean&gt;
                  &lt;bean class="org.apache.ignite.configuration.CacheConfiguration"&gt;
                      &lt;property name="name" value="wcache" /&gt;
                      &lt;property name="expiryPolicyFactory"&gt;
                          &lt;bean id="expiryPolicy" class="javax.cache.expiry.CreatedExpiryPolicy"
                              factory-method="factoryOf"&gt;
                              &lt;constructor-arg&gt;
                                  &lt;bean class="javax.cache.expiry.Duration"&gt;
                                      &lt;constructor-arg value="DAYS" /&gt;
                                      &lt;constructor-arg value="7" /&gt;
                                  &lt;/bean&gt;
                              &lt;/constructor-arg&gt;
                          &lt;/bean&gt;
                      &lt;/property&gt;
                  &lt;/bean&gt;
              &lt;/list&gt;
          &lt;/property&gt;
  
          &lt;!-- Enable task execution events for examples. --&gt;
          &lt;property name="includeEventTypes"&gt;
              &lt;list&gt;
                  &lt;!--Task execution events --&gt;
                  &lt;util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_STARTED" /&gt;
                  &lt;util:constant
                      static-field="org.apache.ignite.events.EventType.EVT_TASK_FINISHED" /&gt;
                  &lt;!-- This event is triggered every time a task finished with an exception --&gt;
                  &lt;util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_FAILED" /&gt;
  
                  &lt;util:constant
                      static-field="org.apache.ignite.events.EventType.EVT_TASK_TIMEDOUT" /&gt;
                  &lt;util:constant
                      static-field="org.apache.ignite.events.EventType.EVT_TASK_SESSION_ATTR_SET" /&gt;
                  &lt;util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_REDUCED" /&gt;
  
                  &lt;!--Cache events --&gt;
                  &lt;util:constant
                      static-field="org.apache.ignite.events.EventType.EVT_CACHE_OBJECT_PUT" /&gt;
                  &lt;util:constant
                      static-field="org.apache.ignite.events.EventType.EVT_CACHE_OBJECT_READ" /&gt;
                  &lt;util:constant
                      static-field="org.apache.ignite.events.EventType.EVT_CACHE_OBJECT_REMOVED" /&gt;
  
              &lt;/list&gt;
          &lt;/property&gt;
          &lt;!-- &lt;property name="eagerTtl" value="true" /&gt; --&gt;
          &lt;property name="dataStorageConfiguration"&gt;
              &lt;bean class="org.apache.ignite.configuration.DataStorageConfiguration"&gt;
                  &lt;property name="defaultDataRegionConfiguration"&gt;
                      &lt;bean class="org.apache.ignite.configuration.DataRegionConfiguration"&gt;
                          &lt;property name="persistenceEnabled" value="true" /&gt;
                      &lt;/bean&gt;
                  &lt;/property&gt;
              &lt;/bean&gt;
          &lt;/property&gt;
  
          &lt;!-- Explicitly configure TCP discovery SPI to provide list of initial 
              nodes. --&gt;
              &lt;property name="discoverySpi"&gt;
              &lt;bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi"&gt;
                  &lt;property name="ipFinder"&gt;
                      &lt;!-- Ignite provides several options for automatic discovery that can 
                          be used instead os static IP based discovery. For information on all options 
                          refer to our documentation: http://apacheignite.readme.io/docs/cluster-config --&gt;
                      &lt;!-- Uncomment static IP finder to enable static-based discovery of 
                          initial nodes. --&gt;
                      &lt;!--&lt;bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder"&gt; --&gt;
                      &lt;bean
                          class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder"&gt;
                          &lt;property name="addresses"&gt;
                              &lt;list&gt;
                                  &lt;!-- In distributed environment, replace with actual host IP address. --&gt;
                                  &lt;!-- &lt;value&gt;127.0.0.1:47500..47509&lt;/value&gt; --&gt;
                                  &lt;value&gt;server1&lt;/value&gt;
                                  &lt;value&gt;server2&lt;/value&gt;
                                  &lt;value&gt;server3&lt;/value&gt;
                                  &lt;value&gt;server4&lt;/value&gt;
                              &lt;/list&gt;
                          &lt;/property&gt;
                      &lt;/bean&gt;
                  &lt;/property&gt;
              &lt;/bean&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  &lt;/beans&gt;
  </code></pre>