# Starting Kafka

At this point, Kafka has already been installed and all we have to do is start the service.

### Step 1

Let first start the Zookeeper service. In a new terminal (Window > New terminal or `Alt-T`) run the following script.

```
./scripts/zookeeper-start.sh
```

### Step 2

Next, let's start the Kafka service. In a new terminal (Window > New terminal or `Alt-T`) run the following script.

```
./scripts/kafka-start.sh
```

> Tip: You can stop the services using the following commands:

> ```
> ./scripts/kafka-stop.sh
> ```

> ```
> ./scripts/zookeeper-stop.sh
> ```

### Step 3

Let's try out Kafka. We will have a producer to send messages to a topic that a consumer will be reading.

**Producer** In a new terminal (Window > New terminal or `Alt-T`) run the following command:

> Ignore any warnings

```
kafka_2.13-2.6.0/bin/kafka-console-producer.sh --topic quickstart-events --bootstrap-server localhost:9092
```

**Consumer** In a new terminal (Window > New terminal or `Alt-T`) run the following command:

> Ignore any warnings

```
kafka_2.13-2.6.0/bin/kafka-console-consumer.sh --topic quickstart-events --from-beginning --bootstrap-server localhost:9092
```

We are now ready to broker messages. In the **Producer** terminal, type some text and press `enter`. In the **Consumer** terminal you should see your text getting read.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://davidsietz.gitbook.io/daas-workshop/setting-up-you-machines/starting-kafka.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
