You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem was a version incompatibility. fluentd v1.4-2 now requires specifying a ‘root’ user in the log-shipper Dockerfile.
Also updated readmes for clarity.
Copy file name to clipboardexpand all lines: README.md
+16-14
Original file line number
Diff line number
Diff line change
@@ -4,38 +4,40 @@ Monitoring containerized microservices with a centralized logging architecture.
4
4
5
5
## Dependencies
6
6
7
-
- Docker Compose v1.22.0
7
+
- Docker Compose v1.23.2
8
8
9
9
## Setup
10
10
11
-
1.For each microservice, rename `example.env` to `.env` and supply the needed secrets.
11
+
1.Signup with an ELK SaaS provider like [Logz.io](logz.io) to obtain an authentication token. Then for each microservice, rename `example.env` to `.env` and supply the needed secrets.
12
12
13
-
docker-compose up -d
14
-
15
-
2. Then log into [Logz.io](logz.io) or your preferred ELK SaaS to view your microservices logs.
13
+
2. Run the following commands.
16
14
15
+
docker-compose build --pull
16
+
docker-compose up -d --force-recreate
17
+
18
+
3. Then log into your ELK SaaS and view your microservices logs.
17
19
18
20
## Project Documentation
19
21
20
22
### System Architecture
21
23
22
24

23
25
24
-
I wrote an accompanying [Medium article]() detailing the rationale for this architecture.
26
+
I wrote an accompanying [article](https://hackernoon.com/monitoring-containerized-microservices-with-a-centralized-logging-architecture-ba6771c1971a) explaining this architecture.
25
27
26
-
## Developer Notes
28
+
## Notes
27
29
28
30
### Docker Networking
29
31
30
-
Containers run isolated by default. For them to comunicate with one another, you need to place them on the same network. We do this using Docker Compose
32
+
By default each containerized process runs in an isolated network namespace. For inter-container communication, place them in the same network namespace...as seen in *docker-compose.yml*.
31
33
32
34
### Best practices
33
35
34
-
1. You can pass secrets for a microservice using the `env_file` attribute in `docker-compose.yml`
35
-
2. Microservices can communicate using their service names if they are in the same docker `network`
36
+
1. You can pass secrets for a microservice using the `env_file` attribute in *docker-compose.yml*.
37
+
2. Microservices can communicate using their service names if they are in the same docker network.
38
+
39
+
### Improvement Considerations
36
40
37
-
### Known issues
41
+
1.**Name Duplication:** The value of the `API_SERVER_ADDRESS` variable in *user-simulator/.env* depends on the service name `api-server` specified in *docker-compose.yml*. If we rename the service, we must also change the variable. Is there a way to make this DRY?
38
42
39
-
1. Some values like service hostnames are specified in 2 places: the docker-compose file, and the service-specific .env file (like for the API BaseURL)
40
-
2. You have to install a plugin for the ELK-service (logz.io) in the fluentd shipper container
41
-
3. Then you have to configure fluentd plugin with your credentials from the ELK service.
43
+
2. In the log-shipper container, I had to install a logz.io-specific plugin. Can't this step be eliminated since fluentd is capable of connecting to https endpoints without plugins?
docker run -d --env-file=.env -p 5000:80 eyeezzi/horus-api-server
8
7
9
-
docker run -d -p 5000:80 eyeezzi/horus-api-server
8
+
> Note: The server runs on port `80`, but we expose it as `5000` on the host in order to avoid privilege issues with binding to low number ports. Knowledge bit: [port-mapping cannot be set in dockerfile.](https://stackoverflow.com/questions/36153025/is-it-possible-to-set-docker-port-mappings-to-host-in-dockerfile)
10
9
11
-
3. Get the container ID and verify port mapping
10
+
2. View the logs generated by the app
12
11
13
12
docker ps
13
+
docker logs -f <container-name>
14
14
15
-
4. Tail the logs from the container
16
-
17
-
docker logs -f <CONTAINER_ID>
15
+
# From another terminal on the host machine, test the server
docker run -d --env-file=.env eyeezzi/horus-log-shipper
9
+
// tail the logs to see any incoming messages
10
+
docker logs -f <container-name>
11
+
12
+
2. From another terminal test sending logs to the shipper. You should see the new incoming message in the log tail and also on your ELK SaaS dashboard.
13
+
14
+
curl -X POST -H "Content-Type: application/json" -d '{"msg":"this is a test message"}' http://localhost:24224
1.Rename *example.env* to *.env* and supply the `API_SERVER_ADDRESS`. Then run the following commands
4
4
5
-
docker build -t eyeezzi/horus-user-simulator .
6
-
7
-
2. Start container from image. Note the *public:internal* port mapping
5
+
> If the API Server is running in another local container with an exposed port, then run this container in the `host` network so it can access the API Server.
> Docker seems to have a bug where a container cannot be connected to the `host` network. See this [issue](https://github.com/awslabs/aws-sam-cli/issues/669).
0 commit comments