Skip to content

kwang2014/cluster

 
 

Repository files navigation

JGroups TankWar Demo

  • JGroups is a toolkit for reliable multicast communication. It can be used to create groups of processes whose members can send messages to each other. Group members can be spread across LANs or WANs. More details refer to http://www.jgroups.org/

  • JGroups is a mature library used by Java Developer millions of time, JGroups TankWar Demo use basic JGroups API, it can be a quick start for Java Developer who want to build group communication application, the original code(GUI) came from my college homework

  • Groups TankWar Demo Source Code ./jgroups/tankwar

Build and Generate demo home
JGroups TankWar Demo Architecture
JGroups TankWar Architecture

Key feature of JGroups TankWar Demo:

  • Use multiple channels instead of use single one

  • Sharing a transport between multiple channels in a JVM

How to run?
  • Navigate to DEMO_HOME/bin execute the following bootstrap script, note that, -n plus a unique name is mandatory, if isGood parameter is append, tank play as Alliance tank, or else it will be Enemy tank

./tankwar.sh -n node1 isGood
  • On another Terminal start tank play as Enemy

./tankwar.sh -n node2

Actually, we can open more Terminal, start more nodes as below diagram

JGroups Runtime Diagram

Now 2 groups demo can emit missile attack each other, for details:

  1. Use arrow(up, down, left. right) move Tank, Tank can move to 8 direction

  2. Use space emit missile

  3. Use F2 for generating a new Tank if current Tank exploded

JBossCache Replication Demo

  • JBoss Cache is a tree-structured, clustered, transactional cache. It can be used in a standalone, non-clustered environment, to cache frequently accessed data in memory. JBoss Cache is also a clustered cache, and can be used in a cluster to replicate state providing a high degree of failover.

  • JBossCache Replication Demo is a demo what show JBossCache’s tree-structured, clustered, transactional feature, we can easy track the replication process via demo UI, demo mangement console, bsh mangement console.

  • JBossCache Replication Demo Source code ./jbosscache/demo

Build and Generate demo home
BossCache Replication Demo Architecture
JBossCache Replication Demo Architecture

BossCache Replication Demo key feature:

  • How JBossCache build upon jGroups

  • tree-structured, clustered,transactional

  • 3 ways to manage or access JBossCache demo

    • console - traditional command line

    • GUI - java swing interface

    • bsh - bsh console

How to run?

Navigate to DEMO_HOME/bin, we will see JBossCache bootstrap scripts. Open more Terminal, start scprit as below will start JBossCache Demo in GUI mode:

./jbosscache.sh -c total-replication.xml

Start scprit as below will start JBossCache Demo in console mode:

./jbosscache.sh -c total-replication.xml -console

Start scprit as below will start JBossCache Demo in bsh mode:

./jbosscache.sh -c total-replication.xml -bsh
JBossCache Replication Demo Runtime diagram
  • See more underlying details

Infinispan Data Grid Demo

  • Infinispan is an extremely scalable, highly available key/value NoSQL datastore and distributed data grid platform.

  • Infinispan Data Grid Demo show Infinispan Distribute mode & Replication mode

  • Infinispan Data Grid Demo Source Code ./infinispan/grid/demo

Build and Generate demo Home
Infinispan Data Grid Demo Architecture
Infinispan Data Grid Demo Architecture
How to run

DEMO_HOME/bin has bootstrap scripts, Open 4 Termial(actually, you can open more), in each Terminal, execute the following commands in a sequence

./dataGrid.sh -c infinispan-distribution.xml

We also can run Data Grid demo use console mode, similiar, execute the following commands as below:

./dataGrid.sh -c infinispan-distribution.xml -console
4 nodes data grid console

Alternatively, use the following commands start Infinispan Data Grid as Replication Mode:

./dataGrid.sh -c infinispan-replication.xml
./dataGrid.sh -c infinispan-replication.xml -console

Start Infinispan Data Grid as Invalidation Mode:

./dataGrid.sh -c infinispan-invalidation.xml
./dataGrid.sh -c infinispan-invalidation.xml -console

Start Infinispan Data Grid as Local Cache Mode:

./dataGrid.sh -c infinispan-local.xml
./dataGrid.sh -c infinispan-local.xml -console
  • See more underlying details

About

jGroups, JBossCache, Infinispan, Ehcache

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published