ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nitin dharrao <nitin.dhar...@cna.com>
Subject Difference Between Client and Server Ignite Configurations
Date Fri, 18 Jan 2019 15:07:41 GMT
Hello following is my Ignite Configuration for Client App. However the same
configuration also exists for Server Apache Ignite Node except one line (
igniteConfiguration.setClientMode(true);)... 

Is this correct? My idea is to create an instance running on GCP kubernetes
and my Business App which has the following configuration would basically be
creating the cache on GCP Kubernetes cluster. 

Both Ignite and business app will be deployed on GCP Kubernetes. Please let
me know if following what I should have for Ignite Configuration in my
Business App. 


    @Bean
    public Ignite igniteInstance(@Qualifier("igniteConfiguration") final
IgniteConfiguration igniteConfiguration) {
        logger.info(".................IGNITE IS STARTING..................
");
        return Ignition.start(igniteConfiguration);
    }

    @Bean("igniteConfiguration")
    public IgniteConfiguration igniteConfiguration(
            @Value("${ignite.instance.name}") String instanceName,
            @Qualifier("cacheConfiguration") CacheConfiguration<String,
TapBillingCachedData> cacheConfiguration
    ) {
        logger.info("Creating IGNITE-CONFIGURATION Bean for instance {%s}",
instanceName);

        final IgniteConfiguration igniteConfiguration = new
IgniteConfiguration();
        igniteConfiguration.setGridLogger(new Slf4jLogger());
        igniteConfiguration.setIgniteInstanceName(instanceName); // Setting
some custom name for the node.
        igniteConfiguration.setPeerClassLoadingEnabled(true); // Enabling
peer-class loading feature.
        igniteConfiguration.setCacheConfiguration(cacheConfiguration);
        igniteConfiguration.setClientMode(true);
        return igniteConfiguration;
    }


    @Profile("!local")
    @Bean("tcpDiscoverySpi")
    public TcpDiscoverySpi tcpDiscoverySpi(
            @Value("${google.cloud.project.namespace}")
                    String google_cloud_project_namespace,
            @Value("${google.cloud.service.name}")
                    String google_cloud_service_name,
            @Qualifier("igniteConfiguration") final IgniteConfiguration
igniteConfiguration
    ) {
        logger.info("Creating TCP-DISCOVERY-SPI bean");
        final TcpDiscoverySpi spi = new TcpDiscoverySpi();
        final TcpDiscoveryKubernetesIpFinder ipFinder = new
TcpDiscoveryKubernetesIpFinder();
        logger.info("NAME SPACE IS -> " + google_cloud_project_namespace);
        ipFinder.setNamespace(google_cloud_project_namespace);
//        ipFinder.setServiceName(google_cloud_service_name);
        spi.setIpFinder(ipFinder);
        igniteConfiguration.setDiscoverySpi(spi);
        return spi;
    }


    @Bean("cacheConfiguration")
    public CacheConfiguration<String, TapBillingCachedData>
cacheConfiguration(
            @Value("${ignite.cache.name}") String cacheName
    ){
        final CacheConfiguration ccfg = new CacheConfiguration(cacheName);
        ccfg.setIndexedTypes(String.class, TapBillingCachedData.class);
        return ccfg;
    }




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

Mime
View raw message