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.
The deployment is divided into 2 parts-
- 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.
- 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-
Please make sure the following steps are carried out-
- You should have root access of host.
- 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" [email protected]
- 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
- Clone this repository on deploy machine.
git clone https://github.com/GeoGateway/GPS_Scripts.git
- Change directory to the deploy folder.
cd GPS_Scripts/deploy
- 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 - 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 - Execute the deploy.sh as follows-
source deploy.sh
- Ssh into the backend by
ssh -i "~/.ssh/geo-gateway.pem" [email protected]
- Change directory to server
cd server
- Start a tmux session by
tmux
- Execute the start_server_mongo.sh file. It will start the server, however there is no database generated.
source start_server_mongo.sh
- Detach from the tmux session and let the server run continously by pressing together Control, B and D keys.
- 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 \
[email protected]:
- Start a new tmux session by
tmux
- The data can be added to the database by
sh PythonRDAHMM/cron_rdahmm_unr_all.sh
- Detach from the tmux session by pressing together Control, B and D key.
Hrushikesh Dhumal ([email protected])