apache geode 试用
使用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 试用的更多相关文章
- Apache Geode with Spark
在一些特定场景,例如streamingRDD需要和历史数据进行join从而获得一些profile信息,此时形成较小的新数据RDD和很大的历史RDD的join. Spark中直接join实际上效率不高: ...
- 一文读懂Apache Geode缓存中间件
目录 一.对缓存中间件的诉求 1.1 我们为什么需要缓存中间件 1.2 缓存的分类 1.1.1 弱势缓存 1.1.2 强势缓存 二.什么是Apache Geode 2.1 Apache Geode的架 ...
- apache phoenix 安装试用
备注: 本次安装是在hbase docker 镜像的基础上配置的,主要是为了方便学习,而hbase搭建有觉得 有点费事,用镜像简单. 1. hbase 镜像 docker pull har ...
- Geode集群搭建
Geode集群搭建 1.下载安装包 http://mirror.bit.edu.cn/apache/geode/1.2.0/ 2.安装解压后即可直接使用 apache-geode-1.2.0 3.进入 ...
- 盘点Apache毕业的11个顶级项目
自1999年成立至今,Apache 软件基金会已成功建立起自己强大的生态圈.其社区涌现了非常多优秀的开源项目,同时有越来越多国内外项目走向这个国际开源社区进行孵化.据悉,目前所有的 Apache 项目 ...
- Geode member发现机制
Geode member发现机制 Apache Geode 为集群和客户端服务器间提供了多种member 发现机制,具体如下: Peer Member Discovery Standalone Mem ...
- Java实现FTP上传下载功能
Java FTP客户端工具包很多,在此我选用的Apache的FTPClient.这个包的获取可以通过http://commons.apache.org/net/来获取,我使用的是最新的commons- ...
- 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 ...
- PHP 安装与配置(WIN10)
需要在本地搭个PHP的测试环境,顺手将过程写了下来. 由于不是生产环境,我这里直接选择了最新的PHP版本用来测试. 本地坏境为:windows 10 Pro 1709 PHP版本:php-7.2.3- ...
随机推荐
- linux 在执行命令过程中,反单引号(`)这个符号代表的意义为何?
在一串命令中,在`之内的命令将会被先执行,而且执行出来的结果将作为外部的输入信息.例如:uname -r 会显示出目前的内核版本,而我们的内核版本在/lib/modules里面,因此.你可以先执行un ...
- Interlocked单向链式栈
线程同步一大部分与原子访问(atomic access)有关, 所谓原子访问, 指的是一个线程在访问某个资源的同时能够保证没有其他线程会在同一时刻访问同一资源. Interlocked单向链式栈的操作 ...
- L1-053 电子汪
据说汪星人的智商能达到人类 4 岁儿童的水平,更有些聪明汪会做加法计算.比如你在地上放两堆小球,分别有 1 只球和 2 只球,聪明汪就会用“汪!汪!汪!”表示 1 加 2 的结果是 3. 本题要求你为 ...
- Class file collision
ecplise报错,提示:Class file collision (类文件冲突) 原因是:文件保存(编译)后,生成了class文件起了冲突,windows 系统认为Test.class 和test. ...
- <Redis Advance><Pipelining><Memory Optimization><Expire><Transactions>
Overview About Redis pipelining About Redis memory optimization About Redis expire About Redis trans ...
- 『转』VC++ webbrowser函数使用范例
/*============================说明部分================================= 实现一下函数需包含头文件 #include <Winine ...
- 安装vue-cookie
// 安装cookie的命令// npm install vue-cookie --save// 为项目配置全局vue-cookieimport VueCookie from 'vue-cookie' ...
- ajax参考增删改查
AJAX做增删改查详细! <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "htt ...
- Python 进程的其他方法
import time import os from multiprocessing import Process def f1(): print("子进程的pid",os.get ...
- HDU 6092 17多校5 Rikka with Subset(dp+思维)
Problem Description As we know, Rikka is poor at math. Yuta is worrying about this situation, so he ...