Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Cloned from github fork.

Introduction

  • The software is subdivided into three different server units:
    • Middletier: organizes the rss - data
    • Edge: Frontend, hosts the website
    • Eureka: a REST service, developed by Netflix
  • The RSSFeedReader is used to demonstrate the inspectIT Tool analysing distributed systems
  • In order to have a compact environment, the software has to be ported to Docker
  • Each unit runs in a separate Docker -container

  • The connection between the different components is managed by Docker Link:
    • The containers Edge and Middletier are linked with the Tomcat - Eureka Server
    • The container Edge is linked with Container Middletier
    • Each container image can be builded by an individual Dockerfile.
    • In the meantime the containers can be started by the following commands:
      • docker run -p 8080:8080 --name tomcat --privileged=true tomcat
      • docker run -P -p 9191:9191 --link tomcat:tomcat --name middletier  --hostname middletier  middletier

      • docker run -P -p 9090:9090 --link tomcat:tomcat --link middletier:middletier edge

Architecture (with Agents):

 

The containers are connection via docker -link. Edge and Middletier include a Java Agent, which sends the relevant data to the CMR server. The CMR server aggregates the data and provides the data for the Rich Client.

In the docker-compose script, the host directory including the inspectit-agent.cfg and the other config files is mounted on the container. You do not have to rebuild the project, once you have changed the agent's configuration.

In the the header of the config file, the CMR host must be set as "cmr".

Latest Dockerfiles (with agents):

 

Expand
titleDocker RSS Edge

FROM java:7
MAINTAINER info.inspectit@novatec-gmbh.de

#declare variable for inspectIT
ENV INSPECTIT_CONFIG_HOME /agent-config
ENV INSPECTIT_VERSION 1.6.3.68

RUN apt-get update && apt-get install -y git wget libgradle-core-java
# forked repository
RUN git clone https://github.com/teeratpitakrat/recipes-rss

#build the netflix rss reader

WORKDIR /recipes-rss
ENV APP_ENV=dev
RUN ./gradlew clean build

#download the agent
WORKDIR /
RUN wget ftp://ntftp.novatec-gmbh.de/inspectit/releases/RELEASE.${INSPECTIT_VERSION}/inspectit-agent-sun1.5.zip
RUN unzip inspectit-agent-sun*.zip

EXPOSE 9090 9092

#start agent and jar
WORKDIR /recipes-rss

COPY run.sh /run.sh

CMD sh /run.sh



Expand
titleDocker RSS Middletier
FROM java:7
MAINTAINER info.inspectit@novatec-gmbh.de

#declare variable for inspectIT
ENV INSPECTIT_CONFIG_HOME /agent-config
ENV INSPECTIT_VERSION 1.6.3.68

RUN apt-get update && apt-get install -y git wget libgradle-core-java
# forked repository
RUN git clone https://github.com/teeratpitakrat/recipes-rss

#build the netflix rss reader

WORKDIR /recipes-rss
ENV APP_ENV=dev
RUN ./gradlew clean build

#download the agent
WORKDIR /
RUN wget ftp://ntftp.novatec-gmbh.de/inspectit/releases/RELEASE.${INSPECTIT_VERSION}/inspectit-agent-sun1.5.zip
RUN unzip inspectit-agent-sun*.zip

EXPOSE 9191 9192

#start agent and jar
WORKDIR /recipes-rss

COPY run.sh /run.sh


CMD sh /run.sh

Expand
titleDocker RSS Tomcat (Eureka)

FROM inspectit/tomcat:latest

MAINTAINER info.inspectit@novatec-gmbh.de

RUN apt-get update && apt-get install -y  git libgradle-core-java openjdk-7-jdk

#Clone eureka service
WORKDIR /
RUN git clone https://github.com/Netflix/eureka

#build eureka
WORKDIR /eureka
RUN ./gradlew clean build
RUN cp /eureka/eureka-server/build/libs/eureka-server*SNAPSHOT.war /usr/local/tomcat/webapps/eureka.war


EXPOSE 8080





 

Docker Compose:

The application can be started by a docker- compose script. (Installation Guide for docker compose)

View file
namedocker-compose.yml
height150

 

Info

After the installation of docker compose, the connection between containers and the internet failed.

Restarting the docker daemon helped to solve the problem

 

 

 

 

netflixRSSReaderWithoutAgents

Application with Java Agents

Application without Java Agents

Beta 1:

Added path variables
View file
namenetflixRSSReaderWithAgentsBeta3.zip
height150

 

Beta 1:

View file
name
View file
name
netflix_withAgents.zipheight150

 

Beta 2:

  • integration of the tomcat/inspectit image
  • refactoring
  • Changed FROM:ubuntu:14.04 to
    FROM java:7
  • adjusted the Dockerfiles from
  • Edge and Middletier
  • docker-compose file is in the
    root path

View file
namenetflixRSSReaderWithAgentsBeta2.zip
height150

Beta 3:

  • added run script checking whether
    a configuration exists, otherwise the
    default configuration is used
  • netflixRSSReaderWithAgentsBeta4.zip
    height150

     

    Beta 2:

  • integration of the tomcat image
  • refactoring
  • Changed FROM:ubuntu:14.04 to
    FROM java:7
  • adjusted the Dockerfiles from
  • Edge and Middletier
  • docker-compose file is in the
    root path

    View file
    namenetflixRSSReaderWithoutAgents.zip
    height150

    Installation Guide:

    1. Unzip the archive
    2. change into the folder netflixRSSReader*Agents/
    3. To build all files run the command:

      Code Block
      languagebash
      sudo docker-compose build
      Info
      Building the eureka service may take a while

       

    4. Under netflixRSSReader*Agents/netflixRSS-edge/config-agent/ and under netflixRSSReader*Agents/netflixRSS-middletier/config-agent/ the config files can be edited.

    5. After configuring the agents, run the following command:

      Code Block
      languagebash
      sudo docker-compose up

      Now the application starts and the different containers connect themselves.

    6.  After a while the RSSReader can be used

      URL for access: http://your-ip:9090/jsp/rss.jsp

      URL for eureka:http://your-ip:8080/eureka/

    7. For monitoring the software, please use the newest rich client from the InspectITHomepage (inspectIT 1.6.2 Beta release (advanced))this clients: LinuxClient / Windows

    8. Open the rich-client, choose the button "new repository" and enter your IP and port
      (For detailed inspectIT documentation, visit the InspectIT homepage)




    9. Afterwards you can choose the desired agent




      and analyse your measurement:

     

    Info

    It is recommended to use min. 4 GB RAM, the consumption of resources is very high.

     

    Docker Swarm:

    The application also works with Docker Swarm:

    With docker-machine, you can create several swarm-nodes and a swarm-master managing each node:

    Each node is a own virtualbox machine instance.

     

    For communication between the different nodes, it is necessary to generate a unique token:

    Code Block
    languagebash
    firstline1
    linenumberstrue
    docker run --rm swarm create
    

     

    A node can be created by following command:

    Code Block
    languagebash
    firstline1
    linenumberstrue
    docker-machine create -d virtualbox --swarm --swarm-discovery token://YOUR_TOKEN SWARM_NODE_NAME

     

    For further documentation please visit:

    https://docs.docker.com/swarm/install-w-machine/

     

    Now, you can easily start you docker-compose script and swarm. Swarm will choose the optimal node for the containers.

     

    Info
    titleNotice

    Unfortunately, I couldn't test Docker Swarm combined with the docker-compose script, because of a failed build of the eureka service.

     

    TODO:

    •  Application runs in three different containers 
      Status
      colourGreen
      titleDone
    •   Application can be started by Docker Compose
      Status
      colourGreen
      titleDone
    •  Each container can be monitored by InspectIT
      Status
      colourGreen
      titleDone