For older version SQLFlow under MacOS¶
This page is for SQLFlow 5.x.x.x¶
Please refer to the latest install manual if you are using the latest SQFlow (version > 6.0.0.0):
MacOS Installation
You can check this page for the SQLFlow berfore version
Old version installation
Installation Guide - MacOS (YouTube)
Prerequisites¶
- SQLFlow on-premise version
- Java 8
- Nginx web server.
- Port needs to be opened. (80, 8761,8081,8083. Only 80 port need to be opened if you setup the nginx reverse proxy as mentioned in the below)
- At least 8GB memory
Setup Environment¶
1 2 3 |
|
Install Nginx¶
Upload Files¶
create a directory :
1 2 |
|
upload your backend and frontend file to sqlflow
folder, like this :
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 |
|
set scripts permissions :¶
1 |
|
Start Backend Services¶
If your computer has more than 8G of memory, you can change the boot parameters to recommended
Please use the gspLive.sh, eureka.sh and sqlservice.sh under mac directory instead of the original one.
- /wings/sqlflow/backend/bin/gspLive.sh
1 2 3 4 |
|
- /wings/sqlflow/backend/bin/eureka.sh
1 2 3 4 |
|
- /wings/sqlflow/backend/bin/sqlservice.sh
1 2 3 4 |
|
start service in background:
1 |
|
please allow 1-2 minutes to start the service.
use jps
to check those 3 processing are running.
1 2 3 |
|
Java service port
File | Port |
---|---|
eureka.jar | 8761 |
gspLive.jar | 8081 |
sqlservice.jar | 8083 |
Nginx Reverse Proxy¶
If we set the reverse proxy path of gspLive restful service to /api
1. Config Nginx
open your nginx configuration file ( at /usr/local/etc/ngin/nginx.conf
), add a server :
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 |
|
2. modify frontend configuration file config.private.json
- Open the configration file "/wings/sqlflow/frontend/config.private.json"
- Modify the ApiPrefix attribute
1 |
|
Start Frontend Services¶
start your nginx :
1 |
|
or reload :
1 |
|
open http://yourdomain.com/ to see the SQLFlow.
open http://yourdomain.com/api/gspLive_backend/doc.html?lang=en to see the Restful API documention.
Sqlflow client api call¶
-
Get userId from gudu_sqlflow.conf
-
Open the configration file "/wings/sqlflow/backend/conf/gudu_sqlflow.conf"
- The value of anonymous_user_id field is webapi userId
1 |
|
-
Note: on-promise mode, webapi call doesn't need the token parameter
-
Test webapi by curl
- test sql:
1
select name from user
- curl command:
1
curl -X POST "http://yourdomain.com/api/gspLive_backend/sqlflow/generation/sqlflow" -H "accept:application/json;charset=utf-8" -F "userId=YOUR USER ID HERE" -F "dbvendor=dbvoracle" -F "sqltext=select name from user"
- response:
1 2 3 4 5 6 7 8 9 10 11 12 13
{ "code": 200, "data": { "dbvendor": "dbvoracle", "dbobjs": [ ... ], "relations": [ ... ] }, "sessionId": ... }
- If the code returns 401, please check the userId is set or the userId is valid.