Ignite thick client can not create snapshot unless it configures DataStorageConfiguration as persistent

Viewed 74

I am using ignite 2.11.0. I have a cluster with two nodes. Both use native persistence. I coded a simple thick client that connects to this cluster and I would like to trigger a snapshot from my code. However if i do like this

IgniteConfiguration cfg = new IgniteConfiguration();

//DataStorageConfiguration dataStorageConfiguration = new DataStorageConfiguration();
//DataRegionConfiguration defaultDataRegionConfiguration = dataStorageConfiguration.getDefaultDataRegionConfiguration();
//defaultDataRegionConfiguration.setPersistenceEnabled(true);
//
//cfg.setDataStorageConfiguration(dataStorageConfiguration);

cfg.setClientMode(true);

// Setting up an IP Finder to ensure the client can locate the servers.
TcpDiscoveryMulticastIpFinder ipFinder = new TcpDiscoveryMulticastIpFinder();
ipFinder.setAddresses(Collections.singletonList("127.0.0.1:47500..47509"));
cfg.setDiscoverySpi(new TcpDiscoverySpi().setIpFinder(ipFinder));

// Starting the node
Ignite ignite = Ignition.start(cfg);
IgniteSnapshot snapshot = ignite.snapshot();
IgniteFuture<Void> future = snapshot.createSnapshot("mysnapshot");
future.get();

I get

"SEVERE: Cluster-wide snapshot operation failed: class org.apache.ignite.IgniteException: Create snapshot request has been rejected. Snapshots on an in-memory clusters are not allowed"

If I uncomment the getDefaultDataRegionConfiguration section. I can take a snapshot. I do not understand why my thick client needs persistence.

1 Answers

The thick client doesn't take the snapshot itself, rather it sends a request to the server nodes asking for a snapshot to be taken. A Snapshot requires that persistence be enabled in the cluster. The function snapshot.createSnapshot("mysnapshot") does a check on the local config to make sure that persistence is enabled, thus the error.

Related