Thanks in advance. 

I am basically using the sample xml provided for Ignite
TcpDiscoveryVmIpFinder, but with Cassandra third party persistence. 

public Ignite startIgnite {
IgniteConfiguration cfg = new IgniteConfiguration();
CacheConfiguration<String, POJOExample> configuration = new
CacheConfiguration<String, POJOExample>();

configuration.setName("test-cache");
configuration.setIndexedTypes(String.class, ValueClass.class);
    DataSource dataSource = new DataSource();
    dataSource.setContactPoints(""); // Here, I am basically putting my
remote server addresses. 
    RoundRobinPolicy robinPolicy = new RoundRobinPolicy();
    dataSource.setLoadBalancingPolicy(robinPolicy);
    dataSource.setReadConsistency("ONE");
    dataSource.setWriteConsistency("ONE");
    String persistenceSettingsXml = FileUtils.readFileToString(new
File(persistenceSettingsConfig), "utf-8");
    KeyValuePersistenceSettings persistenceSettings = new
KeyValuePersistenceSettings(persistenceSettingsXml);
    CassandraCacheStoreFactory cacheStoreFactory = new
CassandraCacheStoreFactory();
    cacheStoreFactory.setDataSource(dataSource);
    cacheStoreFactory.setPersistenceSettings(persistenceSettings);
    configuration.setCacheStoreFactory(cacheStoreFactory);
    configuration.setWriteThrough(true);
    configuration.setReadThrough(true);
    configuration.setWriteBehindEnabled(true);
    
//  Setting cache configuration
cfg.setCacheConfiguration(configuration);

TcpDiscoverySpi spi = setTcp();

cfg.setPeerClassLoadingEnabled(true); 
cfg.setDeploymentMode(DeploymentMode.CONTINUOUS);
cfg.setClientConnectorConfiguration(new ClientConnectorConfiguration());        
        

// Override default discovery SPI.
cfg.setDiscoverySpi(spi);


//  Starting Ignite
Ignite ignite = Ignition.getOrStart(cfg);
return ignite; 
}

        public TcpDiscoverySpi setTcp() {
                TcpDiscoverySpi spi = new TcpDiscoverySpi();
                
                TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder(); 
        
                // Set initial IP addresses.
                // Note that you can optionally specify a port or a port range.
                
ipFinder.setAddresses(Arrays.asList("111.111.111.111:47500..47509"));
                 
                spi.setIpFinder(ipFinder);
                
                return spi;
        }

*Persistency Settings:*
<persistence keyspace="ignite" table="odbc_test" ttl="86400">
    <keyspaceOptions>
        REPLICATION = {'class' : 'SimpleStrategy', 'replication_factor' : 1}
        AND DURABLE_WRITES = true
    </keyspaceOptions>
    <tableOption>
        comment = 'Cache test'
        AND read_repair_chance = 0.2
    </tableOption>
    <keyPersistence class="java.lang.String" strategy="PRIMITIVE"
column="key"/>
    <valuePersistence class="com.sample.ignite.POJOExample"
strategy="POJO"/>
</persistence>



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

Reply via email to