You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: labs/01-Verify-Installation/hello-world-kafka.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ In this lab, you will install Kafka with Docker and verify it is working by crea
13
13
14
14
One of the easiest way to get started with Kafka is through the use of [Docker](https://www.docker.com). Docker allows the deployment of applications inside software containers which are self-contained execution environments with their own isolated CPU, memory, and network resources. [Install Docker by following the directions appropriate for your operating system.](https://www.docker.com/products/overview) Make sure that you can run both the `docker` and `docker-compose` command from the terminal.
15
15
16
-
## Alias
16
+
## [OPTIONAL]Alias
17
17
18
18
Because we use docker and docker-compose, the commands to run the kafka CLI are absurdly long.
19
19
@@ -28,9 +28,9 @@ You may want to alias these commands. In Linux and Mac, you can simply create al
28
28
E.g., say you run bash, you can open the `~/.bash_profile` file with your favorite editor and enter something like this:
29
29
30
30
```
31
-
alias ktopics='docker-compose exec kafka /opt/kafka_2.11-0.10.1.1/bin/kafka-topics.sh'
32
-
alias kconsole-producer='docker-compose exec kafka /opt/kafka_2.11-0.10.1.1/bin/kafka-console-producer.sh'
33
-
alias kconsole-consumer='docker-compose exec kafka /opt/kafka_2.11-0.10.1.1/bin/kafka-console-consumer.sh'
31
+
alias ktopics='docker-compose exec kafka /opt/kafka/bin/kafka-topics.sh'
32
+
alias kconsole-producer='docker-compose exec kafka /opt/kafka/bin/kafka-console-producer.sh'
33
+
alias kconsole-consumer='docker-compose exec kafka /opt/kafka/bin/kafka-console-consumer.sh'
34
34
```
35
35
36
36
When you start new shells, you can now simply run:
@@ -72,28 +72,28 @@ You are now running inside the container and all the commands should work (and a
72
72
3. Open an additional terminal window in the lesson directory, `lelabs/01-Verify-Installation`. We are going to create a topic called `helloworld` with a single partition and one replica:
5. Normally you would use the Kafka API from within your application to produce messages but Kafka comes with a command line _producer_ client that can be used for testing purposes. Each line from standard input will be treated as a separate message. Type a few messages and leave the process running.
6. Open another terminal window in the lesson directory. In this window, we can use Kafka's command line _consumer_ that will output the messages to standard out.
In this case, the IP address to use is `10.0.1.4`. Make sure you *do not* use `127.0.0.1` because that will not work correctly.
61
60
61
+
62
62
On Windows, you can use the following command:
63
63
64
64
```
@@ -80,6 +80,10 @@ All the directory references in this lab is relative to where you expended the l
80
80
81
81
Save the `docker-compose.yml` file after making this modification.
82
82
83
+
> We have noticed on some configurations of Windows and Linux that the use of `KAFKA_ADVERTISED_HOST_NAME` does not work properly (the Kafka clients can't connect).
84
+
> We've not found the source of this problem, but in many of the cases we've seen, the use of `localhost` instead of the host IP may work.
85
+
> Note though, that the use of `localhost` prevents you from running multiple Kafka brokers on the same machine.
86
+
83
87
1. Start the Kafka and Zookeeper processes using Docker Compose:
84
88
85
89
```
@@ -89,14 +93,14 @@ All the directory references in this lab is relative to where you expended the l
89
93
1. Open an additional terminal window in the lesson directory, `docker/`. We are going to create two topics that will be used in the Producer program. Run the following commands:
0 commit comments