使用docker 运行,文档参考的官方的5 分钟学习文档

拉取镜像

docker pull apachegeode/geode

启动

docker run -it -p 10334:10334 -p 7575:7575 -p 1099:1099 -p 40404:40404  apachegeode/geode

初始化数据

容器内

start locator
start server
create region --name=hello --type=REPLICATE 

提示信息

create region --name=hello --type=REPLICATE 
     Member | Status
---------------- | ---------------------------------------------
fix-powerful-cup | Region "/hello" created on "fix-powerful-cup"
 
 

简单运行

因为使用了容器,同时我们需要配置一个简单hosts 别名

/etc/hosts
127.0.0.1 55bbae309e69
 

使用maven 管理

  • 项目结构
├── pom.xml
└── src
    ├── main
    │ ├── java
    │ │ └── com
    │ │ └── dalong
    │ │ └── Application.java
    │ └── resources
    └── test
        ├── java
        └── resources
 
 
  • 代码说明
    pom.xml
 
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.dalong.app</groupId>
  <artifactId>dw-jdbc-app</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <dependencies>
   <dependency>
        <groupId>org.apache.geode</groupId>
        <artifactId>geode-core</artifactId>
        <version>1.8.0</version>
    </dependency>
  </dependencies>
</project>
 
 

application.java

package com.dalong;
import java.util.Map;
import org.apache.geode.cache.Region;
import org.apache.geode.cache.client.*;
public class Application {
  public static void main(String[] args) {
    ClientCache cache = new ClientCacheFactory()
        .addPoolLocator("localhost", 10334)
         .create();
          Region<String, String> region = cache
            .<String, String>createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY)
            .create("hello");
          region.put("1", "Hello");
          region.put("2", "World");
          for (Map.Entry<String, String> entry : region.entrySet()) {
            System.out.format("key = %s, value = %s\n", entry.getKey(), entry.getValue());
          }
          cache.close();
  }
}
 
 
  • 运行效果
[info 2019/01/10 16:02:11.749 CST <main> tid=0x1] initializing InternalDataSerializer with 0 services
[info 2019/01/10 16:02:11.784 CST <main> tid=0x1] [ThreadsMonitor] New Monitor object and process were created.
[info 2019/01/10 16:02:11.812 CST <StatSampler> tid=0x11] Disabling statistic archival.
[info 2019/01/10 16:02:11.839 CST <main> tid=0x1] Running in client mode
[info 2019/01/10 16:02:11.955 CST <main> tid=0x1] AutoConnectionSource UpdateLocatorListTask started with interval=10000 ms.
[info 2019/01/10 16:02:11.957 CST <main> tid=0x1] Pool DEFAULT started with multiuser-authentication=false
[info 2019/01/10 16:02:12.004 CST <poolTimer-DEFAULT-3> tid=0x1a] Updating membership port. Port changed from 0 to 52778. ID is now bogon(71460:loner):0:b16ec836
key = 1, value = Hello
key = 2, value = World
[info 2019/01/10 16:02:12.084 CST <main> tid=0x1] GemFireCache[id = 1097897234; isClosing = true; isShutDownAll = false; created = Thu Jan 10 16:02:11 CST 2019; server = false; copyOnRead = false; lockLease = 120; lockTimeout = 60]: Now closing.
[info 2019/01/10 16:02:12.132 CST <main> tid=0x1] Destroying connection pool DEFAULT
 

说明

apache geode 功能还是很强大的,同时也很灵活

参考资料

https://cwiki.apache.org/confluence/display/GEODE/Index#Index-Geodein5minutesGeodein5minutes
https://hub.docker.com/r/apachegeode/geode
https://github.com/rongfengliang/geode-java-demo

apache geode 试用的更多相关文章

  1. Apache Geode with Spark

    在一些特定场景,例如streamingRDD需要和历史数据进行join从而获得一些profile信息,此时形成较小的新数据RDD和很大的历史RDD的join. Spark中直接join实际上效率不高: ...

  2. 一文读懂Apache Geode缓存中间件

    目录 一.对缓存中间件的诉求 1.1 我们为什么需要缓存中间件 1.2 缓存的分类 1.1.1 弱势缓存 1.1.2 强势缓存 二.什么是Apache Geode 2.1 Apache Geode的架 ...

  3. apache phoenix 安装试用

    备注:   本次安装是在hbase docker 镜像的基础上配置的,主要是为了方便学习,而hbase搭建有觉得   有点费事,用镜像简单.   1. hbase 镜像 docker pull har ...

  4. Geode集群搭建

    Geode集群搭建 1.下载安装包 http://mirror.bit.edu.cn/apache/geode/1.2.0/ 2.安装解压后即可直接使用 apache-geode-1.2.0 3.进入 ...

  5. 盘点Apache毕业的11个顶级项目

    自1999年成立至今,Apache 软件基金会已成功建立起自己强大的生态圈.其社区涌现了非常多优秀的开源项目,同时有越来越多国内外项目走向这个国际开源社区进行孵化.据悉,目前所有的 Apache 项目 ...

  6. Geode member发现机制

    Geode member发现机制 Apache Geode 为集群和客户端服务器间提供了多种member 发现机制,具体如下: Peer Member Discovery Standalone Mem ...

  7. Java实现FTP上传下载功能

    Java FTP客户端工具包很多,在此我选用的Apache的FTPClient.这个包的获取可以通过http://commons.apache.org/net/来获取,我使用的是最新的commons- ...

  8. Flink - Juggling with Bits and Bytes

    http://www.36dsj.com/archives/33650 http://flink.apache.org/news/2015/05/11/Juggling-with-Bits-and-B ...

  9. PHP 安装与配置(WIN10)

    需要在本地搭个PHP的测试环境,顺手将过程写了下来. 由于不是生产环境,我这里直接选择了最新的PHP版本用来测试. 本地坏境为:windows 10 Pro 1709 PHP版本:php-7.2.3- ...

随机推荐

  1. 异步IO(协程,消息循环队列)

    同步是CPU自己主动查看IO操作是否完成,异步是IO操作完成后发出信号通知CPU(CPU是被通知的) 阻塞与非阻塞的区别在于发起IO操作之后,CPU是等待IO操作完成再进行下一步操作,还是不等待去做其 ...

  2. xshell无法在小键盘输入数字

    自从很久之前用小键盘输入数字后出现奇怪的字母并换行后就不用小键盘,今天脑抽又用小键盘写数字,并决定解决问题. 原因分析: 当xshell终端类型不是"VT220"或者"A ...

  3. (C/C++学习笔记) 二十四. 知识补充

    二十四. 知识补充 ● 子类调用父类构造函数 ※ 为什么子类要调用父类的构造函数? 因为子类继承父类,会继承到父类中的数据,所以子类在进行对象初始化时,先调用父类的构造函数,这就是子类的实例化过程. ...

  4. Android : 跟我学Binder --- (1) 什么是Binder IPC?为何要使用Binder机制?

    目录: Android : 跟我学Binder --- (1) 什么是Binder IPC?为何要使用Binder机制? Android : 跟我学Binder --- (2) AIDL分析及手动实现 ...

  5. Linux下安装微信(转)

    扩展:https://www.cnblogs.com/dunitian/p/9124806.html 安装过程如下: 1.下载最新版本tar.gz压缩包https://github.com/geeee ...

  6. 「版本升级」MyEclipse CI 2018.12.0正式发布

    新版本MyEclipse为WildFly 14新增一个新的服务器连接器,改进性能并新增一些Java 10修复程序.新版本为IDE做了几个核心修复,这是MyEclipse 2018一个更棒的升级. [M ...

  7. MySQL存储过程错误No data - zero rows fetched, selected, or processed

    原因:游标没有获取到任何内容! 解决方案 : 声明一个 continue handler declare continue handler for not found set V_NotFound = ...

  8. CodeForces ~ 996

    Allen has a LOT of money. He has nn dollars in the bank. For security reasons, he wants to withdraw ...

  9. 10个HTML5美化版复选框和单选框

    单选框Radiobox和复选框checkbox在网页中也十分常见,虽然它没有按钮的交互性强,但是如果能把它们像按钮那样美化一下,那也是非常不错的.本文收集了10个相对比较漂亮的美化版单选框和复选框,希 ...

  10. Creating and Destroying Objects

    Consider static factpry methods instead of construction 四个优点两个缺点 One advantage of static factory met ...