Skip to end of banner
Go to start of banner

Netflix RSS Demo Application

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 37 Next »

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".

Current Dockerfiles (with agents):

 

 Docker 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.2.65

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



 Docker 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.2.65

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

 Docker 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)

 

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

Restarting the docker daemon helped to solve the problem

 

 

 

 

Application with Java Agents

Application without Java Agents

Beta 1:

 

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

Beta 3:

  • added run script checking whether
    a configuration exists, otherwise the
    default configuration is used
  • Added path variables

 

Beta 1:

 

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

Installation Guide:

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

    sudo docker-compose build
    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:

    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))

  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:

 

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:

docker run --rm swarm create

 

A node can be created by following command:

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.

 

Notice

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  DONE
  •  Application can be started by Docker Compose DONE
  • Each container can be monitored by InspectIT DONE


 

  • No labels