Skip to content

Instantly share code, notes, and snippets.

apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
labels:
app: server
name: server
spec:
replicas: 4
selector:
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
labels:
app: server
name: server
spec:
replicas: 1
selector:
@abhinavdhasmana
abhinavdhasmana / startGrafana.sh
Created February 9, 2021 05:03
start grafana
docker run \
--network host \
--name=grafana \
--restart always \
-e GF_AUTH_ANONYMOUS_ENABLED=true \
-e GF_AUTH_ANONYMOUS_ORG_ROLE=Admin \
-v grafana-storage:/var/lib/grafana\
grafana/grafana
@abhinavdhasmana
abhinavdhasmana / startPrometheus.sh
Created February 9, 2021 05:00
start prometheus
docker run \
--name=prometheus \
--network host \
--restart always \
-v /home/ubuntu/prometheus:/etc/prometheus \
prom/prometheus
@abhinavdhasmana
abhinavdhasmana / prometheus.yml
Created February 9, 2021 04:53
Prometheus config
global:
scrape_interval: 5s
evaluation_interval: 5s
scrape_configs:
- job_name: 'kafka'
static_configs:
- targets:
- 172.31.10.2:8080
- 172.31.20.231:8080
- 172.31.36.21:8080
@abhinavdhasmana
abhinavdhasmana / kafka.sh
Last active February 9, 2021 06:16
Start Kafka Setup
docker run --name kafka \
--network host \
--restart always \
-e ALLOW_PLAINTEXT_LISTENER=yes \
-e KAFKA_OPTS="-javaagent:/opt/bitnami/kafka/conf/jmx_prometheus_javaagent-0.15.0.jar=8080:/opt/bitnami/kafka/conf/kafka-2_0_0.yml" \
-v /home/ubuntu/kafka/server.properties:/bitnami/kafka/config/server.properties \
-v /data/kafka:/data/kafka \
-v /home/ubuntu/kafka/config:/opt/bitnami/kafka/conf \
bitnami/kafka:latest
package com.gslab.pepper;
import java.io.Serializable;
public class Message implements Serializable{
private long messageId;
private String messageBody;
private String messageBodyTwo;
private String messageBodyThree;
private String messageBodyFour;
private String messageBodyFive;
@abhinavdhasmana
abhinavdhasmana / papperbox-schema.json
Created January 28, 2021 10:17
Pepperbox load generation template
{
{
"messageId":{{SEQUENCE("messageId", 1, 1)}},
"messageBody":"{{RANDOM_ALPHA_NUMERIC("abcedefghijklmnopqrwxyzABCDEFGHIJKLMNOPQRWXYZ", 100)}}",
"messageBodyTwo":"{{RANDOM_ALPHA_NUMERIC("abcedefghijklmnopqrwxyzABCDEFGHIJKLMNOPQRWXYZ", 100)}}",
"messageBodyThree":"{{RANDOM_ALPHA_NUMERIC("abcedefghijklmnopqrwxyzABCDEFGHIJKLMNOPQRWXYZ", 100)}}",
"messageBodyFour":"{{RANDOM_ALPHA_NUMERIC("abcedefghijklmnopqrwxyzABCDEFGHIJKLMNOPQRWXYZ", 100)}}",
"messageBodyFive":"{{RANDOM_ALPHA_NUMERIC("abcedefghijklmnopqrwxyzABCDEFGHIJKLMNOPQRWXYZ", 100)}}",
"messageBodySix":"{{RANDOM_ALPHA_NUMERIC("abcedefghijklmnopqrwxyzABCDEFGHIJKLMNOPQRWXYZ", 100)}}",
"messageBodySeven":"{{RANDOM_ALPHA_NUMERIC("abcedefghijklmnopqrwxyzABCDEFGHIJKLMNOPQRWXYZ", 100)}}",
@abhinavdhasmana
abhinavdhasmana / server.properties
Created January 28, 2021 09:19
kafka server.properties
############################# Server Basics #############################
# The id of the broker. This must be set to a unique integer for each broker.
broker.id=1
# change your.host.name by your machine's IP or hostname
advertised.listeners=PLAINTEXT://54.144.148.171:9092
# Switch to enable topic deletion or not, default value is false
delete.topic.enable=true
############################# Log Basics #############################
# A comma seperated list of directories under which to store log files
log.dirs=/data/kafka
@abhinavdhasmana
abhinavdhasmana / zoo.cfg
Created January 25, 2021 09:01
zookeeper configuration file
dataDir=/data/zookeeper
# the port at which the clients will connect
clientPort=2181
# disable the per-ip limit on the number of connections since this is a non-production config
maxClientCnxns=0
# the basic time unit in milliseconds used by ZooKeeper. It is used to do heartbeats and the minimum session timeout will be twice the tickTime.
tickTime=2000
# The number of ticks that the initial synchronization phase can take
initLimit=10
# The number of ticks that can pass between