WEBVTT 00:04.720 --> 00:10.210 During the next few lectures, we will create a topic that will have several politicians and we will 00:10.210 --> 00:20.120 explore what Kafka will do basically on the broadcast and how log files will be created in the DMP directory. 00:20.500 --> 00:26.070 So let's get started and ensure that you have both sides of the file somewhere on your computer. 00:26.260 --> 00:29.200 And I have opened it in notepad. 00:29.500 --> 00:34.780 So I thought what we need to do is to start a keeper and start Kafka. 00:35.830 --> 00:42.560 In this case, that we will start just single zookeeper and a single broker with default configuration 00:42.560 --> 00:43.120 of files. 00:43.300 --> 00:47.170 That's why we will use the doors commands without any changes. 00:47.440 --> 00:51.580 And afterwards we will create a new topic with three partitions. 00:51.730 --> 00:55.090 And the topic name will be, let's say, animals. 00:55.480 --> 00:59.340 And you could adjust this commander in a notepad as well. 00:59.650 --> 01:06.130 And after creation of the topic, we will launch a built in Kafka console producer and Kafka console 01:06.130 --> 01:11.330 consumer and we'll try to send several messages and observe where they will land. 01:11.350 --> 01:13.010 Finally at the producer. 01:13.270 --> 01:19.240 So let's get started and let's first start as people please notice that in this section, for every 01:19.240 --> 01:26.950 separate task, I'll use Gleen Kafka installation in order to avoid some misunderstanding of Kafka logs. 01:26.950 --> 01:32.050 So I'll just unzip every time Kafka installation of files and that's it. 01:32.260 --> 01:38.010 And in my case, this folder, Kafka folder is located in front of you as our directory. 01:38.200 --> 01:40.660 And here I have all the files. 01:41.060 --> 01:44.880 OK, so let's get started and let's first launch a zookeeper. 01:45.100 --> 01:48.550 I'll cope with this comment and based simply here. 01:51.000 --> 01:53.290 OK, zookeeper is up and running. 01:53.510 --> 01:56.740 No, let me open up new tab here in our terminal. 01:56.790 --> 02:01.940 And please ensure that you'll see dear to Kafka for Dragon, said COFCO. 02:02.580 --> 02:07.980 And no, let me copy this command that will start Kafka, Broadcom and based it here. 02:09.080 --> 02:16.760 And Casanova with ID zero was successful, it launched Great, now let's agree, the topic was named 02:16.760 --> 02:17.390 Animals. 02:17.570 --> 02:23.080 And for that, let me open up again one more time here again to Kafka Fooldom. 02:23.160 --> 02:27.080 Let's clear Tamino and move to creation of the topic. 02:27.080 --> 02:28.550 Come on this one again. 02:28.550 --> 02:33.830 Notice that I was here everywhere I backslash and it is just separate between the different parts of 02:33.830 --> 02:34.630 the same command. 02:34.940 --> 02:39.920 So let me select this entire command like soul and based it here. 02:42.000 --> 02:48.420 Wonderful command was executed successfully, and now let's verify what the Kafka broker actually did 02:48.570 --> 02:54.300 in the Dead Logs folder, where all messages, all logs will be actually stored. 02:54.450 --> 02:55.800 I'll do that in this time. 02:55.800 --> 02:56.310 No window. 02:56.320 --> 03:04.890 So let me do around here and now to slash DMP, slash Kafka desk logs and ensure that you'll at last 03:05.520 --> 03:07.500 and no less list files here. 03:07.830 --> 03:13.980 And notice that there are three new folders, animals, Desh, zero animals, D1, one animals in the 03:13.980 --> 03:14.370 store. 03:14.670 --> 03:19.260 And now it's fully clear to you why we now here three folders. 03:19.260 --> 03:21.900 I have explained that to you in a previous section. 03:22.260 --> 03:26.040 That's because we have specified that we want to have three partitions. 03:26.250 --> 03:32.370 And for this reason, Kafka broker has created three folders for every separate partition. 03:32.880 --> 03:36.620 Notice also that at the moment we are on only a single broker. 03:36.840 --> 03:37.560 This way. 03:37.560 --> 03:43.070 All three folders were created on a same brolga in the same Kafka logs folder. 03:43.500 --> 03:50.190 If I go into any of those folders now, let's send to animals, for example, one and list files here 03:50.190 --> 03:52.640 and the contents of a log file. 03:52.680 --> 03:55.860 This one I'll see basically empty file. 03:56.010 --> 04:00.390 That's because we haven't yet produced any messages to this animal. 04:00.390 --> 04:01.980 Storbeck Wonderful. 04:02.130 --> 04:08.010 Let me see one level up here and let's leave this step open to we will get back to it a bit later when 04:08.070 --> 04:10.140 will produce some messages to this topic. 04:10.320 --> 04:17.790 So let me just clear time and I like so and let me open up new tab here and let's not start the console 04:17.790 --> 04:18.600 producer. 04:18.810 --> 04:25.220 So let me go back to these documents, find the command that starts the console producer here. 04:25.230 --> 04:32.760 Notice and notice that I need to change the topic test and replace it with animals like so because I 04:32.760 --> 04:35.160 want to produce messages to animals topic. 04:35.370 --> 04:41.140 So let me select this command, go back to this terminal window to Kafka folder. 04:41.250 --> 04:47.100 Notice that you need to do that again and again when you open up new terminal window and now paste command 04:47.100 --> 04:47.460 here. 04:49.890 --> 04:56.610 Great, and now I am able to produce some messages to this topic and let's produce some, for example, 04:56.610 --> 04:59.870 cat, dog like monkey. 05:00.600 --> 05:01.320 And that's it. 05:01.890 --> 05:07.270 Now let's open up a Kafka console consumer and try to consume those messages. 05:07.530 --> 05:13.410 Let me go back again to a list of commands, and we will consume messages from beginning. 05:13.710 --> 05:15.390 And the topic will be animals. 05:15.420 --> 05:22.920 So let me replace test with animals here and let me select entire command and go back here. 05:22.980 --> 05:23.910 Open up again. 05:23.910 --> 05:25.890 New Tab Sedita COFCO. 05:27.160 --> 05:30.570 And based corporate command like Soul Antrel. 05:33.230 --> 05:38.120 And I have successfully received all three messages, monarchy, cat and dog. 05:38.630 --> 05:44.090 Now we have a run stopper and we have agreed to successfully a topic with three politicians. 05:44.450 --> 05:45.740 Let's not make a short pause. 05:45.740 --> 05:53.600 And after it, let's explore what was actually in Kafka logs directory and where Kafka Brolga has saved 05:53.600 --> 05:57.170 those three messages that we co-produced by council producer. 05:57.320 --> 05:59.330 So see you after the small balls by.