-
Notifications
You must be signed in to change notification settings - Fork 0
/
Notes.txt
76 lines (50 loc) · 2.07 KB
/
Notes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
wget <kafka link>
tar -xzvf <file_name>
bin/server.properties edit ===> advertised.listeners=PLAINTEXT://localhost:9092
*IMP*
bin/zookeeper-server-start.sh config/zookeeper.properties
*IMP*
JMX_PORT=8004 bin/kafka-server-start.sh config/server.properties
**kafka Manager**
git clone https://github.com/yahoo/CMAK.git
cd CMAK
<FIRST TIME>: brew install sbt
// Still not working: export JAVA_HOME=`/usr/libexec/java_home -v 1.8`
sbt clean dist
cd target/universal/
unzip cmak-3.0.0.7.zip
**change CMAK.zkhost with zookeeper host id**
cd cmak-3.0.0.7/conf
nano application.conf
cmak.zkhosts="kafka-manager-zookeeper:2181" (change to localhost)
cd ..
path: cd target/universal/cmak-3.0.0.7
*IMP*
bin/cmak -Dconfig.file=conf/application.conf -Dhttp.port=8080
or [ignore errors]
bin/cmak -Dconfig.file=conf/application.conf -Dhttp.port=8080 -J--add-opens=java.base/sun.net.www.protocol.file=ALL-UNNAMED -J--add-exports=java.base/sun.net.www.protocol.file=ALL-UNNAMED
Python kafka
Config need by producers to publish message
Bootstrap server:
server address: IP[localhost]:PORT[default 9092]
topic_name
value_serializer
send method on producers to publish the data
Single broker 1 partition
__________
publisher-------------->| |p0| |--------->> consumers
__________ topic
pip3 install kafka-python
pip3 install Faker
While Publishing
When multiple partitions within topic --> random distributions
Config need to consumer [Mandatroy for consumer to stay in a group]
topic
bootstrap_servers
group_id
Consumer:
consume message from kafka topic partition
every consumer has a consumer group
bin/zookeeper-server-start.sh config/zookeeper.properties
JMX_PORT=8004 bin/kafka-server-start.sh config/server.properties
bin/cmak -Dconfig.file=conf/application.conf -Dhttp.port=8080 -J--add-opens=java.base/sun.net.www.protocol.file=ALL-UNNAMED -J--add-exports=java.base/sun.net.www.protocol.file=ALL-UNNAMED