å æ¥ãApache Geode 1.0.0-incubating.M1ããªãªãŒã¹ãããŸããã
Apache Geode — Performance is key. Consistency is a must.
[ANNOUNCE] Apache Geode (incubating) release 1.0.0-incubating.M1
Apache Geode announces the first incubation release version 1.0.0-incubating.M1! URL
ãŸã 1.0.0ã®M1ãšããæ®µéã§ã¯ãããŸãããäžå¿ãã£ã¹ããªãã¥ãŒã·ã§ã³ã®ããŠã³ããŒããªã©ãã§ããããã«ãªã£ãã®ã§ã詊ããŠã¿ãããšæããŸãã
Apache Geodeã£ãŠïŒ
Pivotal GemFireãOSSã«ãªã£ããã®ããšããæãã§ãã
Hello Geode: Pivotal GemFire is now open source | InfoWorld
Pivotal Releases “Geode” - The In-Memory Database Powering Pivotal GemFire | Press Release | Pivotal
Apache Geodeèªèº«ã®ãµã€ãã¯ããã¡ãã
Apache Geode — Performance is key. Consistency is a must.
èªåèªèº«ã¯GemFireã¯è§Šã£ãããšããªãã®ã§ãããIn Memory Data Gridã®äžçš®ãšããäœçœ®ã¥ãã§æããã°ãããããªæãã§ããã
説æãšããŠã¯ãããŒã¿ãè€æ°ããã»ã¹ã«è·šã£ãŠç®¡çå¯èœãªã忣ããŒã¿ç®¡çïŒäž»ãšããŠã€ã³ã¡ã¢ãªïŒãã©ãããã©ãŒã ãšãªã£ãŠããŸãã
http://geode.docs.pivotal.io/docs/getting_started/geode_overview.html
äž»ãªæ©èœã¯ããã¡ãã«èšèŒããããŸãã
http://geode.docs.pivotal.io/docs/getting_started/product_intro.html
- Peer-to-PeerãClientïŒServerã«ããæ§æããšãããšãå¯èœ
- 忣ã·ã¹ãã ã«åå ããã¡ã³ããŒã远å ããããšã§ãã¹ã±ãŒã«å¯èœ
- ãã£ãã·ã¥ã®åæïŒé忿޿°
- äœã¬ã€ãã³ã·ã«ããéåæã®ã€ãã³ãéç¥ãã¡ãã»ãŒãžé éã®ä¿èšŒ
- JTAãµããŒã
- ã¯ã©ã¹ã¿ã®èšå®ããå¥ã®ã¯ã©ã¹ã¿ãžéãããšãã§ãã
- HTTPã«ãããªã¢ãŒã管ç
- REST API
- ããŒãžã§ã³ã¢ããæã®Rolling Upgrade
ãšãã£ããšããã
ãœãŒã¹ããã±ãŒãžãšãããã¥ã¡ã³ããããã£ãšèŠãŠããéãã¯ããããç©éã®æ©èœãåºãŠãããã§ããããšããããè§Šãã¯ãããªãšããã§ã
ããã¥ã¡ã³ãã¯ã以äžã®2ç®æããèŠãŠããããšã«ãªããŸãã
Documentation
http://geode.docs.pivotal.io/
Wiki
Index - Geode - Apache Software Foundation
ãã ãããã ãã§ã¯ã¡ãã£ãšè¶³ããªãã®ã§ãçŸæç¹ã§ã¯GemFireã®ãã®ãå¿ èŠã«å¿ããŠåç §ããæ¹ããããããããŸããã
Pivotal GemFire® Documentation | Pivotal GemFire Docs
Javadoc
GemFire Java API Documentation
ããã§ã¯ã䜿ã£ãŠãã£ãŠã¿ãããšã«ããŸãããã
ã€ã³ã¹ããŒã«
ããããã¯ãApache Geodeã®ã€ã³ã¹ããŒã«ãšãç°¡åãªãµã³ãã«ããã°ã©ã ãæžããŠåäœç¢ºèªããŠã¿ãããšæããŸãã
ãã®ããããåèã«ã
Index - Geode - Apache Software Foundation
http://geode.docs.pivotal.io/docs/getting_started/15_minute_quickstart_gfsh.html
ã€ã³ã¹ããŒã«ã®äºåæ¡ä»¶ãšããŠã¯ãJDK 8以äžãšJAVA_HOMEãèšå®ããŠPATHãéããŠãããããã§ãã
http://geode.docs.pivotal.io/docs/getting_started/system_requirements/host_machine.html
http://geode.docs.pivotal.io/docs/getting_started/installation/install_standalone.html
ãã ãè€æ°ãã¹ãã§äœ¿ãå Žåã¯ãæå»åæãšååè§£æ±ºã«æ°ãã€ããŠãããšã
ã§ã¯ãé²ããŸãã
ãŸãã¯ããã£ã¹ããªãã¥ãŒã·ã§ã³ãããŠã³ããŒãããŸãã
http://geode.incubator.apache.org/releases/
ä»åã¯ããapache-geode-1.0.0-incubating.M1.tar.gzããããŠã³ããŒãããŸãããå±éã
$ tar -zxvf apache-geode-1.0.0-incubating.M1.tar.gz
ã€ã³ã¹ããŒã«ã¯ããã®ãããã§ãã
ãµãŒããŒåŽã®çšæ
å±éãããã£ã¹ããªãã¥ãŒã·ã§ã³ã®binãã£ã¬ã¯ããªã«ãããgfshãšãããã®ãèµ·åããŸãã
$ apache-geode-1.0.0-incubating.M1/bin/gfsh
_________________________ __
/ _____/ ______/ ______/ /____/ /
/ / __/ /___ /_____ / _____ /
/ /__/ / ____/ _____/ / / / /
/______/_/ /______/_/ /_/ v1.0.0-incubating.M1
Monitor and Manage GemFire
gfsh>
ãã£ã¡ãGemFireã£ãŠåºãŸããâŠã
ããã¥ã¡ã³ãã«ç¿ããLocatorãšServerãéå§ããŸãã
## Locatorãèµ·å gfsh>start locator --name=locator ## Serverãèµ·å gfsh>start server --name=server
ãã®æãLocatorãšServerã¯å¥ããã»ã¹ã§èµ·åããŸãã
ç¶ããŠãRegionãäœæããŸãã
â»ããã¥ã¡ã³ãããRegionã®ååã¯å€ããŠããŸããâŠ
gfsh>create region --name=sampleRegion --type=REPLICATE Member | Status ------ | ------------------------------------------ server | Region "/sampleRegion" created on "server"
ãããŸã§ã§ããµãŒããŒåŽã®æºåã¯ãçµãã§ãã
ã¯ã©ã€ã¢ã³ãåŽã®ã³ãŒããæžã
ããã§ã¯ããããŸã§ã«çšæãããµãŒããŒãå©çšããã¢ããªã±ãŒã·ã§ã³ãæžããŠã¿ãŸãã
MavenäŸåé¢ä¿ã«ã¯ã以äžã®ããã«èšå®ããŸãã
â»JUnitãšAssertJã¯ãã¹ãã³ãŒãçšã§ã
<dependency> <groupId>org.apache.geode</groupId> <artifactId>gemfire-core</artifactId> <version>1.0.0-incubating.M1</version> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.12</version> <scope>test</scope> </dependency> <dependency> <groupId>org.assertj</groupId> <artifactId>assertj-core</artifactId> <version>3.3.0</version> <scope>test</scope> </dependency>
artifactIdããgemfire-coreããªãã§ããâŠã
importæãªã©ã¯ããããªæãã§çšæããŸããã
src/test/java/org/littlewings/geode/ClientServerSimpleTest.java
package org.littlewings.geode; import com.gemstone.gemfire.cache.Region; import com.gemstone.gemfire.cache.RegionDestroyedException; import com.gemstone.gemfire.cache.client.ClientCache; import com.gemstone.gemfire.cache.client.ClientCacheFactory; import com.gemstone.gemfire.cache.client.ClientRegionShortcut; import com.gemstone.gemfire.cache.client.ServerOperationException; import org.junit.Test; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; public class ClientServerSimpleTest { // ããã«ããã¹ãã³ãŒããæžãïŒ }
ãŸãã¯ãGetting Startedã«èŒã£ãŠãããããªãµã³ãã«ãèšèŒã
@Test public void gettingStarted() { ClientCache cache = new ClientCacheFactory() .addPoolLocator("localhost", 10334) // ããã©ã«ãïŒlocalhost:10334ïŒãªããæžããªããŠãOK .create(); try { Region<String, String> region = cache .<String, String>createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY) .create("sampleRegion"); region.put("key1", "value1"); assertThat(region.get("key1")) .isEqualTo("value1"); region.put("key2", "value2"); assertThat(region.get("key2")) .isEqualTo("value2"); region.remove("key2"); assertThat(region.get("key2")) .isNull(); assertThat(region.containsKey("key1")) .isTrue(); region.close(); } finally { cache.close(); } }
Regionãjava.util.ConcurrentMapãç¶æ¿ããŠããŠãMapãšåæ§ãªæäœãè¡ãããšãã§ããŸãã
ãŸããäºåã«RegionãäœæããŠããŸããããååšããªãRegionãæå®ãããšãRegionã®æäœæã«ãšã©ãŒã«ãªãããã§ãã
@Test public void missingRegion() { ClientCache cache = new ClientCacheFactory() .create(); try { Region<String, String> region = cache .<String, String>createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY) .create("notFoundRegion"); assertThatThrownBy(() -> region.put("key1", "value1")) .isInstanceOf(ServerOperationException.class) .hasMessageContaining("While performing a remote put") .hasCauseInstanceOf(RegionDestroyedException.class); region.close(); } finally { cache.close(); } }
ç°å¢ããæŽããŠããŸãã°ãåããããšèªäœã¯ããé£ãããªãããã§ãã
ã§
ãšãŸããGetting Startedã®åãã¿ãããªæãã§é²ããŸãããã説æãé£ã°ãããã®ããããŸããããããã«ã€ããŠãã¡ãã£ãšããã¥ã¡ã³ããèŠãçšåºŠã§ããæžããŠãããŸãã
Locator
æåã«èµ·åããããã»ã¹ã§ãã
http://geode.docs.pivotal.io/docs/configuring/running/running_the_locator.html
忣ã·ã¹ãã ã«ããããã¡ã³ããŒã管çããããã»ã¹ã«ãªããŸãããã®ããã»ã¹ãããªããšãä»ã®ããã»ã¹ïŒServerãClientïŒãããŸãåäœã§ããŸããã
ãšãããã1çªæåã«æ¥ç¶ãã«ããããšããŸãã
忢ããå Žåã¯
â»--name以å€ã«ãã--pidã§PIDãæå®ããŠã®åæ¢ãå¯èœã§ã
gfsh>stop locator --name=locator
ãšå®è¡ããŸããããã®æServerããã»ã¹ãèµ·åãããŸãŸã ãšãgfshããServerãæäœã§ããªããªããŸãâŠã
ãŸããèµ·åæã«ïŒãã£ã¬ã¯ããªãæå®ããªããã°ïŒã«ã¬ã³ããã£ã¬ã¯ããªã«ãLocatoråãã®ãã£ã¬ã¯ããªãã§ããããã§ããäœããããã£ã¬ã¯ããªåã¯ãLocatorã®ååïŒ--nameã§æå®ããå€ïŒãåæ ãããŸãã
$ ll locator/ åèš 172 drwxrwxr-x 5 xxxxx xxxxx 4096 2æ 14 15:36 ./ drwxrwxr-x 6 xxxxx xxxxx 4096 2æ 14 15:21 ../ drwxrwxr-x 2 xxxxx xxxxx 4096 2æ 14 15:36 ConfigDiskDir_locator/ drwxrwxr-x 3 xxxxx xxxxx 4096 2æ 14 15:21 GemFire_xxxxx/ drwxrwxr-x 3 xxxxx xxxxx 4096 2æ 14 15:21 cluster_config/ -rw-rw-r-- 1 xxxxx xxxxx 139424 2æ 14 15:36 locator.log -rw-rw-r-- 1 xxxxx xxxxx 312 2æ 14 15:36 locator10334view.dat -rw-rw-r-- 1 xxxxx xxxxx 1290 2æ 14 15:36 locator10334views.log -rw-rw-r-- 1 xxxxx xxxxx 5 2æ 14 15:36 vf.gf.locator.pid
ãšããããã§ãNodeéã®éä¿¡æã«å¿ èŠãªããã»ã¹ã£ãœãã§ããã
ClientïŒServerã®Node Discoveryã®é°å²æ°ã¯ããã¡ãã®ããã¥ã¡ã³ããèŠãã°ããããã§ãã
Locatorãéå§ããæã«ã¯ãããããã®ãªãã·ã§ã³ãæå®ã§ãããããªã®ã§ãâŠã
gfsh>start locator --name=locator -- --bind-address --classpath --force --group --hostname-for-clients --include-system-classpath --locators --log-level --mcast-address --mcast-port --port --dir --properties-file --security-properties-file --initial-heap --max-heap --J --connect --enable-cluster-configuration --load-cluster-configuration-from-dir --cluster-config-dir
Server
ç¶ããŠãServerã
http://geode.docs.pivotal.io/docs/configuring/running/running_the_cacheserver.html
ãã¡ãã¯ãäž»ãšããŠããŒã¿ã管çããããã»ã¹ã«ãªãããã§ããRegionã«putãããããããŒã¿ã¯ããã¡ããæã£ãŠããããã§ãããã®ãããä»åæžããããã°ã©ã ã ãšClientãçµäºããŠãããŒã¿ã¯æ®ããŸãããServerãåèµ·åãããšããŒã¿ã¯å€±ãããŸãã
LocatorãšåãããServerã忢ããå Žåã¯ä»¥äžã®ã³ãã³ãã§ã
â»--name以å€ã«ãã--pidã§PIDãæå®ããŠã®åæ¢ãå¯èœã§ã
gfsh>stop server --name=server
äžèšã³ãã³ãã§åæ¢ããå Žåã¯ãLocatorãåäœããŠããªããšããŸããããŸããããã®å Žåã¯ãPIDãæå®ããŠïŒ--pidïŒæ¢ãããšããã§ãããã
ServeråŽãã--nameã§æå®ããååã§ãã£ã¬ã¯ããªãã§ãããããŸãã
$ ll server/ åèš 36 drwxrwxr-x 2 xxxxx xxxxx 4096 2æ 14 15:21 ./ drwxrwxr-x 7 xxxxx xxxxx 4096 2æ 14 15:38 ../ -rw-rw-r-- 1 xxxxx xxxxx 21984 2æ 14 15:36 server.log -rw-rw-r-- 1 xxxxx xxxxx 5 2æ 14 15:21 vf.gf.server.pid
ãã¡ãããèšå®ã§ãããªãã·ã§ã³å€ãã§ããã
gfsh>start server --name=server -- --assign-buckets --bind-address --cache-xml-file --classpath --critical-heap-percentage --critical-off-heap-percentage --dir --disable-default-server --disable-exit-when-out-of-memory --enable-time-statistics --eviction-heap-percentage --eviction-off-heap-percentage --force --group --hostname-for-clients --include-system-classpath --initial-heap --J --locators --locator-wait-time --lock-memory --log-level --max-connections --max-heap --max-message-count --max-threads --mcast-address --mcast-port --memcached-port --memcached-protocol --memcached-bind-address --redis-port --redis-bind-address --redis-password --message-time-to-live --off-heap-memory-size --properties-file --rebalance --security-properties-file --server-bind-address --server-port --socket-buffer-size --spring-xml-location --statistic-archive-file --use-cluster-configuration
Region
Apache Geodeã®ã³ã¢ãããã¯ãã ããã§ã
http://geode.docs.pivotal.io/docs/basic_config/data_regions/chapter_overview.html#data_regions
ãã£ãã·ã¥ã«ç»é²ãããããŒã¿ãæã¡ãputïŒgetïŒqueryãªã©ã®åçš®æäœãå®è¡ããããšãã§ããŸãã
Regionã®çš®é¡ã¯ReplicatedãPartitionedãªã©ãããããããŸãã
http://geode.docs.pivotal.io/docs/developing/region_options/region_types.html
ä»åã¯ãREPLICATEãRegion Shortcutã䜿ã£ãŠæå®ããŸããã
http://geode.docs.pivotal.io/docs/reference/topics/region_shortcuts_table.html
æ¬æ¥ãªããããŒã¿ãå šNodeã«æã€ã¿ã€ãã®èšå®ã§ãããä»åã¯Serverã1Nodeããããªãã®ã§ãããŸãé¢ä¿ãªãã§ããã©ãâŠã
ã¡ãªã¿ã«ãä»ã®In Memory Data Gridã ãšApache Geodeã§ããRegionãCacheãªã©ã®ååã«ãªã£ãŠããããCacheãCacheManagerãšãã®ååã«ãªã£ãŠãããããã€ã¡ãŒãžããã£ãã®ã§ãæåæžæããŸããâŠã
ãŸãšã
ãšããããã§ãApache Geodeãããã£ãšã§ãã䜿ã£ãŠããããŸã§ã®èª¬æãç°¡åã«æžããŠã¿ãŸããã
ãªããªãæ©èœãå€ãããªã®ãšãæ £ãããŸã§æéãããããããªæ°ãããã®ã§ããâŠãã€ããŒã¹ã«èŠãŠãããããªãšã
ããšããŸã 1.0.0-incubating.M1ãšããæ®µéãªã®ã§ãä»åŸããã£ããå€ãããã ãããªããšæãã€ã€ãæ©ã1.0.0ããªãªãŒã¹ããããšãããªããšæããŸãã