![]() ![]() The consumer script should be pulling the files from the broker and put them in the same folder as the one on the producing computer. The project name is the same one provided to the producer. Run the Consumer script by typing "python Consumer.py " in the directory of your script. Make sure you have python and kafka-python installed on the consuming computer as well. ie if you want the filght_1 folder to be on your desktop, then copy the Consumer.py script to your desktop. On your consuming computer, copy the script to the directory you wish the folder to be. ![]() The Producer script will automatically send the data to the broker to be consumed later. For example, with flight_1 I can modify it to be xiang3_flight_1 as the project name in Kafka to ensure that there’s no topic collision. A good way to come up with unique project name is to use your Clemson username as a prefix. The broker uses this to distinguish your files from other people's files. Once you have python and kafka-python installed, you can run the script from the terminal/command line by typing "python Producer.py " Try to make the project name as unique as you can. If you run into trouble installing kafka-python, more details are available here: To install kafka-python type “pip install kafka-python” in a terminal. Run echo %PATH% to double check that you made the modification correctly. ![]() Then run the previous command again and this time include \Scripts at the end to include pip to your path as well. Replace “” with the path you had when installing python. Then use “set PATH=%PATH% ” to change your path environment variable to include your recently installed python. If you do not have write permission to the default install path, change it and take note of the new path. Take note of the path that the installer defaults to. Open the installer and choose customize installation. To install python follow this link: and install python 3. Make sure you have python and kafka-python installed. For example, we want to transfer the files in flight_1 so the Producer script is in the same folder as flight_1. Copy the Producer script to a folder above the files you are trying to transfer. ![]()
0 Comments
Leave a Reply. |