This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
<build> | |
<plugins> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-compiler-plugin</artifactId> | |
<version>3.1</version> | |
<configuration> | |
<source>1.8</source> | |
<target>1.8</target> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class EnvTools { | |
public static final String INPUT_TOPIC = "INPUT_TOPIC"; | |
public static final String OUTPUT_TOPIC = "OUTPUT_TOPIC"; | |
public static final String APPLICATION_ID_CONFIG = "APPLICATION_ID_CONFIG"; | |
public static final String BOOTSTRAP_SERVERS_CONFIG = "BOOTSTRAP_SERVERS_CONFIG"; | |
public static String getEnvValue(String environmentKey, String defaultValue) | |
{ | |
String envValue = System.getenv(environmentKey); | |
if(envValue != null && !envValue.isEmpty()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
public ZtmStream() { | |
inputTopic = EnvTools.getEnvValue(EnvTools.INPUT_TOPIC, "ztm-input"); | |
outputTopic = EnvTools.getEnvValue(EnvTools.OUTPUT_TOPIC, "ztm-output"); | |
} | |
... | |
private static Properties createProperties() { | |
Properties props = new Properties(); | |
String appIdConfig = EnvTools.getEnvValue(EnvTools.APPLICATION_ID_CONFIG, "wiaderko-ztm-stream"); | |
String bootstrapServersConfig = EnvTools.getEnvValue(EnvTools.BOOTSTRAP_SERVERS_CONFIG, "localhost:29092"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM maven:3-openjdk-8-slim AS BUILD | |
COPY pom.xml /tmp/ | |
COPY src /tmp/src/ | |
WORKDIR /tmp/ | |
RUN mvn package | |
FROM openjdk:8-alpine AS RUNTIME | |
RUN apk update && apk add --no-cache libc6-compat | |
RUN ln -s /lib64/ld-linux-x86-64.so.2 /lib/ld-linux-x86-64.so.2 | |
WORKDIR /app/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3.3' | |
services: | |
zookeeper: | |
image: 'bitnami/zookeeper:3' | |
ports: | |
- '2181:2181' | |
volumes: | |
- 'zookeeper_data:/bitnami' | |
environment: | |
- ALLOW_ANONYMOUS_LOGIN=yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import json | |
import time | |
from kafka import KafkaProducer | |
token = 'use your own API Token' | |
url = 'https://api.um.warszawa.pl/api/action/busestrams_get/' | |
resource_id = 'f2e5503e927d-4ad3-9500-4ab9e55deb59' | |
sleep_time = 15 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vrrp_instance VI_1 { | |
interface ens33 | |
state MASTER | |
virtual_router_id 51 | |
priority 101 | |
virtual_ipaddress { | |
192.168.10.166 | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
logstash_response="$(curl --silent localhost:9600)" | |
if echo $logstash_response | grep -q '"status":"green"' | |
then | |
echo "Logstash is green. It's ok :-)" | |
exit 0 | |
else | |
echo "Logstash is not green :-( plz help" | |
exit 1 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global_defs { | |
enable_script_security | |
} | |
vrrp_script chk_logstash { | |
script "/etc/keepalived/lol.sh" # path of the script to execute | |
interval 1 # seconds between script invocations | |
timeout 1 # seconds after which script is considered to have failed |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
OlderNewer