-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathInstruction to set up ec2 server.txt
More file actions
70 lines (63 loc) · 2.29 KB
/
Copy pathInstruction to set up ec2 server.txt
File metadata and controls
70 lines (63 loc) · 2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
Instructions to set up ec2
-------------------------
ssh -i "datastars.pem" ubuntu@ec2-23-22-181-18.compute-1.amazonaws.com
sudo apt-get update
sudo apt-get install python3
sudo apt-get install python3-pip
sudo apt-get install nginx
sudo apt-get install gunicorn
sudo apt-get install awscli
sudo apt-get install libpq-dev python3-dev
Instructions to set up MongoDB
-----------------------------
Execute steps in MongoDB Setup.txt
mkdir data
aws s3 sync s3://instacart-527-g2/ data/
mongoimport -d instacart -c aisles --type csv --file data/aisles.csv --headerline
mongoimport -d instacart -c departments --type csv --file data/departments.csv --headerline
mongoimport -d instacart -c products --type csv --file data/products.csv --headerline
mongoimport -d instacart -c order_products --type csv --file data/order_products.csv --headerline
mongoimport -d instacart -c orders --type csv --file data/orders.csv --headerline
mongoimport -d instacart -c order_products_prior --type csv --file data/order_products_prior.csv --headerline
Instructions to set up driver for MongoDB
-----------------------------------------
mkdir flaskapp
aws s3 cp --recursive s3://project-527-final-variant/ flaskapp/
sudo apt-get install unixodbc-dev
pip3 install -r flaskapp/requirements.txt
sudo dpkg -i flaskapp/jars/devartodbcmongo_amd64.deb
vim /etc/odbc.ini
Server=127.0.0.1
Port=27017
Database=instacart
Client Library=libmongoc-1.0.so.0
BSON Library=libbson-1.0.so.0
TEST CONNECTION:
sudo apt install unixodbc
isql -v DEVART_MONGODB
Instructions to set up SQL Read interface for MongoDB
------------------------------------------------
wget https://info-mongodb-com.s3.amazonaws.com/mongodb-bi/v2/mongodb-bi-linux-x86_64-ubuntu2004-v2.14.3.tgz
tar -xvzf mongodb-bi-linux-x86_64-ubuntu2004-v2.14.3.tgz
cd mongodb-bi-linux-x86_64-ubuntu2004-v2.14.3
sudo install -m755 bin/mongo* /usr/local/bin/
mongodrdl sample --db instacart --out schema.drdl
nohup mongosqld --schema schema.drdl &
Instructions to set up flask app Server
-------------------------
cd flaskapp
cd /etc/nginx/
cd sites-enabled
sudo vi flaskapp
ADD THE FOLLOWING:
server {
listen 443;
server_name 23.22.181.18;
location / {
proxy_pass http://127.0.0.1:8000;
}
}
cd ~
cd flaskapp
sudo service nginx restart
gunicorn application:app