Skip to content

GeoGateway/GPS_Scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

GPS_Scripts

Summary

Server to respond to the frontend- Geo-Gateway. The server is designed using micro service architecture to handle requests from the frontend. The current implementation can process 60 million data points in under 1.5 seconds using MongoDB. This repository is designed to configure and deploy code on the backend.

Prerequisite

The deployment is divided into 2 parts-

  1. Deploy machine- Where you will clone this repository. It can be your PC or a VM on the cloud. A VM on cloud is preferred because deployement process will be faster.
  2. Host machine - It will host the backend server. Make sure that it is an instance of 64 bit, 4 GB RAM or more, 100GB memory or more, CentOS 5.4 or less with Python 2.4 or less installed. An image can be found in community AMI of N.Virginia region of Amazon AWS EC2 (ami-7ea24a17).

The deploy machine first should have following installed-

  1. Git
  2. Python2.7
  3. [Pip] (https://pypi.python.org/pypi/pip)

Please make sure the following steps are carried out-

  1. You should have root access of host.
  2. You should be able to ssh from deploy machine to host. This can be done by copying the public SSH key of deploy machine to authorized_keys of host.

Eg: If you are using amazon ec2 instance for host you can connect using following command-

  ssh -i "~/.ssh/geo-gateway.pem" root@ec2-54-86-93-172.compute-1.amazonaws.com
  1. For Ansible to run please setup a ssh agent on deploy machine and add the public key.
  ssh-agent bash  
  ssh-add ~/.ssh/id_rsa_gpsSetup

Installation

  1. Clone this repository on deploy machine.
git clone https://github.com/GeoGateway/GPS_Scripts.git
  1. Change directory to the deploy folder.
cd GPS_Scripts/deploy
  1. Change the backend I.P. address in the inventory to specify on which machine to install.
    [backend]
    54.86.93.172
    54.157.16.80
  2. Set the destination in backend-code.yml where you want to install the server. It should be in a partition where you have 100 GB space.
    server_dest: /mnt/data
    server_dest: /root
  3. Execute the deploy.sh as follows-
source deploy.sh  
  1. Ssh into the backend by
  ssh -i "~/.ssh/geo-gateway.pem" root@ec2-54-86-93-172.compute-1.amazonaws.com
  1. Change directory to server
cd server
  1. Start a tmux session by
tmux
  1. Execute the start_server_mongo.sh file. It will start the server, however there is no database generated.
 source start_server_mongo.sh
  1. Detach from the tmux session and let the server run continously by pressing together Control, B and D keys.
  2. To generate the database first add the model files to the RDAHMM/Model folder
    For eg:
rsync -au --progress -e "ssh -i ~/.ssh/geo-gateway.pem" \
     /media/hru/Data/_Active_Projects/IS/RDAHMM/Model/UNR_SPLICE.tar.gz \
     root@ec2-54-85-163-109.compute-1.amazonaws.com:
  1. Start a new tmux session by
tmux
  1. The data can be added to the database by
sh PythonRDAHMM/cron_rdahmm_unr_all.sh
  1. Detach from the tmux session by pressing together Control, B and D key.

Author Information

Hrushikesh Dhumal (hrushikesh.dhumal@gmail.com)