Giriş
Açıklaması şöyle. Snapshot sistem canlı iken de alınabilir.
Snapshots can be taken online, when the cluster is active and accessible to users. An Ignite snapshot includes a cluster-wide copy of all data records that exist at the moment the snapshot is started. All snapshots are consistent — in terms of concurrent, cluster-wide operations as well as in terms of ongoing changes in Ignite Persistence data, index, schema, binary metadata, marshaller, and other files on nodes.
Aslında bu işleme backup ta denilebilirdi ancak Açıklaması şöyle
The main reason why GridGain snapshots are not called "backups" is to avoid confusion with Apache Ignite backup copies of data stored in the cluster.
GridGain ve Apache Ignite snapshot için farklı komutlar kullanıyorlar. GridGain snapshot-utility komutunu kullanıyor. Apache Ignite ise control komutunu kullanıyor
Snapshot Türleri
GridGain Ultimate Edition ve Apache Ignite farklı Snapshot yeteneklerine sahipler. Karşılaştırmayı gösteren bir tablo burada
Ve de şu kavramları bilmek gerekiyor.
Full Snapshot
Incremental Snapshot
Per-Cache Snapshot
Point-in-Time Recovery
Network Backup
Heterogeneous Recovery
Apache Ignite Snapshot
Örnek
Şöyle yaparız
#Create a cluster snapshot: control.(sh|bat) --snapshot create snapshot_name #Cancel a running snapshot: control.(sh|bat) --snapshot cancel snapshot_name #Kill a running snapshot: control.(sh|bat) --kill SNAPSHOT snapshot_name
Örnek
Şöyle yaparız
// Start snapshot operation. ignite.snapshot().createSnapshot("snapshot_02092020").get();
Örnek
Benim yaptığım denemelerde thick client bile olsa persistence yeteneğini eklemek gerekti. Yoksa şöyle bir exception fırlatıyordu
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
Kod şöyle
IgniteConfiguration cfg = new IgniteConfiguration(); DataStorageConfiguration dataStorageConfiguration = new DataStorageConfiguration(); DataRegionConfiguration defaultDataRegionConfiguration = dataStorageConfigurationa .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();
GG Snapshot
Örnek - Full Snapshot
Şöyle yaparız
try (Ignite ignite = Ignition.start("examples/config/example-ignite.xml")) {// Get a reference to GridGain plugin.GridGain gg = ignite.plugin(GridGain.PLUGIN_NAME);// Get a reference to the Snapshots.GridSnapshot storage = gg.snapshot();// Create the snapshot. Data of all the caches will be added to the snapshot.SnapshotFuture future = storage.createFullSnapshot(null,"Snapshot has been created!");// Wait while the snapshot is being created.future.get();}
Hiç yorum yok:
Yorum Gönder