Skip to content

Task Assignment1

nbafna04 edited this page Feb 14, 2020 · 19 revisions

Welcome to the NSA wiki!

This wiki is the main source of documentation for developers working with this project.

You can clone our project using the command below:

git clone https://github.com/airavata-courses/NSA.git

We will be using the following ports in our application. They are:

  • 8081 : api-gateway
  • 8082 : user-management
  • 3000 : UI
  • 9092 : Kafka broker
  • 3036 : MySQL
  • 27017 : MongoDB

1. Kafka and Zookeper server setup

For Kafka, we would need JDK. To install JDK on your system, you can refer here.

You would also need Docker and can be installed from Docker.

Start Kafka and Zookeper servers by running the command

docker-compose up -d

this should create a kafka broker listening on localhost:9092

2. Data Retrieval Service

Each micro service should run on a different terminal. This service data-retrieval is in python. Install python from here. Go to this folder using cd command.

cd data-retrieval

Then Execute

pip3 install -r ./requirements.txt

Then run

python3 dataretrieval.py

3. Post Processing Service

Open a different terminal to run this service. This service postprocessing is in python. Install python from here. Go to this folder using cd command.

cd postprocessing

Then Execute

pip3 install -r ./requirements.txt

You need to install pyart in a special way using the commands below:

python3 /pyart-master/setup.py build
python3 /pyart-master/setup.py install --user

Then run

python3 postprocessing.py

4. Session management:

Mongo DB setup:

  1. Install MongoDB from official website based on your OS https://docs.mongodb.com/manual/administration/install-community/

  2. Once the setup is done, create database using command:

mongo>
use user_session_history
  1. To list if the database is created:
show dbs

Service setup:

  1. Install Nodejs and npm package (can be installed from https://nodejs.org/en/ any version greater than 9. Follow the instructions to download nodejs and npm)

  2. Go to session-management folder:

cd session-management
  1. And run the commands below:
npm install
npm install nodemon --save-dev
npm install uuid
npm start

5. User Management

Database Setup :

  1. Install MYSQL database from here

  2. Create database using the command below:

CREATE DATABASE newdb;
  1. Run the User-management-service jar file
java -jar user_management.jar

If you get an error saying access denied to [email protected] then execute the command below:

sudo mysql -u root
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '';

6. User Interface Service

  1. Navigate to nwp_ui folder using cd.

  2. Run the below commands

npm install --save-dev
npm start
  1. Go to the browser and hit
localhost:3000

7. API Gateway Service

Run the API-Gateway-Service jar file using the command below. It is in the root folder of our project.

api_gateway.jar