Code Monkey home page Code Monkey logo

ehcache-sample-cluster's Introduction

Intro

This is a sample application using Spring Boot and EHCache clustering using JGroups.

This project has a sample RESTful service which manages user records.

Build

To build, execute commands

git clone https://github.com/sbanal/ehcache-sample-cluster.git
cd ehcache-sample-cluster
mvn clean install docker:build

A docker image is built after the commands above succeeds. Check the images by opening a docker terminal. Run command

docker images

This should output an entry similar to output below:

REPOSITORY                           TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
sbanal/ehcache-sample-cluster        latest              1b49ff04f7ee        21 minutes ago      676.5 MB

Run

To run a cluster manually, run the image using different ports so you can access the endpoints and test EHCache. Commands below runs two new instances.

export web1=`docker run -p 9110:8080 -d sbanal/ehcache-sample-cluster`
export web2=`docker run -p 9111:8080 -d sbanal/ehcache-sample-cluster`

Check the logs of the machine by running commands below on separate terminals

docker logs -f $web1
docker logs -f $web2

Testing

To check the endpoints, get the ip of your docker machine

docker-machine ip default

Then hit the endpoints using the custom port you provided in docker run command and output IP of docker ip command.

http://192.168.99.100:9110/users/1
http://192.168.99.100:9111/users/1

ehcache-sample-cluster's People

Contributors

sbanal avatar

Watchers

 avatar

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.