$ sudo apt update && sudo apt upgrade -y
$ sudo apt-get install ffmpeg
Installation
$ sudo apt install python3.10
$ python3.10 --version # verify python version
Venv setup
$ cd src/
$ python3.10 -m pip install virtualenv
$ python3.10 -m venv <your_venv_name>
If this doesn't work - try:
$ sudo apt install python3-pip
$ sudo apt install python3-venv
Activate your venv
$ source <your_venv_name>/bin/activate
Install requirements
$ pip install -r requirements.txt
Installation
$ cd /opt/
$ sudo apt install default-jdk
$ sudo wget https://dlcdn.apache.org/kafka/3.4.0/kafka_2.12-3.4.0.tgz
$ sudo tar -xvzf kafka_2.12-3.4.0.tgz
Configuration
$ cd kafka_2.12-3.4.0/config
$ sudo nano server.properties
- Find advertised.listeners
- Uncomment line
- Change to advertised.listeners=PLAINTEXT://localhost:9092
- ctrl+x -> y -> enter
$ sudo nano producer.properties
- Find max.request.size
- Uncomment line
- Change to max.request.size=2097152
- ctrl+x -> y -> enter
Make Kafka startup quicker
$ cd <project-root>/kafka-commands/
$ chmod a+x chmod-kafka.sh
$ sudo ./chmod-kafka.sh
Start Zookeeper
$ sudo ./start-zookeeper.sh
Start Kafka
$ sudo ./start-kafka.sh
Stop Kafka Server and Zookeeper if needed
$ sudo ./stop-kafka-and-zookeeper.sh
Create topics for requests and results
$ sudo ./create-topics.sh
Start the consumer
(venv) $ cd <project-root>/predictions_server/
(venv) $ python main.py
Start the producer
(venv) $ cd <project-root>/api_server/
(venv) $ python main.py