Skip to content

Commit 6488b16

Browse files
author
Jayakrishnan JR
committed
codes
1 parent 26da00f commit 6488b16

File tree

1 file changed

+9
-23
lines changed

1 file changed

+9
-23
lines changed

README.md

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,32 @@
22

33
## Kafka single node setup
44

5-
On a single machine, a **3 broker** kafka instance is at best the minimum, for a hassle-free working. Also, **replication factor is set to 2**.
5+
On a single machine, a **3 broker** kafka instance is at best the minimum, for a hassle-free working. Also, **replication factor is set to 2**.
66

77
Say X,Y and Z are our kafka brokers. With replication factor 2, the data in X will be copied to both Y & Z, the data in Y will be copied to X & Z and the data of Z is copied to X & Y.
88

99
### Prerequisites
1010
- have java >= 1.8 installed.
11-
- get **binary** distribution of Kafka from [here](https://kafka.apache.org/downloads) .
12-
13-
### Setup
11+
- get **binary** distribution of Kafka from [here](https://kafka.apache.org/downloads) .
12+
13+
### Setup
1414
Extract the contents of the kafka archive to a convenient place and `cd` into it. Use a terminal multiplexer to run the components that make the kafka eco-system.
1515

1616
#### Zookeeper
17-
- Edit the config file `config/server.properties` and change the `dataDir` entry to some place that does not get wiped after a reboot.
17+
- Edit the config file `config/server.properties` and change the `dataDir` entry to some place that does not get wiped after a reboot.
1818
Ex:`dataDir=/home/neoito/tmp/zookeeper`
1919
- Start the zookeeper instance with
2020
`$ bin/zookeeper-server-start.sh config/zookeeper.properties`
2121

2222
#### Kafka brokers
2323
- In the `config` folder there would be a `server.properties` file. This is the kafka server's config file. We need 3 instances of kafka brokers.
2424
- Make a copy. `$ cp config/server.properties config/server.b1.properties`
25-
- In the copy make the following changes
25+
- In the copy make the following changes
2626
```
2727
broker.id=1 #unique id for our broker instance
28-
port=9092 #port where it listens
28+
port=9092 #port where it listens
2929
delete.topic.enable=true #if we want to delete kafka topic stored in broker
30-
log.dirs=/home/neoito/kafka-logs/01 #to a place thats not volatile
30+
log.dirs=/home/neoito/kafka-logs/01 #to a place thats not volatile
3131
advertised.host.name=10.0.0.81 #prevents leader not found error when connecting from remote machine
3232
```
3333

@@ -53,7 +53,7 @@ $ bin/kafka-server-start.sh config/server.b3.properties
5353

5454
To start the application in development mode,
5555
```
56-
npm run dev
56+
npm run dev
5757
```
5858

5959
In production mode use,
@@ -62,17 +62,3 @@ In production mode use,
6262
npm start
6363
```
6464

65-
### API Example
66-
67-
```
68-
{
69-
"kafka_topic": "click-to-call",
70-
"message": {
71-
"id": 1,
72-
"url": "heyhey.com"
73-
}
74-
}
75-
```
76-
77-
# kafka-example
78-
# kafka-example

0 commit comments

Comments
 (0)