IgniteCheckedException: Two MemoryPolicies have the same name: default

classic Classic list List threaded Threaded
2 messages Options
Pedrotti Michele Pedrotti Michele
Reply | Threaded
Open this post in threaded view
|

IgniteCheckedException: Two MemoryPolicies have the same name: default

Hello,

I have a simple local installation of ignite 2.7.0 on my laptop (springboot client application). When I declare my igniteInstance (Ignite Server is on another laptop) I have this exception:

Caused by: class org.apache.ignite.IgniteCheckedException: Failed to start processor: GridProcessorAdapter []

     at org.apache.ignite.internal.IgniteKernal.startProcessor(IgniteKernal.java:1703)

     at org.apache.ignite.internal.IgniteKernal.start(IgniteKernal.java:1016)

     at org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.start0(IgnitionEx.java:2038)

     at org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.start(IgnitionEx.java:1730)

     at org.apache.ignite.internal.IgnitionEx.start0(IgnitionEx.java:1158)

     at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:678)

     at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:603)

     at org.apache.ignite.Ignition.start(Ignition.java:323)

Caused by: class org.apache.ignite.IgniteCheckedException: Two MemoryPolicies have the same name: default

     at org.apache.ignite.internal.processors.cache.persistence.IgniteCacheDatabaseSharedManager.checkDataRegionName(IgniteCacheDatabaseSharedManager.java:601)

1) Why I can set MemoryPolicies client-side? Is the Ignite Server not properly configured?

This is my configuration (igniteInstance):

@Getter

@Setter

@Validated

@ConfigurationProperties("presence-persistence")

public class ConsumerProperties {

   

    private String url   

    private IgniteConfig ignite = new IgniteConfig();

   

    @Getter

    @Setter

    @Validated

    public static class IgniteConfig {

        @NotEmpty

        private List<String> servers = new ArrayList<>();

       

        @Positive

        private long retryTimeout;

    }

}

    @Bean

    public Ignite igniteInstance(ConsumerProperties props) {

       

        try {

            final IgniteConfiguration config = new IgniteConfiguration();

            final TcpDiscoverySpi addressResolver;

    

            CacheConfiguration<String, PresenceStateEntity>

                cache = new CacheConfiguration<>(CACHE_NAME);

            cache.setIndexedTypes(String.class, PresenceStateEntity.class);

           

//            final TcpDiscoveryMulticastIpFinder finder;

//            finder = new TcpDiscoveryMulticastIpFinder();

           

            final TcpDiscoveryVmIpFinder finder;

            finder = new TcpDiscoveryVmIpFinder();

           

            finder.setAddresses(props.getIgnite().getServers());

            addressResolver = new TcpDiscoverySpi();

            addressResolver.setIpFinder(finder);

           

            DataRegionConfiguration dataRegionConfigurations = new DataRegionConfiguration();

            dataRegionConfigurations.setPersistenceEnabled(true);

           

            DataStorageConfiguration dsCfg = new DataStorageConfiguration();

            dsCfg.setDataRegionConfigurations(dataRegionConfigurations);

            dsCfg.setMetricsEnabled(false);

            config.setDataStorageConfiguration(dsCfg);

           

            config.setCacheConfiguration(cache);

            config.setDiscoverySpi(addressResolver);

 

//

// Deprecated… and don’t use with DataStorageConfiguration!

//             

//            MemoryConfiguration memCfg = new MemoryConfiguration();

//            MemoryPolicyConfiguration plcCfg = new MemoryPolicyConfiguration();

//            plcCfg.setInitialSize(100 * 1000 * 1000);

//            plcCfg.setMaxSize(200 * 1000 * 1000);

//            plcCfg.setName("myPolicy");

//            memCfg.setMemoryPolicies(plcCfg);

//           

//            config.setMemoryConfiguration(memCfg);

           

            Ignition.setClientMode(true);

           Ignite ignite = Ignition.start(config);

            return ignite;

        } catch (Exception e) {

            e.printStackTrace();

        }

    }

 

Thank you

    Michele

 

 

 

 

Questo messaggio e i suoi allegati sono indirizzati esclusivamente alle persone indicate. La diffusione, copia o qualsiasi altra azione derivante dalla conoscenza di queste informazioni sono rigorosamente vietate. Qualora abbiate ricevuto questo documento per errore siete cortesemente pregati di darne immediata comunicazione al mittente e di provvedere alla sua distruzione, Grazie.

This e-mail and any attachments is confidential and may contain privileged information intended for the addressee(s) only. Dissemination, copying, printing or use by anybody else is unauthorised. If you are not the intended recipient, please delete this message and any attachments and advise the sender by return e-mail, Thanks.

Rispetta l'ambiente. Non stampare questa mail se non è necessario.
ilya.kasnacheev ilya.kasnacheev
Reply | Threaded
Open this post in threaded view
|

Re: IgniteCheckedException: Two MemoryPolicies have the same name: default

Hello!

Why do you need data region on client?

Otherwise, Data Storage Configuration has an implicit default Region. The problem is, you add a new region, also with default name, but you do not replace default Region, placing it besides.

Try using setDefaultDataRegionConfiguration() instead of setDataRegionConfigurations().

Regards,
--
Ilya Kasnacheev


вт, 28 мая 2019 г. в 11:13, Pedrotti Michele <[hidden email]>:

Hello,

I have a simple local installation of ignite 2.7.0 on my laptop (springboot client application). When I declare my igniteInstance (Ignite Server is on another laptop) I have this exception:

Caused by: class org.apache.ignite.IgniteCheckedException: Failed to start processor: GridProcessorAdapter []

     at org.apache.ignite.internal.IgniteKernal.startProcessor(IgniteKernal.java:1703)

     at org.apache.ignite.internal.IgniteKernal.start(IgniteKernal.java:1016)

     at org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.start0(IgnitionEx.java:2038)

     at org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.start(IgnitionEx.java:1730)

     at org.apache.ignite.internal.IgnitionEx.start0(IgnitionEx.java:1158)

     at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:678)

     at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:603)

     at org.apache.ignite.Ignition.start(Ignition.java:323)

Caused by: class org.apache.ignite.IgniteCheckedException: Two MemoryPolicies have the same name: default

     at org.apache.ignite.internal.processors.cache.persistence.IgniteCacheDatabaseSharedManager.checkDataRegionName(IgniteCacheDatabaseSharedManager.java:601)

1) Why I can set MemoryPolicies client-side? Is the Ignite Server not properly configured?

This is my configuration (igniteInstance):

@Getter

@Setter

@Validated

@ConfigurationProperties("presence-persistence")

public class ConsumerProperties {

   

    private String url   

    private IgniteConfig ignite = new IgniteConfig();

   

    @Getter

    @Setter

    @Validated

    public static class IgniteConfig {

        @NotEmpty

        private List<String> servers = new ArrayList<>();

       

        @Positive

        private long retryTimeout;

    }

}

    @Bean

    public Ignite igniteInstance(ConsumerProperties props) {

       

        try {

            final IgniteConfiguration config = new IgniteConfiguration();

            final TcpDiscoverySpi addressResolver;

    

            CacheConfiguration<String, PresenceStateEntity>

                cache = new CacheConfiguration<>(CACHE_NAME);

            cache.setIndexedTypes(String.class, PresenceStateEntity.class);

           

//            final TcpDiscoveryMulticastIpFinder finder;

//            finder = new TcpDiscoveryMulticastIpFinder();

           

            final TcpDiscoveryVmIpFinder finder;

            finder = new TcpDiscoveryVmIpFinder();

           

            finder.setAddresses(props.getIgnite().getServers());

            addressResolver = new TcpDiscoverySpi();

            addressResolver.setIpFinder(finder);

           

            DataRegionConfiguration dataRegionConfigurations = new DataRegionConfiguration();

            dataRegionConfigurations.setPersistenceEnabled(true);

           

            DataStorageConfiguration dsCfg = new DataStorageConfiguration();

            dsCfg.setDataRegionConfigurations(dataRegionConfigurations);

            dsCfg.setMetricsEnabled(false);

            config.setDataStorageConfiguration(dsCfg);

           

            config.setCacheConfiguration(cache);

            config.setDiscoverySpi(addressResolver);

 

//

// Deprecated… and don’t use with DataStorageConfiguration!

//             

//            MemoryConfiguration memCfg = new MemoryConfiguration();

//            MemoryPolicyConfiguration plcCfg = new MemoryPolicyConfiguration();

//            plcCfg.setInitialSize(100 * 1000 * 1000);

//            plcCfg.setMaxSize(200 * 1000 * 1000);

//            plcCfg.setName("myPolicy");

//            memCfg.setMemoryPolicies(plcCfg);

//           

//            config.setMemoryConfiguration(memCfg);

           

            Ignition.setClientMode(true);

           Ignite ignite = Ignition.start(config);

            return ignite;

        } catch (Exception e) {

            e.printStackTrace();

        }

    }

 

Thank you

    Michele

 

 

 

 

Questo messaggio e i suoi allegati sono indirizzati esclusivamente alle persone indicate. La diffusione, copia o qualsiasi altra azione derivante dalla conoscenza di queste informazioni sono rigorosamente vietate. Qualora abbiate ricevuto questo documento per errore siete cortesemente pregati di darne immediata comunicazione al mittente e di provvedere alla sua distruzione, Grazie.

This e-mail and any attachments is confidential and may contain privileged information intended for the addressee(s) only. Dissemination, copying, printing or use by anybody else is unauthorised. If you are not the intended recipient, please delete this message and any attachments and advise the sender by return e-mail, Thanks.

Rispetta l'ambiente. Non stampare questa mail se non è necessario.