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 | ||
---|---|---|
| ||
FROM java:7 |
Expand | ||
---|---|---|
| ||
FROM java:7 MAINTAINER info.inspectit@novatec-gmbh.de #declare variable for inspectIT ENV INSPECTIT_CONFIG_HOME /agent-config ENV INSPECTIT_VERSION 1.6.23.6568 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 | ||
---|---|---|
| ||
FROM inspectit/tomcat:latest |
Docker Compose:
The application can be started by a docker- compose script. (Installation Guide for docker compose)
View file | ||||
---|---|---|---|---|
|
Info |
---|
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:
Beta 3:
| Beta 1:
Beta 2:
|
Installation Guide:
- Unzip the archive
- change into the folder netflixRSSReader*Agents/
To build all files run the command:
Code Block language bash sudo docker-compose build
Info Building the eureka service may take a while - Under netflixRSSReader*Agents/netflixRSS-edge/config-agent/ and under netflixRSSReader*Agents/netflixRSS-middletier/config-agent/ the config files can be edited.
After configuring the agents, run the following command:
Code Block language bash sudo docker-compose up
Now the application starts and the different containers connect themselves.
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/
- For monitoring the software, please use the newest rich client from the InspectITHomepage (inspectIT 1.6.2 Beta release (advanced))
- Open the rich-client, choose the button "new repository" and enter your IP and port
(For detailed inspectIT documentation, visit the InspectIT homepage) - 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 | ||||||
---|---|---|---|---|---|---|
| ||||||
docker run --rm swarm create |
A node can be created by following command:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
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 | ||
---|---|---|
| ||
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 colour Green title Done - Application can be started by Docker Compose
Status colour Green title Done - Each container can be monitored by InspectIT
Status colour Green title Done