GithubHelp home page GithubHelp logo

aeron-cluster-demo's Introduction

aeron-cluster-demo

这是一个 aeron cluster 的 demo 模版。此项目使用一个脚本完成项目编译打包部署并基于 docker 启动集群多节点和 nacos 服务。自定义 docker network 完成集群节点通信和 nacos 服务注册;

img_1.png

快速开始

前置条件 -[ ] MacOS -[ ] 安装且配置 mavendocker Desktop

# MacOS
open /Applications/Docker.app
git clone https://github.com/NTP1996/aeron-cluster-demo.git
cd aeron-cluster-demo
sh quickDocker.sh

部署完成后,点击链接能够访问对应服务; nacos

node0

node1

node2

使用docker desktop 查看各应用日志 img.png

raftlogData

提交到集群的数据是一个(Long,String)元素,集群维护一个Map<Long, String>

# raftlogData:[key|valueLength|value]
public static int encoder(MutableDirectBuffer buffer, Long key, String value) {
        buffer.putLong(0, key);
        buffer.putInt(8, value.length());
        buffer.putBytes(12, value.getBytes());
        int length = 12 + value.length();
        return length;
    }

todo

  • 2.0 raftlog 跨容器生命周期持久化 + snapshot
  • 3.0 raftlog 消费应用

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.