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
use --property print.key=true | |
Example : ./kafka-console-consumer.sh --bootstrap-server <BROKERS_ADDRESS> --topic <YOUR_TOPIC> --property print.key=true |
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
img[src$='#center'] | |
{ | |
display: block; | |
margin: 0.7rem auto; /* you can replace the vertical '0.7rem' by | |
whatever floats your boat, but keep the | |
horizontal 'auto' for this to work */ | |
/* whatever else styles you fancy here */ | |
} | |
img[src$='#floatleft'] |
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
### CURL and binary data | |
1. Fill the http body with the content of a file: | |
``` | |
curl --request POST --data-binary "@/tmp/your_file_path/" {URL} | |
``` | |
2. Send files as multipart/form-data | |
``` | |
curl -F 'img_avatar="@/tmp/your_file_path/" {URL} | |
``` |
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
After downloading the source code: | |
$ ./configure --enable-optimizations | |
$ sudo make altinstall |
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
uuid_generate_v4() | |
Activate it via: | |
CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; |
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
The formula for determining the number of partitions per Kafka topic has been pretty well explored over time. | |
When creating a new topic in your Kafka cluster, you should first think about your desired throughput (t) in MB/sec. | |
Next, consider the producer throughput that you can achieve on a single partition (p)—this is affected by producer | |
configurations but generally sits at roughly 10s of MB/sec. Finally, you need to determine the consumer throughput (c) | |
you will have—this is application-dependent so you’ll have to measure it yourself. You should anticipate having at least | |
max(t/p, t/c) partitions for that topic. So if you have a throughput requirement of 250 MB/sec, with a producer and | |
consumer throughput of 50 MB/sec and 25 MB/sec respectively. | |
Then you should use at least max(250/50, 250/25) = max(5, 10) = 10 partitions for that topic. | |
https://www.confluent.io/blog/5-common-pitfalls-when-using-apache-kafka/ |
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 environment | |
FROM node:13.12.0-alpine as build | |
WORKDIR /app | |
ENV PATH /app/node_modules/.bin:$PATH | |
COPY package.json ./ | |
COPY package-lock.json ./ | |
RUN npm ci --silent | |
RUN npm install react-scripts@3.4.1 -g --silent | |
COPY . ./ | |
RUN npm run build |
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
A readiness probe allows Kubernetes to poll the pod and not consider it ready to receive requests until the application indicates it is ready. | |
```YAML | |
readinessProbe: # if readiness probe fails, is taken out of your loadbalancer | |
initialDelaySeconds: 15 #adjust this to be a little less than the time it normally takes for your application to startup | |
httpGet: | |
path: /internal/health | |
port: 8080 | |
timeoutSeconds: 3 | |
``` |
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: '2' | |
services: | |
zookeeper: | |
image: confluentinc/cp-zookeeper:6.0.0 | |
hostname: zookeeper | |
container_name: zookeeper | |
ports: | |
- "2181:2181" | |
environment: |
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
export KAFKA_OPTS="-javaagent:{PATH}/jmx_prometheus_javaagent-0.14.0.jar=9090:{PATH}/prom-jmx-agent-config.yml" |
NewerOlder